Package Building
# Daniel Holbach's Packaging Guide https://wiki.ubuntu.com/PackagingGuide # Skip introduction go to /GettingStarted
# Install these apps sudo apt-get install build-essential devscripts debhelper dh-make diff patch gnupg fakeroot \ lintian linda pbuilder
# Create your pbuilder environment (uses it's own sources; config in /etc/pbuilder/pbuilderrc) sudo pbuilder create --distribution gutsy \ --othermirror "deb http://archive.ubuntu.com/ubuntu gutsy universe multiverse"
# Optional Add these lines to your ~/.bashrc export DEBEMAIL="your.email@host.com" export DEBFULLNAME="First Last" # Then source ~/.bashrc
# Browse to the next section of the packaging guide https://wiki.ubuntu.com/PackagingGuide/Basic
wget ftp://ftp.gnu.org/gnu/hello/hello-2.2.tar.gz cp hello-2.2.tar.gz hello_2.2.orig.tar.gz apt-get source hello cd ubuntu/hello-2.2/debian
# Now on to actually MAKING a .deb package! # Make your build environment for hello mkdir ~/hello-debhelper cd ~/hello-debhelper # Grab hello source from upstream wget http://ftp.gnu.org/gnu/hello/hello-2.2.tar.gz # Grab Ubuntu-ified version for comparison mkdir ubuntu cd ubuntu apt-get source hello-debhelper cd ../ # Extract hello tar zxvf hello-2.2.tar.gz mv hello-2.2 hello-debhelper-2.2
# Do the Debian! ### STOP HERE!!
#verify your environment variables echo $DEBFULLNAME $your $name echo $DEBEMAIL yourname@gmail.com
cd hello-debhelper-2.2 dh_make -f ../hello-2.2.tar.gz cd debian rm *.ex *.EX
# We'll start by modifying the changelog vi changelog # and change the following 1. unstable should become gutsy, or whatever environment you're building for 2. Wipe out everything after Initial release (on that line) 3. Verify your name & <email@address> are correct # For now we're copying these files, in "reality" you'd modify each one cp ../../ubuntu/hello-debhelper-2.2/debian/copyright . cp ../../ubuntu/hello-debhelper-2.2/debian/control . cp ../../ubuntu/hello-debhelper-2.2/debian/rules .
# Now we create the source package cd .. debuild -S -k<your key ID if debuild doesn't find the env variables> # Build the package with pbuilder sudo pbuilder build ../*.dsc # To see your end result cd /var/cache/pbuilder/result/ # See how broken your .deb actually is! cd ~/hello-debhelper/ lintian -i *.dsc
# Upgrading an existing package cd ~/hello-debhelper wget http://ftp.gnu.org/gnu/hello/hello-2.3.tar.gz cd hello-debhelper-2.2 uupdate -u hello-2.3.tar.gz # Cross your fingers, and hope a lot hasn't changed since the previous version
debuild -S sudo pbuilder build ../*2.3*.dsc or ../hello-debhelper_2.3-1.dsc If everything went well you should have 2.3 debs in /var/cache/pbuilder/result
linux/packaging/building.txt · Last modified: 23:02 03/11/2007 by rharding



