3

I'm currently building a large project that contains sources written in few languages such as C,C++ & Python. I recently managed to (painfuly) handle autotools to make a proper install. Next step is to create .deb because our project is meant to run on debian stretch.

I tried several ways to do this but i can't get it working whether the way.

Tree .deb generated by checkinstall :

    unpack/
├── etc
│   └── nina
│       ├── auto_blacklist.txt
│       ├── blacklist.txt
│       ├── conf
│       ├── keywords.txt
│       ├── rubbish_links.txt
│       └── whitelist.txt
└── usr
    ├── local
    │   ├── bin
    │   │   ├── geckodriver
    │   │   └── nina
    │   ├── lib
    │   │   └── python2.7
    │   │       └── dist-packages
    │   │           ├── nina.py
    │   │           ├── nina_py_installed_files.txt
    │   │           ├── Uinput_wrapping_module-2.0.egg-info
    │   │           └── uinput_wrapping_module.so
    │   └── share
    │       └── man
    │           └── man1
    │               └── nina.1.gz
    └── share
        └── doc
            └── nina
                ├── COPYING
                ├── doc
                │   ├── Doxyfile
                │   └── nina.1
                ├── README
                └── README.md

Tree .deb generated by debhelper (v9):

unpack/
├── etc
│   └── nina
│       ├── auto_blacklist.txt
│       ├── blacklist.txt
│       ├── conf
│       ├── keywords.txt
│       ├── rubbish_links.txt
│       └── whitelist.txt
└── usr
    ├── bin
    │   └── nina
    ├── lib
    │   └── python2.7
    │       └── dist-packages
    │           └── nina.py
    └── share
        ├── doc
        │   └── nina
        │       ├── changelog.Debian.gz
        │       └── copyright
        └── man
            └── man1
                └── nina.1.gz

As you can see it's not quite the same (sic). I'm more or less understanding what checkinstall does : it runs make install commands and just get files outputs to place it where it's installing on MY machine. debhelper seems to be a way more proper tool here. (installing in /usr/lib and not /usr/local/lib, allow us to sign packages & so on.) and i'd prefer to use it but it's not working as expected to do.

And on huge plus on debhelper way is that it's actually handling dependancies specified in debian/control and stuff. But checkinstall doesn't.

What debhelper is not doing :

  • Getting some binary (geckodriver) from internet source and placing it in /usr/bin

  • installing an homemade python module

Those actions are performed in my Makefile.am by overriding install-exec-local: (& respectively uninstall-local:) methods and executing some bash commands.

---

So my question is : how could i keep best parts of those two packaging ways to made it "perfect" ?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Neah-Ko
  • 123
  • 1
  • 10
  • 3
    This doesn’t answer your specific question, but I suggest you look at [Vincent Bernat’s pragmatic Debian packaging](https://vincent.bernat.im/en/blog/2016-pragmatic-debian-packaging) guide; it might well be a better fit for you. – Stephen Kitt Mar 09 '17 at 07:59

2 Answers2

3

Downloading things from the internet is something a Debian package build is not supposed to be doing. If you use some 'build in clean chroot' helper, it may not even be able to do so. However, plain dpkg-buildpackage should be able to do so. If your autotools build system does the right thing, then nothing should be needed; otherwise, you'll need to add the necessary commands to an override_dh_foo command (see 'man dh' on that).

For Python modules, what you need to do is install the .py files from your build system, too, respecting $DESTDIR. If you do so, debhelper in dh mode should just DTRT.

If none of that worked, please produce a minimal version of your package that exhibits the problem; otherwise this is very much a crystal ball problem.

Wouter Verhelst
  • 9,171
  • 18
  • 43
0

I rethinked my Makefile.am thanks to you. And eventually managed to get something.

  • Geting geckodriver

I am running the script to get it at ./configure step, and placing it as a file dependency in .deb package by assuming it's on the packing system like this :

bindeptsdir = \
    $(prefix)/bin
bindepts_DATA = \
    /usr/local/bin/geckodriver
  • Installing python module

$(DESTDIR) was indeed the solution here, now my python module is installed like this :

$(PYTHON) setup.py install \
    --root $(DESTDIR)

And it works fine appart from the fact that i must place this in my debian/rules : override_dh_usrlocal: else it's yelling at me because i'm installing files in /usr/local

I'd prefer not, but python is handling installation by itself, and i can't specify installation path. The other solution was to specify --prefix $(DESTDIR)$(prefix) instead of --root... but it's installing files in /usr/lib/python2.7/site-packages which is not in pythonpath.

---

Appart from python troubles final result works just fine with dpkg-buildpackage.

Neah-Ko
  • 123
  • 1
  • 10