Self? Self. I’m writing you a note since you’ll likely have to do more of this in the future, and for all the sad, sad people coming in from search engines.
It was difficult to figure out, as somebody who’s always just said “the hell with it” and build straight from source, to try The Debian Way and build a Debian binary package from a Debian source package. Debian provided the software I needed as a binary package, but I needed to make a small change to how it was compiled. It’s with frank embarrassment I admit I’ve been a user of Debian (and descendants) for ten years and never run into this yet – well, I did, but I always just built from scratch instead of packaging.
Anyway, my sob story: I’d got an SSL cert that was made with OpenSSL and it was proving troublesome to use with
ngircd, which the Debian Commies (bless them all) built with GnuTLS support. I didn’t feel like getting a replacement cert – this one was signed by a CA already, and yadda yadda, shave one yak to avoid another.
Anyway, I had to dig and dig to figure out the incantations, but here’s the process I went through to build my own local Debian binary package of
ngircd with OpenSSL support.
# cd /usr/src
# mkdir ngircd
# cd ngircd
# apt-get build-deps ngircd
# apt-get source ngircd
apt-get build-deps didn’t install
openssl-dev – of course, it’s not a dependency for the official package, but it also doesn’t exist in Debian 7 (wheezy) and no I do not want to know any of the backstory behind that. Anyway, the code built on my system just fine, thankfully. Here’s what I did to change the
./configure parameter and then build a Debian package out of the modified source:
# cd /usr/src
# cd ngircd-19.2
# vim debian/rules # edit 'configure' params, sub --with-openssl w/ --with-gnutls
# dch -i # enter a changelog entry
# debuild -i -us -uc -b
Now it chastises me for linking GPL code with OpenSSL, but there is a compiled binary .deb in the parent directory.
If you’re wandering in from DuckDuckGo trying to figure out how to build a Debian deb-src package from source because you need to make a small change and compile a binary Debian package from it, well, I hope this simple example is of some use.
I am quite sure it gets worse from here as the complexity of changes you wish to make increases.