]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/sudo/sudo.mk
sudo: bump to version 1.8.23
[coffee/buildroot.git] / package / sudo / sudo.mk
1 ################################################################################
2 #
3 # sudo
4 #
5 ################################################################################
6
7 SUDO_VERSION = 1.8.23
8 SUDO_SITE = https://www.sudo.ws/sudo/dist
9 SUDO_LICENSE = ISC, BSD-3-Clause
10 SUDO_LICENSE_FILES = doc/LICENSE
11 # This is to avoid sudo's make install from chown()ing files which fails
12 SUDO_INSTALL_TARGET_OPTS = INSTALL_OWNER="" DESTDIR="$(TARGET_DIR)" install
13 SUDO_CONF_OPTS = \
14         --without-lecture \
15         --without-sendmail \
16         --without-umask \
17         --with-logging=syslog \
18         --without-interfaces \
19         --with-env-editor
20
21 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
22 define SUDO_INSTALL_PAM_CONF
23         $(INSTALL) -D -m 0644 package/sudo/sudo.pam $(TARGET_DIR)/etc/pam.d/sudo
24 endef
25
26 SUDO_DEPENDENCIES += linux-pam
27 SUDO_CONF_OPTS += --with-pam
28 SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_INSTALL_PAM_CONF
29 else
30 SUDO_CONF_OPTS += --without-pam
31 endif
32
33 ifeq ($(BR2_PACKAGE_ZLIB),y)
34 SUDO_CONF_OPTS += --enable-zlib
35 SUDO_DEPENDENCIES += zlib
36 else
37 SUDO_CONF_OPTS += --disable-zlib
38 endif
39
40 ifeq ($(BR2_PACKAGE_OPENLDAP),y)
41 SUDO_DEPENDENCIES += openldap
42 SUDO_CONF_OPTS += --with-ldap
43 # If we are building sudo statically and openldap was linked with openssl, then
44 # when we link sudo with openldap we need to specify the openssl libs, otherwise
45 # it will fail with "undefined reference" errors.
46 ifeq ($(BR2_STATIC_LIBS)$(BR2_PACKAGE_OPENSSL),yy)
47 SUDO_DEPENDENCIES += host-pkgconf
48 SUDO_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`"
49 endif
50 else
51 SUDO_CONF_OPTS += --without-ldap
52 endif
53
54 # mksigname/mksiglist needs to run on build host to generate source files
55 define SUDO_BUILD_MKSIGNAME_MKSIGLIST_HOST
56         $(MAKE) $(HOST_CONFIGURE_OPTS) \
57                 CPPFLAGS="$(HOST_CPPFLAGS) -I../../include -I../.." \
58                 -C $(@D)/lib/util mksigname mksiglist
59 endef
60
61 SUDO_POST_CONFIGURE_HOOKS += SUDO_BUILD_MKSIGNAME_MKSIGLIST_HOST
62
63 define SUDO_PERMISSIONS
64         /usr/bin/sudo f 4755 0 0 - - - - -
65 endef
66
67 $(eval $(autotools-package))