5

What's I'm doing:

I'm trying to build a deb package of a compiled version of qt.

Where I'm at:

$ wget http://download.qt.io/official_releases/qt/5.10/5.10.0/single/qt-everywhere-src-5.10.0.tar.xz
$ tar -xf qt-everywhere-src-5.10.0.tar.xz ~/src/qt
$ cd ~/src/qt/qt-everywhere-src-5.10.0
$ ./configure --prefix=/opt/sim-qt --opensource --confirm-license --skip qtcharts --skip qtvirtualkeyboard --skip qtdatavis3d --silent --nomake examples --nomake tests
$ make

If I run sudo make install, everything installs fine, but I need a .deb package so that other people in my organization can also install the same binaries without the need to re-compile.

The problematic step:

I've read that the tool I should use is checkinstall. I tried checkinstall with a simple helloworld example and things seemed to be fine. This is the perfect situation and is exactly what I was expecting. However, when I try to install this Qt project, I get errors like so:

$ checkinstall -D --install=no --pkgname=sim-qt --pkgversion=5.10.0 --pkgrelease=0 --pkglicense=LGPL --nodoc
...
/home/stew/src/qt/qt-everywhere-src-5.10.0/qtbase/bin/qmake -install qinstall /home/stew/src/qt/qt-everywhere-src-5.10.0/qtbase/include/QtGui/QDragLeaveEvent /opt/sim-qt/include/QtGui/QDragLeaveEvent
Error copying /home/stew/src/qt/qt-everywhere-src-5.10.0/qtbase/include/QtGui/QDragLeaveEvent to /opt/sim-qt/include/QtGui/QDragLeaveEvent: Cannot create /opt/sim-qt/include/QtGui/QDragLeaveEvent for output
Makefile:69204: recipe for target 'install_class_headers' failed
make[3]: [install_class_headers] Error 3 (ignored)
...

Identifying the problem:

It sounds like this is an old bug with checkinstall which has existed since at least 2007 (that was the oldest report I could find).

Trying a work-around:

Some people recommended to use --fstrans=no, and when I do that I see that now I can at least install folders, but the files all fail to deploy:

$ checkinstall -D --install=no --pkgname=sim-qt --pkgversion=5.10.0 --pkgrelease=0 --pkglicense=LGPL --nodoc --fstrans=no
...
/home/stew/src/qt/qt-everywhere-src-5.10.0/qtbase/bin/qmake -install qinstall /home/stew/src/qt/qt-everywhere-src-5.10.0/qttranslations/translations/qtscript_en.qm /opt/sim-qt/translations/qtscript_en.qm
Error copying /home/stew/src/qt/qt-everywhere-src-5.10.0/qttranslations/translations/qtscript_en.qm to /opt/sim-qt/translations/qtscript_en.qm: Cannot create /opt/sim-qt/translations/qtscript_en.qm for output
Makefile:2841: recipe for target 'install_translations' failed
make[2]: [install_translations] Error 3 (ignored)
...

What's next:

This is where everyone seems to stop. If checkinstall had a cripling bug for 11 years that renders it totally useless, then I would imagine that it wouldn't exist anymore. But it does. So I'm missing the work-around that people seem to be finding. Otherwise, I'm confused on what to do next.

How do people package deb files?

I found this tutorial for ubuntu. But it assumes that you are using Canonical's bzr for a version control system and uses the VCS as part of its operation? I'm not planning to push this package to Ubuntu and so I don't really understand why the instructions also include bzr commit... and stuff.

I also found this tutorial for debain. I like it because it doesn't rely on some strange version control system automatically generating stuff. But it also seems to assume that I have pre-debianized tar.gz source archives and I intend to submit the packages to debian. It also assumes that I don't want to add any parameters to ./configure which is false. I've tried adding common-line parameters to debian/rules in the override_dh_auto_configure section but I can't tell if it's working as everything seems to be failing about 10000 lines before I get my command prompt back.

Here's another tutorial on the subject but this one requires you to have a gpg key, something I am expecting my apt repository to handle when I reprepro the deb package to the apt repo. When running through this solution I also had problems with the build failing. Because it prints out tens of thousands of lines, I can't tell where/why it is failing. Only that dh_auto_clean: make -j10 clean returned exit code 2

Basically, I wanted something exactly like checkinstall, just without a crippling bug that prevents it from actually working. What I am getting is the broken checkinstall, and three alternative methods, all of which will require me to invest my entire week on troubleshooting (I've already spent several days). Is there a way to fix checkinstall, or to have a 2-3 command solution to get from my "make" solution to a .deb solution?

Normally I use cpack to make my deb packages, but since this source uses autoconf, I am a bit stuck with how to proceed.

1 Answer 1

3

Turns out that checkinstall was actually working. The problem was the project that I was trying to install. checkinstall (like dh_make) sets DESTDIR=some/temp/location during the make install step.

This project uses qmake, and the Makefile generated by qmake does not understand the DESTDIR directive. Instead INSTALL_ROOT was required.

I ended up using dh_make and hard-coded override_dh_auto_install to set INSTALL_ROOT manually instead of DESTDIR.

The dh_make command generates rules files needed to configure, build, install, and package the project.

After running dh_make, edit the newly generated debian/rules file to look like this:

#!/usr/bin/make -f
%:
    dh $@  --with autotools-dev --parallel
override_dh_auto_configure:
    ./configure --prefix=/opt/sim-qt --opensource --confirm-license --skip=qtcharts --skip=qtvirtualkeyboard --skip=qtdatavis3d --skip=qtwebengine --silent --nomake=examples --nomake=tests QMAKE_ARGS+=INSTALL_ROOL=/opt/sim-qt QMAKE_ARGS+=DESTDIR=

override_dh_auto_install:
    dh_auto_install -Smakefile -- INSTALL_ROOT=$(CURDIR)/debian/sim-qt/

Then configure, build and package with one command:

fakeroot dpkg-buildpackage -nc -j10 -us -uc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .