4

I am attempting to build a deb from an existing autotools based library. I am following the tutorial here. When I do a spkg-buildpackage -us -uc the command fails with an error stating that files are missing. I am at a loss, because the original make file is DESTDIR aware and if I do a cd to the DESTDIR and do an ls with the expression that it claims is failing the files I expect are there.

DESTDIR is /home/me/mypackage-0.2/debian/mypackage and the missing filespec is usr/lib/x86_64-linux-gnu/gstreamer-1.0/lib*. Note that this is a gstreamer plugin which is why the patch is a bit odd.

mypackage.install

usr/lib/x86_64-linux-gnu/gstreamer-1.0/lib*

I'm aware that I need to come back and get this to get this to work for other architectures, but for now we only care about 64bit.

rules

#!/usr/bin/make -f
# -*- makefile -*-

export DH_VERBOSE=1

%:
        dh $@  --with autotools-dev

output

dpkg-buildpackage: source package myproject
dpkg-buildpackage: source version 0.2-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by me <me@gmail.com>
 dpkg-source --before-build myproject-0.2
dpkg-buildpackage: host architecture amd64
 fakeroot debian/rules clean
dh clean  --with autotools-dev
   dh_testdir
   dh_auto_clean
    make -j1 distclean
make[1]: Entering directory `/home/me/client/debs/myproject-0.2'
Making distclean in src
make[2]: Entering directory `/home/me/client/debs/myproject-0.2/src'
rm -rf .libs _libs
test -z "libgstclient.la" || rm -f libgstclient.la
rm -f ./so_locations
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2/src'
make[2]: Entering directory `/home/me/client/debs/myproject-0.2'
rm -rf .libs _libs
rm -f *.lo
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f config.h stamp-h1
rm -f libtool config.lt
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -f cscope.out cscope.in.out cscope.po.out cscope.files
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -f Makefile
make[1]: Leaving directory `/home/me/client/debs/myproject-0.2'
   dh_autotools-dev_restoreconfig
    for c_g in `find . -type f -name config.guess` ; do if test -e "$c_g.dh-orig" ; then mv -f "$c_g.dh-orig" "$c_g" ; fi ; done
    for c_s in `find . -type f -name config.sub`   ; do if test -e "$c_s.dh-orig" ; then mv -f "$c_s.dh-orig" "$c_s" ; fi ; done
    find . -type f \( -name config.guess.dh-orig -o -name config.sub.dh-orig \) -delete
   dh_clean
    rm -f debian/myproject.substvars
    rm -f debian/myproject.*.debhelper
    rm -rf debian/myproject/
    rm -f debian/*.debhelper.log
    rm -f debian/files
    find .  \( \( -type f -a \
            \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
             -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
             -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
             -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
            \) -exec rm -f {} + \) -o \
            \( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \)
    rm -f *-stamp
 dpkg-source -b myproject-0.2
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building myproject using existing ./myproject_0.2.orig.tar.xz
dpkg-source: warning: ignoring deletion of directory autom4te.cache
dpkg-source: warning: ignoring deletion of file autom4te.cache/traces.1
dpkg-source: warning: ignoring deletion of file autom4te.cache/output.1
dpkg-source: warning: ignoring deletion of file autom4te.cache/traces.0
dpkg-source: warning: ignoring deletion of file autom4te.cache/requests
dpkg-source: warning: ignoring deletion of file autom4te.cache/output.0
dpkg-source: info: building myproject in myproject_0.2-1.debian.tar.gz
dpkg-source: info: building myproject in myproject_0.2-1.dsc
 debian/rules build
dh build  --with autotools-dev
   dh_testdir
   dh_autotools-dev_updateconfig
    for c_g in `find -type f -name config.guess` ; do if ! test -e "$c_g.dh-orig" ; then mv -f "$c_g" "$c_g.dh-orig" ; cp -f /usr/share/misc/config.guess "$c_g" ; fi ; done
    for c_s in `find -type f -name config.sub`   ; do if ! test -e "$c_s.dh-orig" ; then mv -f "$c_s" "$c_s.dh-orig" ; cp -f /usr/share/misc/config.sub   "$c_s" ; fi ; done
   dh_auto_configure
    ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking
checking for a BSD-compatible install... /usr/bin/install -c
 *** sniping configure output for brevity ***
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
   dh_auto_build
    make -j1
make[1]: Entering directory `/home/me/client/debs/myproject-0.2'
make  all-recursive
make[2]: Entering directory `/home/me/client/debs/myproject-0.2'
Making all in src
make[3]: Entering directory `/home/me/client/debs/myproject-0.2/src'
/bin/bash ../libtool  --tag=CXX --tag=disable-static  --mode=compile g++ -DHAVE_CONFIG_H -I. -I..   -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -Wall -std=c++11 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c -o libgstclient_la-client.lo `test -f 'client.cpp' || echo './'`client.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -std=c++11 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c client.cpp  -fPIC -DPIC -o .libs/libgstclient_la-client.o
/bin/bash ../libtool  --tag=CC --tag=disable-static  --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -Wall -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -c -o libgstclient_la-gstclient.lo `test -f 'gstclient.c' || echo './'`gstclient.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -c gstclient.c  -fPIC -DPIC -o .libs/libgstclient_la-gstclient.o
/bin/bash ../libtool  --tag=CXX --tag=disable-static  --mode=compile g++ -DHAVE_CONFIG_H -I. -I..   -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -Wall -std=c++11 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c -o libgstclient_la-Protocol2Muxer.lo `test -f 'Protocol2Muxer.cpp' || echo './'`Protocol2Muxer.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wall -std=c++11 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c Protocol2Muxer.cpp  -fPIC -DPIC -o .libs/libgstclient_la-Protocol2Muxer.o
/bin/bash ../libtool  --tag=CXX --tag=disable-static  --mode=link g++ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -Wall -std=c++11 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -module -avoid-version -export-symbols-regex _*\(gst_\|Gst\|GST_\).* -Wl,-Bsymbolic-functions -Wl,-z,relro -o libgstclient.la -rpath /usr/lib/x86_64-linux-gnu/gstreamer-1.0 libgstclient_la-client.lo libgstclient_la-gstclient.lo libgstclient_la-Protocol2Muxer.lo -lgstbase-1.0 -lgstcontroller-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0    -lprotocol2-session -lprotocol2 -lclientnet -lclient -lssl -lpthread -lstdc++ -levent
libtool: link: /usr/bin/nm -B  .libs/libgstclient_la-client.o .libs/libgstclient_la-gstclient.o .libs/libgstclient_la-Protocol2Muxer.o   | sed -n -e 's/^.*[         ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /bin/sed 's/.* //' | sort | uniq > .libs/libgstclient.exp
libtool: link: /bin/grep -E -e "_*(gst_|Gst|GST_).*" ".libs/libgstclient.exp" > ".libs/libgstclient.expT"
libtool: link: mv -f ".libs/libgstclient.expT" ".libs/libgstclient.exp"
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o  .libs/libgstclient_la-client.o .libs/libgstclient_la-gstclient.o .libs/libgstclient_la-Protocol2Muxer.o   -lgstbase-1.0 -lgstcontroller-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 /usr/local/lib/libprotocol2-session.so /usr/local/lib/libprotocol2.so /usr/local/lib/libclientnet.so /usr/local/lib/libclient.so -lssl -lpthread /usr/local/lib/libevent.so -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o  -pthread -O2 -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro   -pthread -Wl,-soname -Wl,libgstclient.so -Wl,-retain-symbols-file -Wl,.libs/libgstclient.exp -o .libs/libgstclient.so
libtool: link: ( cd ".libs" && rm -f "libgstclient.la" && ln -s "../libgstclient.la" "libgstclient.la" )
make[3]: Leaving directory `/home/me/client/debs/myproject-0.2/src'
make[3]: Entering directory `/home/me/client/debs/myproject-0.2'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/me/client/debs/myproject-0.2'
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2'
make[1]: Leaving directory `/home/me/client/debs/myproject-0.2'
   dh_auto_test
    make -j1 check
make[1]: Entering directory `/home/me/client/debs/myproject-0.2'
Making check in src
make[2]: Entering directory `/home/me/client/debs/myproject-0.2/src'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2/src'
make[2]: Entering directory `/home/me/client/debs/myproject-0.2'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2'
make[1]: Leaving directory `/home/me/client/debs/myproject-0.2'
 fakeroot debian/rules binary
dh binary  --with autotools-dev
   dh_testroot
   dh_prep
    rm -f debian/myproject.substvars
    rm -f debian/myproject.*.debhelper
    rm -rf debian/myproject/
   dh_installdirs
    install -d debian/myproject
    install -d debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0
   dh_auto_install
    make -j1 install DESTDIR=/home/me/client/debs/myproject-0.2/debian/myproject AM_UPDATE_INFO_DIR=no
make[1]: Entering directory `/home/me/client/debs/myproject-0.2'
Making install in src
make[2]: Entering directory `/home/me/client/debs/myproject-0.2/src'
make[3]: Entering directory `/home/me/client/debs/myproject-0.2/src'
make[3]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/home/me/client/debs/myproject-0.2/debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libgstclient.la '/home/me/client/debs/myproject-0.2/debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0'
libtool: install: /usr/bin/install -c .libs/libgstclient.so /home/me/client/debs/myproject-0.2/debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstclient.so
libtool: install: /usr/bin/install -c .libs/libgstclient.lai /home/me/client/debs/myproject-0.2/debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstclient.la
libtool: install: warning: remember to run `libtool --finish /usr/lib/x86_64-linux-gnu/gstreamer-1.0'
make[3]: Leaving directory `/home/me/client/debs/myproject-0.2/src'
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2/src'
make[2]: Entering directory `/home/me/client/debs/myproject-0.2'
make[3]: Entering directory `/home/me/client/debs/myproject-0.2'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/me/client/debs/myproject-0.2'
make[2]: Leaving directory `/home/me/client/debs/myproject-0.2'
make[1]: Leaving directory `/home/me/client/debs/myproject-0.2'
   dh_install
dh_install: myproject missing files (usr/lib/x86_64-linux-gnu/gstreamer-1.0/lib*), aborting
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

output of find . in the debian directory

./myproject.dirs
./myproject
./myproject/usr
./myproject/usr/lib
./myproject/usr/lib/x86_64-linux-gnu
./myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0
./myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstclient.so
./myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstclient.la
./myproject.install
./rules
./compat
./source
./source/format
./myproject.debhelper.log
./changelog
./copyright
./control
Yaur
  • 143

1 Answers1

5

Your install file paths should be relative to the package directory (which contains debian/), and not relative to debian/myproject unless you used the -B option. From man dh_install:

FILES
   debian/package.install
       List the files to install into each package and the directory they
       should be installed to. The format is a set of lines, where each
       line lists a file or files to install, and at the end of the line
       tells the directory it should be installed in. The name of the
       files (or directories) to install should be given relative to the
       current directory, while the installation directory is given
       relative to the package build directory. You may use wildcards in
       the names of the files to install (in v3 mode and above).

Instead, try:

debian/myproject/usr/lib/x86_64-linux-gnu/gstreamer-1.0/lib*
muru
  • 197,895
  • 55
  • 485
  • 740
  • the way dh_make is writing the original .install file seems odd (especially since it is also setting the DESTDIR var) but I understand what is going on well enough now to fix it in future packages. – Yaur Aug 14 '15 at 15:43
  • @Yaur dh_auto_install calls make and uses DESTDIR. dh_install copies manually. Neither should overwrite your install file. – muru Aug 14 '15 at 15:53
  • 2
    I just wanted to revisit this to say that the install file is used "To install files into your package that are not handled by the upstream build system" and that anything that is in debian/myproject is already handled by the upstream build system and as such doesn't need an entry in the install file at all. – Yaur Feb 09 '16 at 19:38