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.

164 lines
4.1 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.8.1
  10. PKG_RELEASE:=2
  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:=a3ad4630bdc41372f02a647278a8c3514844295d36eefe68ece6c3a641c1ae62
  14. PKG_MAINTAINER:=
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:debian:shadow
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/nls.mk
  22. SHADOW_APPLETS := \
  23. chage chfn chgpasswd chpasswd chsh expiry faillog gpasswd \
  24. groupadd groupdel groupmems groupmod groups grpck grpconv grpunconv \
  25. lastlog login logoutd newgidmap newgrp newuidmap newusers nologin \
  26. passwd pwck pwconv pwunconv 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. --with$(if $(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),,out)-bcrypt
  37. CONFIGURE_VARS += \
  38. ac_cv_func_ruserok=no
  39. define Package/shadow/Default
  40. SECTION:=utils
  41. CATEGORY:=Utilities
  42. TITLE:=The PLD Linux shadow utilities
  43. URL:=https://github.com/shadow-maint/shadow
  44. endef
  45. define Package/shadow
  46. $(call Package/shadow/Default)
  47. TITLE+= (all)
  48. DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
  49. HIDDEN:=1
  50. endef
  51. define Package/shadow/description
  52. Full versions of standard shadow utilities. Normally, you would not
  53. use this package, since the functionality in BusyBox is more than
  54. sufficient and much smaller.
  55. endef
  56. define Package/shadow/install
  57. true
  58. endef
  59. define Package/shadow-utils
  60. $(call Package/shadow/Default)
  61. endef
  62. define Package/shadow-utils/config
  63. menu "Select shadow utilities"
  64. depends on PACKAGE_shadow-utils
  65. config shadow-all
  66. bool "Include all PLD shadow utilities"
  67. select PACKAGE_shadow
  68. default y
  69. comment "Utilities"
  70. $(foreach u,$(SHADOW_APPLETS), \
  71. config PACKAGE_shadow-$(u)
  72. prompt "Full PLD version of $(u) utility"
  73. )
  74. endmenu
  75. endef
  76. Package/shadow-utils/description = $(Package/shadow/description)
  77. define Package/shadow-common
  78. $(call Package/shadow/Default)
  79. TITLE:=Shared definitions for the PLD Linux shadow utilities
  80. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
  81. HIDDEN:=1
  82. endef
  83. define GenPlugin
  84. define Package/shadow-$(1)
  85. $(call Package/shadow/Default)
  86. TITLE:=Utility $(1) from the PLD Linux shadow utilities
  87. DEPENDS:=+shadow-common
  88. HIDDEN:=1
  89. endef
  90. define Package/shadow-$(1)/description
  91. Full version of standard $(1) utility. Normally, you would not use this
  92. package, since the functionality in BusyBox is more than sufficient.
  93. endef
  94. endef
  95. $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
  96. define Package/shadow-common/conffiles
  97. /etc/login.defs
  98. endef
  99. define Package/shadow-common/install
  100. $(INSTALL_DIR) $(1)/etc
  101. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
  102. $(SED) 's,SU_NAME,#SU_NAME,g' $(1)/etc/login.defs
  103. ifeq ($(CONFIG_USE_MUSL),y)
  104. ifeq ($(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),y)
  105. $(SED) 's,#ENCRYPT_METHOD DES,ENCRYPT_METHOD BCRYPT,g' $(1)/etc/login.defs
  106. else
  107. $(SED) 's,#ENCRYPT_METHOD DES,ENCRYPT_METHOD MD5,g' $(1)/etc/login.defs
  108. endif # CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK
  109. else
  110. $(SED) 's,#ENCRYPT_METHOD DES,ENCRYPT_METHOD SHA512,g' $(1)/etc/login.defs
  111. endif # CONFIG_USE_MUSL
  112. endef
  113. define Package/shadow-utils/install
  114. true
  115. endef
  116. define BuildPlugin
  117. define Package/shadow-$(1)/install
  118. [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
  119. $(INSTALL_DIR) $$(1)/usr/sbin; \
  120. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  121. } || { \
  122. $(INSTALL_DIR) $$(1)/usr/bin; \
  123. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
  124. }
  125. endef
  126. $$(eval $$(call BuildPackage,shadow-$(1)))
  127. endef
  128. $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
  129. $(eval $(call BuildPackage,shadow-utils))
  130. $(eval $(call BuildPackage,shadow-common))
  131. $(eval $(call BuildPackage,shadow))