[SLL] DEB packaging question
Andrew Sweger
andrew at sweger.net
Thu Feb 19 13:03:33 PST 2009
I used to have the same complaints about Debian packaging. But after years
of making various one-off packages for in-house software distribution I've
come to appreciate it. It almost seems natural. With over 20,000 packages
in the Debian package repositories, the diversity of what's been packaged
almost demands a nearly custom solution for each source. What really
amazes me is how it all works together so well. The debian package spec is
the common meeting ground and how you get there is up to you. There are
several tools that simplify it (such as dh-make-perl for packaging most
Perl modules), but finding the right one and getting used to it is a lot
of work. Once you find one that fits your current situation, you tend to
stick with it.
On Thu, 19 Feb 2009, Derek Simkowiak wrote:
> Bryan,
> Thank you for your help, and all the useful links. It was very
> helpful to have a list of current, "valid" documentation to read. Much
> of what I found on my own seemed outdated or irrelevant.
>
> Even after reading the docs, it seems like there is no standard way
> to set up a repository for use with packaging. Some tools require
> putting the ./debian/ directory in the main tree, some require a
> separate tree (to track downstream changes independently), and some
> allow you to keep just a sparse ./debian/ directory, and the upstream
> source is pulled from the tarball. It seems like many of the steps are
> still manual, like renaming the source tarball to the ".orig.tar.gz"
> name, rev'ing the package version number, and deleting the .ex/.EX files
> that dh_make generates. I haven't yet found a tool to pull the
> ChangeLog from Bazaar into debian/changelog. And I haven't found any
> standard like debian/postinst or RPM's postinstall for upstream
> tarballs, so manual copying is required there, too.
>
> I've started a simple shell script to automate my package build. It
> needs a little more work (I still need to include my license, and it
> doesn't carry over the package changelog from prior versions) but maybe
> it will help others. If I rev the version of my package, it generates a
> new packaging directory and puts it into Bazaar (version control)
> automatically. I'm using Python's distutils (setup.py) as the starting
> point, because it supports RPM natively and with CDBS the DEBs come
> almost for free.
>
> I hope this mess gets cleaned up in the future... the learning curve
> on making a simple package is much steeper than it needs to be.
>
>
> Thanks Again,
> Derek Simkowiak
>
> P.S.> My custom little build script "build_deb.sh" follows (78 lines).
>
> #!/bin/bash
>
> VERSION="0.1"
> PACKAGE="vm-shell-client"
>
> # Die on error:
> set -e
>
> # chdir up, if called from within ./tools
> if [ -e ../setup.py ]; then
> cd ../
> fi
>
>
> # Build the tarball:
> python setup.py sdist
>
> # Decompress it:
> cd dist
> gzip -dc ${PACKAGE}-${VERSION}.tar.gz | tar xfBp -
>
> # Move it to the .orig.tar.gz name that DEB expects
> mv ${PACKAGE}-${VERSION}.tar.gz ${PACKAGE}_${VERSION}.orig.tar.gz
>
> # Build the package
> cd ${PACKAGE}-${VERSION}
>
> # Create any necessary (new) package files:
> if [ ! -e debian ]; then
> mkdir -p debian
> bzr init
> fi
>
> if [ ! -e debian/control ]; then
> cat >> debian/control <<EOD
> Source: $PACKAGE
> Section: Utilities
> Priority: optional
> Maintainer: Derek Simkowiak <debs at cool-st.com>
> Build-Depends: cdbs (>=0.4.49), debhelper (>= 5), python-central (>=0.5.6)
> XS-Python-Version: >=2.4
> Standards-Version: 3.7.2
>
> Package: $PACKAGE
> Architecture: all
> XB-Python-Version: \${python:Versions}
> Depends: openssh-client, bash, \${python:Depends}, \${misc:Depends}
> Description: Run vm-shell commands directly from bash
> Config file at /etc/vm-shell.conf
>
> EOD
> bzr add debian/control
> fi
>
> if [ ! -e debian/rules ]; then
> cat >> debian/rules <<EOD
> #!/usr/bin/make -f
>
> DEB_PYTHON_SYSTEM=pycentral
>
> include /usr/share/cdbs/1/rules/debhelper.mk
> include /usr/share/cdbs/1/class/python-distutils.mk
>
> # Add here any variable or target overrides you need.
> EOD
> chmod +x debian/rules
> bzr add debian/rules
> fi
>
> if [ ! -e debian/changelog ]; then
> dch --create --package $PACKAGE -v $VERSION
> bzr add debian/changelog
> else
> dch
> fi
>
> #bzr builddeb # Broken.
> dpkg-buildpackage
>
--
Andrew B. Sweger -- The great thing about multitasking is that several
things can go wrong at once.
More information about the linux-list
mailing list