lovingboth: (Default)
Ian ([personal profile] lovingboth) wrote2010-05-30 01:21 pm

Lazyweb - building Debian programs from source

I don't need to do this very often (thank you Debian maintainers) but the package for analog, the log file analyser, still hasn't been updated with the patch to recognise Windows versions post-2004: Vista and 7 are 'unknown' as far as it is concerned.

(Analog is wonderful, but its author decided to hardwire various detection routines in the c source rather than have them in a config file and has been "too busy" to update the program since 2004.)

So, obviously, you just download the source package, unpack, edit the relevant tree.c file and make, right?

No, you add deb-src lines to the /etc/apt/sources.list file, update, and do

sudo apt-get source analog


then edit and make.

No, because the resulting executable file complains it cannot find various config files - Debian decided to put them somewhere else. What you actually need to do is

sudo apt-get source analog -b


(get the source - actually, realise you already have it and so don't overwrite the changes you made - and build it, including all the Debian changes.)

And that works! Rename the old binary, copy the new one into /usr/bin and..

ian@core2 ~ $ ls -la /usr/bin/ana*
-rwxr-xr-x 1 root root 1122930 2010-05-30 13:06 /usr/bin/analog
-rwxr-xr-x 1 root root 367568 2009-04-28 21:58 /usr/bin/analog-old

In my ignorance, I was expecting something nearly the same size. Why is it so much bigger (1.1Mb vs 360k)? Debug info? (If so, a) why's that the default and b) that's an awful lot of debug info!) Something else? How do I get something roughly the same size?
bondagewoodelf: (Default)

debian

[personal profile] bondagewoodelf 2010-05-30 01:24 pm (UTC)(link)
Installing should be easier. The apt-get source ... -b will have made one or more .deb
files (in the directory where you type apt-get). Those can be installed using

dpkg -i .deb

the resulting different in binary size is probably caused by you having put the unstripped
built version. You can either fix this by reverting the thing you did with the -old
and then installing the .deb file, or you could consider trying 'strip /usr/bin/analog'
(to strip the debugging info off the executable). The file(s) inside the .deb should have
been stripped already.

(see 'man strip', and 'man dpkg')
bondagewoodelf: (Default)

Re: debian

[personal profile] bondagewoodelf 2010-05-30 01:26 pm (UTC)(link)
Hmpf, DW turned by <file> in there into a 'file' tag.

You should type: dpkg -i <whatever file it made>.deb