1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
define CONFIGURE_ARGS
--with-all-insults
--with-pam --with-pam-login
--with-fqdn
--with-logging=syslog
--with-logfac=authpriv
--with-devel
--with-env-editor
--with-editor=/usr/bin/editor
--with-timeout=15
--with-password-timeout=0
--with-passprompt="[sudo] password for %p: "
--with-tty-tickets
--without-lecture
--disable-root-mailer
--with-sendmail=/usr/sbin/sendmail
--with-rundir=/run/sudo
--with-sssd --with-sssd-lib=/usr/lib/$(DEB_HOST_MULTIARCH)
--enable-zlib=system
--enable-admin-flag
endef
ifeq ($(DEB_HOST_ARCH_OS),linux)
CONFIGURE_ARGS += --with-apparmor --with-selinux --with-linux-audit --enable-tmpfiles.d=/usr/lib/tmpfiles.d
endif
# Consistently use /bin/mv to ensure reproducible builds regardless of
# building on a usrmerge or non-usrmerge system.
CONFIGURE_ARGS += MVPROG=/bin/mv
deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd)
%:
dh $@
override_dh_auto_configure-arch:
dh_auto_configure --builddirectory build-simple -- $(strip $(CONFIGURE_ARGS)) \
--with-exampledir=/usr/share/doc/sudo/examples
override_dh_autoreconf-indep:
override_dh_auto_configure-indep:
override_dh_auto_clean-arch override_dh_auto_build-arch:
$(patsubst override_dh_auto_%-arch,dh_auto_%, $@) --builddirectory build-simple
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_auto_test --builddirectory build-simple
endif
override_dh_auto_install-arch:
dh_auto_install --builddirectory build-simple --destdir debian/sudo -- INSTALL_OWNER=
rm -f debian/sudo*/etc/sudoers \
debian/sudo*/usr/share/doc/sudo*/LICENSE.md \
rm -rf debian/sudo*/run
find debian/sudo*/ -type f -name '*.la' | xargs rm -f
for pkg in sudo; do \
mv debian/$$pkg/etc/sudoers.dist \
debian/$$pkg/usr/share/doc/$$pkg/examples/sudoers.dist; \
mkdir -p debian/$$pkg$(deb_systemdsystemunitdir)/; \
ln -s /dev/null debian/$$pkg$(deb_systemdsystemunitdir)/sudo.service; \
done
execute_after_dh_fixperms:
# fix executable libraries
chmod 0644 debian/sudo*/usr/libexec/sudo/*.so || true
override_dh_fixperms:
dh_fixperms --exclude=usr/bin/sudo
override_dh_installchangelogs:
dh_installchangelogs --exclude=HISTORY
|