sudo.mk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ################################################################################
  2. #
  3. # sudo
  4. #
  5. ################################################################################
  6. SUDO_VERSION_MAJOR = 1.9.15
  7. SUDO_VERSION_MINOR = p5
  8. SUDO_VERSION = $(SUDO_VERSION_MAJOR)$(SUDO_VERSION_MINOR)
  9. SUDO_SITE = https://www.sudo.ws/sudo/dist
  10. SUDO_LICENSE = ISC, BSD-3-Clause
  11. SUDO_LICENSE_FILES = LICENSE.md
  12. SUDO_CPE_ID_VERSION = $(SUDO_VERSION_MAJOR)
  13. SUDO_CPE_ID_UPDATE = $(SUDO_VERSION_MINOR)
  14. SUDO_SELINUX_MODULES = sudo
  15. # This is to avoid sudo's make install from chown()ing files which fails
  16. SUDO_INSTALL_TARGET_OPTS = INSTALL_OWNER="" DESTDIR="$(TARGET_DIR)" install
  17. SUDO_CONF_OPTS = \
  18. --with-tzdir=$(if $(BR2_PACKAGE_TZDATA),/usr/share/zoneinfo,no) \
  19. --enable-tmpfiles.d=$(if $(BR2_PACKAGE_SYSTEMD),/usr/lib/tmpfiles.d,no) \
  20. --without-lecture \
  21. --without-sendmail \
  22. --without-umask \
  23. --with-logging=syslog \
  24. --without-interfaces \
  25. --with-env-editor
  26. ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
  27. define SUDO_INSTALL_PAM_CONF
  28. $(INSTALL) -D -m 0644 package/sudo/sudo.pam $(TARGET_DIR)/etc/pam.d/sudo
  29. endef
  30. SUDO_DEPENDENCIES += linux-pam
  31. SUDO_CONF_OPTS += --with-pam
  32. SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_INSTALL_PAM_CONF
  33. else
  34. SUDO_CONF_OPTS += --without-pam
  35. endif
  36. ifeq ($(BR2_PACKAGE_ZLIB),y)
  37. SUDO_CONF_OPTS += --enable-zlib
  38. SUDO_DEPENDENCIES += zlib
  39. else
  40. SUDO_CONF_OPTS += --disable-zlib
  41. endif
  42. ifeq ($(BR2_PACKAGE_OPENLDAP),y)
  43. SUDO_DEPENDENCIES += openldap
  44. SUDO_CONF_OPTS += --with-ldap
  45. else
  46. SUDO_CONF_OPTS += --without-ldap
  47. endif
  48. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  49. SUDO_DEPENDENCIES += host-pkgconf openssl
  50. SUDO_CONF_OPTS += --enable-openssl
  51. else
  52. SUDO_CONF_OPTS += --disable-openssl
  53. endif
  54. define SUDO_PERMISSIONS
  55. /usr/bin/sudo f 4755 0 0 - - - - -
  56. endef
  57. define SUDO_REMOVE_DIST_EXAMPLES
  58. $(RM) $(TARGET_DIR)/etc/sudoers.dist
  59. rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/etc/sudoers.d
  60. endef
  61. SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_REMOVE_DIST_EXAMPLES
  62. define SUDO_USERS
  63. - - sudo -1 - - - -
  64. endef
  65. define SUDO_ENABLE_SUDO_GROUP_RULE
  66. $(SED) '/^# \%sudo\tALL=(ALL:ALL) ALL/s/^# //' $(TARGET_DIR)/etc/sudoers
  67. endef
  68. SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_ENABLE_SUDO_GROUP_RULE
  69. $(eval $(autotools-package))