Name sudo
Description Provide limited super user privileges to specific users
Version 1.9.15p5-3ubuntu5.24.04.1
Package Base
Homepage https://www.sudo.ws/
Maintainers ['Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>']
Contributors ['Bastian Blank <waldi@debian.org>', 'Hanno Wagner <wagner@debian.org>', 'Hilko Bengen <bengen@debian.org>', 'Marc Haber <mh+debian-packages@zugschlus.de>']
Distro-repo https://git.launchpad.net/ubuntu/+source/sudo/tree/?h=ubuntu/noble
Sources ['https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/../?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/Whitelist-DPKG_COLORS-environment-variable.diff?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/disable_offensive_insult.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/paths-in-samples.diff?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/series?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/spanish?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/patches/sudo-ldap-docs?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/sudo/plain/debian/watch?h=ubuntu/noble']
Dependencies ['libapparmor1', 'libaudit1', 'libc6', 'libpam-modules', 'libpam0g', 'libselinux1', 'libssl3t64', 'zlib1g']
Optional-Dependencies []
Build-Dependencies ['debhelper-compat', 'dh-sequence-installnss', 'libpam0g-dev', 'libldap2-dev', 'libsasl2-dev', 'libapparmor-dev', 'libselinux1-dev [linux-any]', 'autoconf', 'bison', 'flex', 'libaudit-dev [linux-any]', 'zlib1g-dev', 'po-debconf', 'pkgconf', 'systemd-dev']
Provides []
Builddate
Architecture amd64
Distro-Version noble
Licenses []
Hash 3e384a472c7a4855b518051610760b42c7a2bae48483a189438f9fffff6952f2
#!/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
# the following line can go away after the bookworm release
# iff no backports to bullseye and/or buster are planned.
# See #1025683 for a comprehension question. If this is cleared,
# the export can be commented out (but stay around as reminder for backports)
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
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:
	dh_auto_configure --builddirectory build-simple -- $(strip $(CONFIGURE_ARGS)) \
		--with-exampledir=/usr/share/doc/sudo/examples
	dh_auto_configure --builddirectory build-ldap   -- $(strip $(CONFIGURE_ARGS)) \
		--with-exampledir=/usr/share/doc/sudo-ldap/examples \
		--docdir=/usr/share/doc/sudo-ldap \
		--with-ldap --with-ldap-conf-file=/etc/sudo-ldap.conf

override_dh_auto_clean override_dh_auto_build:
	$(patsubst override_%,%,$@) --builddirectory build-simple
	$(patsubst override_%,%,$@) --builddirectory build-ldap

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test --builddirectory build-simple
	dh_auto_test --builddirectory build-ldap
endif

override_dh_auto_install:
	dh_auto_install --builddirectory build-simple --destdir debian/sudo -- INSTALL_OWNER=
	dh_auto_install --builddirectory build-ldap --destdir debian/sudo-ldap -- 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 sudo-ldap; 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

override_dh_fixperms:
	dh_fixperms --exclude=usr/bin/sudo

override_dh_installchangelogs:
	dh_installchangelogs --exclude=HISTORY