sudo.mk 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #############################################################
  2. #
  3. # sudo
  4. #
  5. #############################################################
  6. SUDO_VERSION:=1.6.8p12
  7. SUDO_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/s/sudo
  8. SUDO_SOURCE:=sudo_$(SUDO_VERSION).orig.tar.gz
  9. #SUDO_VERSION:=1.7.0
  10. #SUDO_SITE:=http://www.courtesan.com/sudo/dist
  11. # 1.7.0 Needs update Cross-Compiler patches
  12. # SUDO_SOURCE:=sudo-$(SUDO_VERSION).tar.gz
  13. SUDO_DIR:=$(BUILD_DIR)/sudo-$(SUDO_VERSION)
  14. SUDO_UNZIP:=$(ZCAT)
  15. $(DL_DIR)/$(SUDO_SOURCE):
  16. $(call DOWNLOAD,$(SUDO_SITE),$(SUDO_SOURCE))
  17. sudo-source: $(DL_DIR)/$(SUDO_SOURCE) $(SUDO_CONFIG_FILE)
  18. $(SUDO_DIR)/.unpacked: $(DL_DIR)/$(SUDO_SOURCE)
  19. $(SUDO_UNZIP) $(DL_DIR)/$(SUDO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  20. toolchain/patch-kernel.sh $(SUDO_DIR) package/sudo sudo-$(SUDO_VERSION)\*.patch
  21. $(CONFIG_UPDATE) $(SUDO_DIR)
  22. touch $@
  23. $(SUDO_DIR)/.configured: $(SUDO_DIR)/.unpacked $(SUDO_CONFIG_FILE)
  24. (cd $(SUDO_DIR); rm -rf config.cache; \
  25. $(TARGET_CONFIGURE_OPTS) \
  26. $(TARGET_CONFIGURE_ARGS) \
  27. ./configure $(QUIET) \
  28. --target=$(GNU_TARGET_NAME) \
  29. --host=$(GNU_TARGET_NAME) \
  30. --build=$(GNU_HOST_NAME) \
  31. --prefix=/usr \
  32. --exec-prefix=/usr \
  33. --bindir=/usr/bin \
  34. --sbindir=/usr/sbin \
  35. --libdir=/lib \
  36. --libexecdir=/usr/lib \
  37. --sysconfdir=/etc \
  38. --datadir=/usr/share \
  39. --localstatedir=/var \
  40. --mandir=/usr/man \
  41. --infodir=/usr/info \
  42. $(DISABLE_LARGEFILE) \
  43. --without-lecture \
  44. --without-sendmail \
  45. --without-umask \
  46. --with-logging=syslog \
  47. --without-interfaces \
  48. --disable-authentication \
  49. $(SUDO_EXTRA_CONFIG) \
  50. )
  51. touch $@
  52. $(SUDO_DIR)/sudo: $(SUDO_DIR)/.configured
  53. $(MAKE) -C $(SUDO_DIR)
  54. touch -c $@
  55. $(TARGET_DIR)/usr/bin/sudo: $(SUDO_DIR)/sudo
  56. rm -f $(TARGET_DIR)/usr/bin/sudo
  57. rm -f $(TARGET_DIR)/usr/sbin/visudo
  58. rm -f $(TARGET_DIR)/etc/sudoers
  59. $(INSTALL) -m 0777 -D $(SUDO_DIR)/sudo $(TARGET_DIR)/usr/bin/sudo
  60. $(INSTALL) -m 0777 -D $(SUDO_DIR)/visudo $(TARGET_DIR)/usr/sbin/visudo
  61. $(STRIPCMD) $(TARGET_DIR)/usr/bin/sudo $(TARGET_DIR)/usr/sbin/visudo
  62. chmod 4555 $(TARGET_DIR)/usr/bin/sudo
  63. chmod 0555 $(TARGET_DIR)/usr/sbin/visudo
  64. $(INSTALL) -m 0440 -D $(SUDO_DIR)/sudoers $(TARGET_DIR)/etc/sudoers
  65. touch -c $(TARGET_DIR)/usr/bin/sudo
  66. sudo: $(TARGET_DIR)/usr/bin/sudo
  67. sudo-unpacked: $(SUDO_DIR)/.unpacked
  68. sudo-clean:
  69. rm -f $(TARGET_DIR)/usr/bin/sudo $(TARGET_DIR)/etc/sudoers \
  70. $(TARGET_DIR)/usr/sbin/visudo
  71. -$(MAKE) -C $(SUDO_DIR) clean
  72. sudo-dirclean:
  73. rm -rf $(SUDO_DIR)
  74. #############################################################
  75. #
  76. # Toplevel Makefile options
  77. #
  78. #############################################################
  79. ifeq ($(BR2_PACKAGE_SUDO),y)
  80. TARGETS+=sudo
  81. endif
  82. ifeq ($(BR2_PACKAGE_LIBPAM),y)
  83. SUDO_EXTRA_CONFIG=--enable-pam
  84. sudo: libpam
  85. endif