Recreate Debian Package

What if I want to change an existing package in Debian, e.g. some configure setting should be adjusted?

Repackage bind9

First, we need all the prerequisits:

mkdir ~/build
cd build
 
# build environment
sudo apt-get install devscripts build-essential fakeroot
# the source packages of bind9 with all the debian stuff
sudo apt-get source bind9
# pull in all dependencies
sudo apt-get build-dep bind9
 
cd bind9-9.8.4.dfsg.P1

Next, make your changes. I changed the configure command and added –with-dlopen=yes

50d49
<         --with-dlopen=yes \

The next step would be to append an entry to the changelog and assign a new version number, so your package would integrate with the package system. This will also prevent unwanted updates by security updates.

export DEBEMAIL="Thorsten Bäcker <t #dot# baecker #at# tobanet #dot# de>"
VERSION=$(dpkg-parsechangelog | sed -ne 's,^Version: ,,p')
dch --newversion=$VERSION+0.pso.1 -- Recompiled with dlopen=yes by TB
 
dpkg-parsechangelog
Source: bind9
Version: 1:9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1
Distribution: UNRELEASED
Urgency: low
Maintainer: Thorsten Bäcker <t #dot# baecker #at# tobanet #dot# de>
Date: Thu, 12 Dec 2013 10:42:28 +0100
Changes:
 bind9 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1) UNRELEASED; urgency=low
 .
   * Recompiled with dlopen=yes by TB

(Re)build the package:

dpkg-buildpackage -rfakeroot -uc -us -j4

When finished, the packages are there:

cd ..
ls -1 *.deb
bind9-doc_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_all.deb
bind9-host_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
bind9utils_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
dnsutils_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
host_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_all.deb
libbind9-80_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
libbind-dev_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
libdns88_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
libisc84_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
libisccc80_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
libisccfg82_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
liblwres80_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb
lwresd_9.8.4.dfsg.P1-6+nmu2+deb7u1+0.pso.1_amd64.deb

Last step: install your shiny new packages:

sudo dpkg -i *.deb
debian/recreate_package.txt · Last modified: 2013-12 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready