Basic packaging¶
Configuration files¶
All the commands in this guide assumes that you're using these configuration files.
Starting a new package¶
We use the packages/ folder from this repo to store sources:
mkdir packages/$package
cd packages/$package
Getting the debianized source¶
Using dget:
dget $remote_dsc
cd $package*
Using apt-get:
apt-get source package
Checking the source¶
See checking.md.
Extracting the source¶
If needed, do this after your successfully verified the sources:
dpkg-source -x *.dsc
Getting dependencies¶
To get:
apt-get build-dep package
To remove:
hydractl remove-dep package
Another way to get dependencies:
aptitude search '!~i?reverse-depends("^package$")' -F "%p" | xargs aptitude install -y
References:
- How to install only the dependencies of a package? - Ask Ubuntu
- How to list/download the recursive dependencies of a debian package? - Stack Overflow
Creating the debian/ structure¶
If the package wasn't debianized, proceed with
if [ ! -d "debian" ]; then
dh_make -p ${package}_${version} --createorig
fi
Simple build¶
dch -i
dpkg-buildpackage -rfakeroot -sa -k$KEY_ID
Creating a new debian source¶
cd ..
dpkg-source -b $package*
debsign $package*.dsc
Building and signing¶
To generate signatures, remove -uc and -us from dpkg-buildpackage (see
Complete build):
dpkg-buildpackage -rfakeroot
To sign using an specific key:
dpkg-buildpackage -rfakeroot -kKEY_ID