#!/usr/bin/make -f DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export DEB_BUILD_MAINT_OPTIONS = hardening=+all LIBDIR = usr/lib/$(DEB_HOST_MULTIARCH) LIBEXECDIR = $(LIBDIR)/schroot ifneq ($(DEB_HOST_ARCH_OS),linux) LVMSNAP_OPTIONS = -Dlvm-snapshot=OFF BTRFSSNAP_OPTIONS = -Dbtrfs-snapshot=OFF ZFSSNAP_OPTIONS = -Dzfs-snapshot=OFF else LVMSNAP_OPTIONS = -Dlvm-snapshot=ON BTRFSSNAP_OPTIONS = -Dbtrfs-snapshot=ON ZFSSNAP_OPTIONS = -Dzfs-snapshot=ON endif ifneq ($(DEB_HOST_ARCH_OS),kfreebsd) UUID_OPTIONS = -Duuid=ON else UUID_OPTIONS = -Duuid=OFF endif export DEB_CFLAGS_MAINT_APPEND := -Wall export DEB_CXXFLAGS_MAINT_APPEND := -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE export DEB_BUILD_MAINT_OPTIONS := hardening=+all reproducible=+fixfilepath DH_OPTIONS = --buildsystem=cmake --builddirectory=debian/build --with=bash-completion --without autoreconf # Use debhelper's dh %: dh $@ $(DH_OPTIONS) override_dh_auto_clean: dh_auto_clean rm -rf debian/build rm -rf debian/install override_dh_auto_configure: debian/build/CMakeCache.txt override_dh_auto_build: ifneq (,$(shell dh_listpackages -a 2>/dev/null)) dh_auto_build -a -- all endif ifneq (,$(shell dh_listpackages -i 2>/dev/null)) #dh_auto_build -i -- doc $(MAKE) -C debian/build update-gmo endif override_dh_auto_test: override_dh_auto_install: ifneq (,$(shell dh_listpackages -a 2>/dev/null)) $(MAKE) -C debian/build install DESTDIR=$(CURDIR)/debian/install PO4A= endif ifneq (,$(shell dh_listpackages -i 2>/dev/null)) $(MAKE) -C debian/build/po install DESTDIR=$(CURDIR)/debian/install PO4A= endif override_dh_installinit: dh_installinit --no-start override_dh_installsystemd: dh_installsystemd --no-start override_dh_fixperms: dh_fixperms --exclude=usr/bin/schroot debian/build/CMakeCache.txt: CMakeLists.txt GTEST_ROOT="$(CURDIR)/debian/build/gtest" \ CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)" \ dh_auto_configure --builddirectory=$(dir $@) -- \ -DCMAKE_INSTALL_LIBEXECDIR=lib \ -DSCHROOT_LIBEXEC_DIR=/$(LIBDIR)/schroot \ -Ddebug=OFF -Ddchroot=OFF -Ddchroot-dsa=OFF \ -Dbash_completion_dir=/usr/share/bash-completion/completions \ $(LVMSNAP_OPTIONS) $(BTRFSSNAP_OPTIONS) $(ZFSSNAP_OPTIONS) \ -DBTRFS_EXECUTABLE=/sbin/btrfs \ -DLVCREATE_EXECUTABLE=/sbin/lvcreate \ -DLVREMOVE_EXECUTABLE=/sbin/lvremove \ -DZFS_EXECUTABLE=/sbin/zfs \ $(CURDIR) dh_testdir install-arch: build-arch dh $@ $(DH_OPTIONS) # Setuid executables chmod 4755 $(CURDIR)/debian/schroot/usr/bin/schroot # Lintian overrides mkdir -p $(CURDIR)/debian/schroot/usr/share/lintian/overrides cp $(CURDIR)/debian/schroot.lintian-overrides $(CURDIR)/debian/schroot/usr/share/lintian/overrides/schroot ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # Requires fakeroot, so tests need running here. $(MAKE) -C debian/build test ARGS=-V endif install-indep: build-indep dh $@ $(DH_OPTIONS) install: build install-arch install-indep