Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #
  2. # Copyright (C) 2008-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=shadow
  9. PKG_VERSION:=4.2.1
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
  13. PKG_MD5SUM:=2bfafe7d4962682d31b5eba65dba4fc8
  14. PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_FIXUP:=autoreconf
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/nls.mk
  21. SHADOW_APPLETS := \
  22. chage groupadd groupdel groupmod groups passwd su \
  23. useradd userdel usermod
  24. CONFIGURE_ARGS += \
  25. --without-audit \
  26. --without-libpam \
  27. --without-selinux \
  28. --without-acl \
  29. --without-attr \
  30. --without-tcb \
  31. --without-nscd \
  32. --disable-subordinate-ids \
  33. define Package/shadow/Default
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. TITLE:=The PLD Linux shadow utilities
  37. URL:=http://pkg-shadow.alioth.debian.org/
  38. endef
  39. define Package/shadow
  40. $(call Package/shadow/Default)
  41. TITLE+= (all)
  42. DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
  43. HIDDEN:=1
  44. endef
  45. define Package/shadow/description
  46. Full versions of standard shadow utilities. Normally, you would not
  47. use this package, since the functionality in BusyBox is more than
  48. sufficient and much smaller.
  49. endef
  50. define Package/shadow/install
  51. true
  52. endef
  53. define Package/shadow-utils
  54. $(call Package/shadow/Default)
  55. endef
  56. define Package/shadow-utils/config
  57. menu "Select shadow utilities"
  58. depends on PACKAGE_shadow-utils
  59. config shadow-all
  60. bool "Include all PLD shadow utilities"
  61. select PACKAGE_shadow
  62. default y
  63. comment "Utilities"
  64. $(foreach u,$(SHADOW_APPLETS), \
  65. config PACKAGE_shadow-$(u)
  66. prompt "Full PLD version of $(u) utility"
  67. )
  68. endmenu
  69. endef
  70. Package/shadow-utils/description = $(Package/shadow/description)
  71. define Package/shadow-common
  72. $(call Package/shadow/Default)
  73. TITLE:=Shared definitions for the PLD Linux shadow utilities
  74. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
  75. HIDDEN:=1
  76. endef
  77. define GenPlugin
  78. define Package/shadow-$(1)
  79. $(call Package/shadow/Default)
  80. TITLE:=Utility $(1) from the PLD Linux shadow utilities
  81. DEPENDS:=+shadow-common
  82. HIDDEN:=1
  83. endef
  84. define Package/shadow-$(1)/description
  85. Full version of standard $(1) utility. Normally, you would not use this
  86. package, since the functionality in BusyBox is more than sufficient.
  87. endef
  88. endef
  89. $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
  90. define Package/shadow-common/conffiles
  91. /etc/login.defs
  92. endef
  93. define Package/shadow-common/install
  94. $(INSTALL_DIR) $(1)/etc
  95. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
  96. endef
  97. define Package/shadow-utils/install
  98. true
  99. endef
  100. define BuildPlugin
  101. define Package/shadow-$(1)/install
  102. [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
  103. $(INSTALL_DIR) $$(1)/usr/sbin; \
  104. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  105. } || { \
  106. $(INSTALL_DIR) $$(1)/usr/bin; \
  107. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
  108. }
  109. endef
  110. $$(eval $$(call BuildPackage,shadow-$(1)))
  111. endef
  112. $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
  113. $(eval $(call BuildPackage,shadow-utils))
  114. $(eval $(call BuildPackage,shadow-common))
  115. $(eval $(call BuildPackage,shadow))