0

I am using launchpad librarian to build packages from my source package.

The source package, I have uploaded via dput to my PPA.

Launchpad then proceeds to build (which is accomplished) and to install (which fails.)

When I have a Makefile with this install target:

install:
        cp imcat /usr/bin/

It fails with Permission denied so I tried this:

install:
        sudo cp imcat /usr/bin/

Which still fails because sudo is not found. This is the build log:

dh binary
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_configure
    install -d /<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home
   dh_auto_build
    make -j4 "INSTALL=install --strip-program=true"
make[1]: Entering directory '/<<PKGBUILDDIR>>'
cc -D_POSIX_C_SOURCE=2 -std=c99 -Wall -g -o imcat imcat.c -lm
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_auto_test
    rm -fr -- /tmp/dh-xdg-rundir-U4Jl8XPG
   create-stamp debian/debhelper-build-stamp
   dh_prep
    rm -f -- debian/imcat.substvars
    rm -fr -- debian/.debhelper/generated/imcat/ debian/imcat/ debian/tmp/
   dh_auto_install --destdir=debian/imcat/
    install -d /<<PKGBUILDDIR>>/debian/imcat
    make -j4 install DESTDIR=/<<PKGBUILDDIR>>/debian/imcat AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true"
make[1]: Entering directory '/<<PKGBUILDDIR>>'
sudo cp imcat /usr/bin/
make[1]: sudo: No such file or directory
make[1]: *** [Makefile:11: install] Error 127
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
dh_auto_install: error: make -j4 install DESTDIR=/<<PKGBUILDDIR>>/debian/imcat AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true" returned exit code 2
make: *** [debian/rules:18: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

What are the correct install targets so that dh can install the binary?

These are my debian/rules

#!/usr/bin/make -f

# Output every command that modifies files on the build system.
export DH_VERBOSE = 1


# See FEATURE AREAS in dpkg-buildflags(1).
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
    dh $@

1 Answer 1

0

The solution is to use the DESTDIR environment variable, alongside the install utility, like so:

install: imcat
    install -d ${DESTDIR}/usr/bin
    install -m 755 imcat ${DESTDIR}/usr/bin/

uninstall:
    sudo rm -f ${DESTDIR}/usr/bin/imcat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.