You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.4 KiB

  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:=6
  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 chpasswd chfn chsh expiry faillog gpasswd \
  23. groupadd groupdel groupmems groupmod groups \
  24. lastlog login newgrp nologin passwd su \
  25. useradd userdel usermod vipw
  26. CONFIGURE_ARGS += \
  27. --without-audit \
  28. --without-libpam \
  29. --without-selinux \
  30. --without-acl \
  31. --without-attr \
  32. --without-tcb \
  33. --without-nscd \
  34. --disable-subordinate-ids \
  35. define Package/shadow/Default
  36. SECTION:=utils
  37. CATEGORY:=Utilities
  38. TITLE:=The PLD Linux shadow utilities
  39. URL:=http://pkg-shadow.alioth.debian.org/
  40. endef
  41. define Package/shadow
  42. $(call Package/shadow/Default)
  43. TITLE+= (all)
  44. DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
  45. HIDDEN:=1
  46. endef
  47. define Package/shadow/description
  48. Full versions of standard shadow utilities. Normally, you would not
  49. use this package, since the functionality in BusyBox is more than
  50. sufficient and much smaller.
  51. endef
  52. define Package/shadow/install
  53. true
  54. endef
  55. define Package/shadow-utils
  56. $(call Package/shadow/Default)
  57. endef
  58. define Package/shadow-utils/config
  59. menu "Select shadow utilities"
  60. depends on PACKAGE_shadow-utils
  61. config shadow-all
  62. bool "Include all PLD shadow utilities"
  63. select PACKAGE_shadow
  64. default y
  65. comment "Utilities"
  66. $(foreach u,$(SHADOW_APPLETS), \
  67. config PACKAGE_shadow-$(u)
  68. prompt "Full PLD version of $(u) utility"
  69. )
  70. endmenu
  71. endef
  72. Package/shadow-utils/description = $(Package/shadow/description)
  73. define Package/shadow-common
  74. $(call Package/shadow/Default)
  75. TITLE:=Shared definitions for the PLD Linux shadow utilities
  76. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
  77. HIDDEN:=1
  78. endef
  79. define GenPlugin
  80. define Package/shadow-$(1)
  81. $(call Package/shadow/Default)
  82. TITLE:=Utility $(1) from the PLD Linux shadow utilities
  83. DEPENDS:=+shadow-common
  84. HIDDEN:=1
  85. endef
  86. define Package/shadow-$(1)/description
  87. Full version of standard $(1) utility. Normally, you would not use this
  88. package, since the functionality in BusyBox is more than sufficient.
  89. endef
  90. endef
  91. $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
  92. define Package/shadow-common/conffiles
  93. /etc/login.defs
  94. endef
  95. define Package/shadow-common/install
  96. $(INSTALL_DIR) $(1)/etc
  97. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
  98. endef
  99. define Package/shadow-utils/install
  100. true
  101. endef
  102. define BuildPlugin
  103. define Package/shadow-$(1)/install
  104. [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
  105. $(INSTALL_DIR) $$(1)/usr/sbin; \
  106. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  107. } || { \
  108. $(INSTALL_DIR) $$(1)/usr/bin; \
  109. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
  110. }
  111. endef
  112. $$(eval $$(call BuildPackage,shadow-$(1)))
  113. endef
  114. $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
  115. $(eval $(call BuildPackage,shadow-utils))
  116. $(eval $(call BuildPackage,shadow-common))
  117. $(eval $(call BuildPackage,shadow))