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