Mastodon
sungate.co.uk

sungate.co.uk

Ramblings about stuff

Debian: Learning to package stuff, building package repository

For various reasons throughout the week, I’ve been delving somewhat deeper into the world of Debian packaging and how that works.

The start of it stems from a bug report I raised a while ago against the odbc-postgresql package. Basically, when an ODBC client tried to ‘describe’ a PostreSQL table (i..e “show me the names of the fields”) it was segfaulting. This is a fairly obscure package and I was running it on a not-yet widespread platform, AMD-64. Therefore, I felt that having (a) uncovered the serious bug and (b) some intelligence, it was my duty to investigate this further.

In doing so, I had to rebuild the odbc-postgresql package from source a number of times, and create a Debian package from the results. Having not really done this much before, this was educational, but as it turns out, not actually too difficult. My first task was to rebuild the package with the same options as the distributed binary, just in case there had been a build error: same problem occurred. So, after a suggestion from the odbc-postgresql package maintainer, I rebuilt the package with debugging symbols in order to get more information about the segfault. ‘Amusingly’, a debugging-enabled build doesn’t actually segfault, and works fine. The odbc-postgresql maintainer concluded, presumably correctly, that this means it’s a compiler bug causing the segfault, rather than necessarily a problem with the odbc-postgresql code itself. The sage continues …

After seeing how relatively easy it is to rebuild Debian packages in this way, I thought I’d investigate building packages from scratch. The Debian New Maintainers’ Guide is very helpful and takes you through it. I managed to successfully package dosunix (which I wrote, but is not part of the offical Debian project) and not only that, but create packages for both i386 and amd64 platforms. This is good.

The package dosunix is used on a number of systems at work, and so I thought that having a nice Debian package repository would be helpful. So, I followed the Debian Repository HOWTO and created a small repository for local use. This means that, after adding the appropriate line to /etc/apt/sources.list on each system, “apt-get install dosunix” downloads and installs the package just like anything in the official Debian repositories. This is also good.

In the medium term, I’m wondering about developing my Debian involvement. At the moment, I do as much as I can on the ‘coal face’: answering queries on debian-user, filing and following-up bug reports etc. A further step would be taking over the maintainership of one or more packages; perhaps I’ll speak to the current Debian maintainer of my colordiff program and see if he’d be happy to let me take it over, with him acting initially as a sponsor for uploading the packages themselves. As a first step towards that, I subscribed to debian-developer and debian-mentors on Friday. Wow, what a lot of mail … 😉

One Response to Debian: Learning to package stuff, building package repository

  1. “a debugging-enabled build doesn’t actually segfaul”

    why doesn’t this surprise me…..goes back to the fun with had with the firewall.

    Permalink

Comments are closed.