Note to self: modifying a Debian source package, then building the binary.

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

Note, 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.

Advertisements

2 Comments

  1. Nick
    Posted 1 August 2013 at 08:56 | Permalink | Reply

    Wouldn’t libssl-dev be the OpenSSL dev package you’re after? That *is* in wheezy.

    • Posted 1 August 2013 at 13:59 | Permalink | Reply

      It appears so. I wish there were more clue about that that I could have picked up on.

      At this point I may just go get a cert that works with the default GnuTLS build, but hopefully the blog post is useful to Debian source package noobs like myself in the future. :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: