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.

149 lines
3.5 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.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/shadow-maint/shadow/releases/download/$(PKG_VERSION)
  13. PKG_HASH:=0998c8d84242a231ab0acb7f8613927ff5bcff095f8aa6b79478893a03f05583
  14. PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_CPE_ID:=cpe:/a:debian:shadow
  17. PKG_FIXUP:=autoreconf
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/nls.mk
  22. SHADOW_APPLETS := \
  23. chage chpasswd chfn chsh expiry faillog gpasswd \
  24. groupadd groupdel groupmems groupmod groups \
  25. lastlog login newgidmap newgrp newuidmap nologin \
  26. passwd su \
  27. useradd userdel usermod vipw
  28. CONFIGURE_ARGS += \
  29. --without-audit \
  30. --without-libpam \
  31. --without-selinux \
  32. --without-acl \
  33. --without-attr \
  34. --without-tcb \
  35. --without-nscd
  36. define Package/shadow/Default
  37. SECTION:=utils
  38. CATEGORY:=Utilities
  39. TITLE:=The PLD Linux shadow utilities
  40. URL:=https://github.com/shadow-maint/shadow
  41. endef
  42. define Package/shadow
  43. $(call Package/shadow/Default)
  44. TITLE+= (all)
  45. DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
  46. HIDDEN:=1
  47. endef
  48. define Package/shadow/description
  49. Full versions of standard shadow utilities. Normally, you would not
  50. use this package, since the functionality in BusyBox is more than
  51. sufficient and much smaller.
  52. endef
  53. define Package/shadow/install
  54. true
  55. endef
  56. define Package/shadow-utils
  57. $(call Package/shadow/Default)
  58. endef
  59. define Package/shadow-utils/config
  60. menu "Select shadow utilities"
  61. depends on PACKAGE_shadow-utils
  62. config shadow-all
  63. bool "Include all PLD shadow utilities"
  64. select PACKAGE_shadow
  65. default y
  66. comment "Utilities"
  67. $(foreach u,$(SHADOW_APPLETS), \
  68. config PACKAGE_shadow-$(u)
  69. prompt "Full PLD version of $(u) utility"
  70. )
  71. endmenu
  72. endef
  73. Package/shadow-utils/description = $(Package/shadow/description)
  74. define Package/shadow-common
  75. $(call Package/shadow/Default)
  76. TITLE:=Shared definitions for the PLD Linux shadow utilities
  77. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
  78. HIDDEN:=1
  79. endef
  80. define GenPlugin
  81. define Package/shadow-$(1)
  82. $(call Package/shadow/Default)
  83. TITLE:=Utility $(1) from the PLD Linux shadow utilities
  84. DEPENDS:=+shadow-common
  85. HIDDEN:=1
  86. endef
  87. define Package/shadow-$(1)/description
  88. Full version of standard $(1) utility. Normally, you would not use this
  89. package, since the functionality in BusyBox is more than sufficient.
  90. endef
  91. endef
  92. $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
  93. define Package/shadow-common/conffiles
  94. /etc/login.defs
  95. endef
  96. define Package/shadow-common/install
  97. $(INSTALL_DIR) $(1)/etc
  98. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
  99. endef
  100. define Package/shadow-utils/install
  101. true
  102. endef
  103. define BuildPlugin
  104. define Package/shadow-$(1)/install
  105. [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
  106. $(INSTALL_DIR) $$(1)/usr/sbin; \
  107. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  108. } || { \
  109. $(INSTALL_DIR) $$(1)/usr/bin; \
  110. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
  111. }
  112. endef
  113. $$(eval $$(call BuildPackage,shadow-$(1)))
  114. endef
  115. $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
  116. $(eval $(call BuildPackage,shadow-utils))
  117. $(eval $(call BuildPackage,shadow-common))
  118. $(eval $(call BuildPackage,shadow))