@ -8,8 +8,28 @@
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
# The default gzip compressor has been changed in dpkg >= 1.17.0.
deb_default_compress = $(shell LANG=C dpkg-deb --version | head -n1 | \
sed -e "s|.*version ||" -e "s| .*||" | \
xargs -r dpkg --compare-versions 1.17.0 lt \
&& echo xz || echo gzip)
ifeq ($(deb_default_compress),gzip)
DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
&& echo xz || echo bzip2)
endif
ifneq "$(wildcard /usr/bin/ninja)" ""
MAKE = ninja -v
DEB_MAKE_ENVVARS += DESTDIR=$(DEB_DESTDIR)
DEB_MAKE_INSTALL_TARGET = install
DEB_CMAKE_NORMAL_ARGS += -GNinja
endif
ifdef DEB_HOST_MULTIARCH
CMAKE_INSTALL_LIBDIR = lib/$(DEB_HOST_MULTIARCH)
else
CMAKE_INSTALL_LIBDIR = lib
endif
# Build options
DEB_CMAKE_EXTRA_FLAGS := \
@ -17,11 +37,23 @@ DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_VERBOSE_MAKEFILE="ON" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSYSCONF_INSTALL_DIR="/etc" \
-DCMAKE_INSTALL_LIBDIR=$(CMAKE_INSTALL_LIBDIR) \
-DPCSCLITE_HP_DROPDIR="/usr/lib/pcsc/drivers" \
-DWITH_LIBHAL="OFF" \
-DWITH_LIBUSB="ON" \
-DWITH_SCF="OFF"
common-binary-arch::
# update multi-arch path in install files
ls -d debian/* | \
grep -E "(install|links)$$" | \
while read a; do \
[ -d $$a ] || [ -f $$a.arch ] || \
! grep -q "\$$(DEB_HOST_MULTIARCH)" $$a || \
sed -i.arch "s|\$$(DEB_HOST_MULTIARCH)|$(DEB_HOST_MULTIARCH)|g" $$a; \
done
binary-install/pcscd-nodbus::
dh_testdir
@ -35,13 +67,22 @@ binary-install/libpcsclite1-nodbus::
dh_testdir
# move runtime libraries to /lib
mv debian/libpcsclite1-nodbus/usr/lib/libpcsclite.so.1* \
debian/libpcsclite1-nodbus/lib/
rmdir -p --ignore-fail-on-non-empty debian/libpcsclite1-nodbus/usr/lib
mkdir -p debian/libpcsclite1-nodbus/$(CMAKE_INSTALL_LIBDIR)
mv debian/libpcsclite1-nodbus/usr/$(CMAKE_INSTALL_LIBDIR)/libpcsclite.so.1* \
debian/libpcsclite1-nodbus/$(CMAKE_INSTALL_LIBDIR)
rmdir -p --ignore-fail-on-non-empty debian/libpcsclite1-nodbus/usr/$(CMAKE_INSTALL_LIBDIR)
binary-install/libpcsclite-nodbus-dev::
dh_testdir
ln -sf /lib/$$(readlink debian/libpcsclite-nodbus-dev/usr/lib /libpcsclite.so) \
debian/libpcsclite-nodbus-dev/usr/lib /libpcsclite.so
ln -sf /$(CMAKE_INSTALL_LIBDIR)/$$(readlink debian/libpcsclite-nodbus-dev/usr/$(CMAKE_INSTALL_LIBDIR) /libpcsclite.so) \
debian/libpcsclite-nodbus-dev/usr/$(CMAKE_INSTALL_LIBDIR) /libpcsclite.so
clean::
# revert multi-arch path in install files
ls -d debian/* | \
grep -E "(install|links)$$" | \
while read a; do \
[ ! -f $$a.arch ] || \
mv $$a.arch $$a; \
done