5

I am trying to turn Spamdyke 4.3.1 (download link) into Debian package (.deb). This is pretty easy software to build, no crazy dependencies, just libssl-dev so:

apt-get install build-essential devscripts \
                debhelper dh-make libssl-dev

and then once you unpack the sources:

cd spamdyke-4.3.1/spamdyke
./configure --exec_prefix=/usr 
make

and usual

make install

As I am willing to make the Debian package out of this software, I created all the necessary files in debian/ folder and modified its install target in spamdyke/Makefile.in by adding ${DESTDIR}:

install: spamdyke
        cp spamdyke ${DESTDIR}/usr/local/bin/spamdyke-@PACKAGE_VERSION@
        rm -f ${DESTDIR}/usr/local/bin/spamdyke
        ln -s ${DESTDIR}/usr/local/bin/spamdyke-@PACKAGE_VERSION@ ${DESTDIR}/usr/local/bin/spamdyke

But my current problem is that the distribution archive keeps all the sources in spamdyke/ folder instead of root folder which is not what dh_* tools expect to do all the heavy lifting automatically:

drwxr-xr-x   4 vagrant vagrant  4096 Feb  3 10:57 debian
drwxr-xr-x   3 vagrant vagrant  4096 Jan 30 19:43 documentation
drwxr-xr-x   2 vagrant vagrant  4096 Feb  5 21:00 spamdyke
drwxr-xr-x 997 vagrant vagrant 77824 Jan 30 19:43 tests
drwxr-xr-x   2 vagrant vagrant  4096 Jan 20  2012 utils

Unfortunately I am unable to create correct debian/rules to make all the packaging work. I would love to keep my debian/rules as simple as possible and frankly I hoped that pointing it to spamdyke source folder with --builddirectory option would be sufficient at least for configure and build steps. My current debian/rules now looks like this:

#!/usr/bin/make -f
export DH_VERBOSE = 1

%:
        dh $@  --builddirectory=spamdyke

override_dh_auto_configure:
        dh_auto_configure --builddirectory=spamdyke -- --exec_prefix=/usr

override_dh_auto_build:
        dh_auto_make --builddirectory=spamdyke

however debuild -b -us -uc produces pretty empty .deb package in result, with lintian complaining about empty-binary-package:

dpkg-genchanges: binary-only upload (no source code included)
 dpkg-source --after-build spamdyke-4.3.1
dpkg-buildpackage: binary-only upload (no source included)
Now running lintian...
W: spamdyke: new-package-should-close-itp-bug
E: spamdyke: copyright-should-refer-to-common-license-file-for-gpl
W: spamdyke: empty-binary-package
Finished running lintian.

I hope must be missing something obvious here, but at the moment I am unable to find out what to search for. Any hints appreciated. Thanks in advance.

1 Answers1

5

You need to set --sourcedirectory instead of --builddirectory on dh $@ call, it will affect all dh_auto_*. So you may remove those overrides.

BUILD SYSTEM OPTIONS
       The following command line options are supported by all of the 
       dh_auto_* debhelper programs. These programs support a variety 
       of build systems, and normally
       heuristically determine which to use, and how to use them. You
       can use these command line options to override the default 
       behavior.  Typically these are passed to
       dh(1), which then passes them to all the dh_auto_* programs.


   -Ddirectory, --sourcedirectory=directory
       Assume that the original package source tree is at the 
       specified directory rather than the top level directory of 
       the Debian source package tree.

   -B[directory], --builddirectory=[directory]
       Enable out of source building and use the specified directory
       as the build directory. If directory parameter is omitted, a 
       default build directory will be chosen.

Source: man debhelper

NOTE:

  • Avoid using hard-coded paths

    Example /usr/local, Use instead $prefix variable. autotools have /usr/local as default, debhelper reset to /usr (No need to set manually)

    Suggested fixes:

    spamdyke/Makefile.in define prefix and change symbolic link target.

    prefix := @prefix@
    ...
    install: spamdyke
            mkdir -p ${DESTDIR}$(prefix)/bin/
            cp spamdyke ${DESTDIR}$(prefix)/bin/spamdyke-@PACKAGE_VERSION@
            rm -f ${DESTDIR}$(prefix)/bin/spamdyke
            ln -s $(prefix)/bin/spamdyke-@PACKAGE_VERSION@ ${DESTDIR}$(prefix)/bin/spamdyke
    

    debian/rules remove the override

    #!/usr/bin/make -f
    export DH_VERBOSE=1
    
    %:
            dh $@ --sourcedirectory=spamdyke
    

    Reference: GNU Coding Standards

user.dz
  • 49,176