Re: Debian/Ubuntu Packaging Nightmares

Stephen Gregory <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
Jon wrote:
>
> Can anyone help me to write a debian/rules file that will:
> 
> 1. Patch some files, including some Makefile.am files?
> 
> 2. Run:
>      autoreconf --install --force
> 
> 3. Run a custom configure command:
>      ./configure --disable-static --prefix=/usr
> 
> 4. Build (and clean) the project.
> 
> 5. Most important: Generate the deb file.

I would do this manually or write a simple shell script. No need for
rules files. I maintain internally distributed code this way including
the a custom libqt4 for Ubuntu/Hardy (old stable)

In your case I would untar the source, use patch to apply any changes,
then compile. Copy the correct files to foo/ and foo-dev/. Make you
DEBIAN control files and build the package.

Some makefiles have an INSTALL_PREFIX or similar that make it easy to
get the right files into the tree to make the debian package.

Here is a snippet of my package bash script that builds the .deb.
PKG_DIR is a temp dir to build the package in. BASE_DIR is the directory
where I keep the source tarball and directory, the build script, and
anything else I need to build the package.

Read the debian policy guide to get the PKG_VERSION right. You will
likely want a version that is similar, but higher then the official
package.

http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version


ARCH is usually set with:
ARCH=$( dpkg --print-architecture )

read the debian policy manual for the various control fields, and the
files postinst, and conffiles. I use a bare minimum of control fields.
No control field can be left blank so delete the fields if you don't use
them.

---------
mkdir -p "${PKG_DIR}/DEBIAN"
cat > "${PKG_DIR}/DEBIAN/control" <<-CONTROL
        Package: ${PKG_NAME}
        Version: ${PKG_VERSION}
        Maintainer: [email protected]
        Architecture: ${ARCH}
        Recommends:
        Conflicts:
        Depends:
        Description: foo dummy package
CONTROL

install -o root -g root -m 755 "${BASE_DIR}/postinst"\
    "${PKG_DIR}/DEBIAN/postinst"

cat > "${PKG_DIR}/DEBIAN/conffiles" <<-CONF
      /etc/foo.conf
CONF

mkdir -p "${PKG_DIR}/usr/bin"

install -m 755 -o root -g root "${BASE_DIR}/foo" "${PKG_DIR}/usr/bin"
install -m 644 -o root -g root "${BASE_DIR}/foo.conf" "${PKG_DIR}/etc"


dpkg-deb --build "$PKG_DIR" .
---------
-- 
OCLUG general discussion list
[email protected]
http://oclug.on.ca/mailman/listinfo/oclug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.