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.

160 lines
3.8 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:=3
  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. PKG_BUILD_DEPENDS:=libxcrypt
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/nls.mk
  23. SHADOW_APPLETS := \
  24. chage chfn chgpasswd chpasswd chsh expiry faillog gpasswd \
  25. groupadd groupdel groupmems groupmod groups grpck grpconv grpunconv \
  26. lastlog login logoutd newgidmap newgrp newuidmap newusers nologin \
  27. passwd pwck pwconv pwunconv su \
  28. useradd userdel usermod vipw
  29. CONFIGURE_ARGS += \
  30. --without-audit \
  31. --without-libpam \
  32. --without-selinux \
  33. --without-acl \
  34. --without-attr \
  35. --without-tcb \
  36. --without-nscd \
  37. --with-bcrypt
  38. CONFIGURE_VARS += \
  39. ac_cv_func_ruserok=no
  40. define Package/shadow/Default
  41. SECTION:=utils
  42. CATEGORY:=Utilities
  43. TITLE:=The PLD Linux shadow utilities
  44. URL:=https://github.com/shadow-maint/shadow
  45. endef
  46. define Package/shadow
  47. $(call Package/shadow/Default)
  48. TITLE+= (all)
  49. DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
  50. HIDDEN:=1
  51. endef
  52. define Package/shadow/description
  53. Full versions of standard shadow utilities. Normally, you would not
  54. use this package, since the functionality in BusyBox is more than
  55. sufficient and much smaller.
  56. endef
  57. define Package/shadow/install
  58. true
  59. endef
  60. define Package/shadow-utils
  61. $(call Package/shadow/Default)
  62. endef
  63. define Package/shadow-utils/config
  64. menu "Select shadow utilities"
  65. depends on PACKAGE_shadow-utils
  66. config shadow-all
  67. bool "Include all PLD shadow utilities"
  68. select PACKAGE_shadow
  69. default y
  70. comment "Utilities"
  71. $(foreach u,$(SHADOW_APPLETS), \
  72. config PACKAGE_shadow-$(u)
  73. prompt "Full PLD version of $(u) utility"
  74. )
  75. endmenu
  76. endef
  77. Package/shadow-utils/description = $(Package/shadow/description)
  78. define Package/shadow-common
  79. $(call Package/shadow/Default)
  80. TITLE:=Shared definitions for the PLD Linux shadow utilities
  81. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
  82. HIDDEN:=1
  83. endef
  84. define GenPlugin
  85. define Package/shadow-$(1)
  86. $(call Package/shadow/Default)
  87. TITLE:=Utility $(1) from the PLD Linux shadow utilities
  88. DEPENDS:=+shadow-common
  89. HIDDEN:=1
  90. endef
  91. define Package/shadow-$(1)/description
  92. Full version of standard $(1) utility. Normally, you would not use this
  93. package, since the functionality in BusyBox is more than sufficient.
  94. endef
  95. endef
  96. $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
  97. define Package/shadow-common/conffiles
  98. /etc/login.defs
  99. endef
  100. #hack to get libxcrypt working
  101. TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/libxcrypt $(TARGET_LDFLAGS)
  102. define Package/shadow-common/install
  103. $(INSTALL_DIR) $(1)/etc
  104. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
  105. $(SED) 's,SU_NAME,#SU_NAME,g' $(1)/etc/login.defs
  106. $(SED) 's,#ENCRYPT_METHOD DES,ENCRYPT_METHOD BCRYPT,g' $(1)/etc/login.defs
  107. endef
  108. define Package/shadow-utils/install
  109. true
  110. endef
  111. define BuildPlugin
  112. define Package/shadow-$(1)/install
  113. [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
  114. $(INSTALL_DIR) $$(1)/usr/sbin; \
  115. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  116. } || { \
  117. $(INSTALL_DIR) $$(1)/usr/bin; \
  118. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
  119. }
  120. endef
  121. $$(eval $$(call BuildPackage,shadow-$(1)))
  122. endef
  123. $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
  124. $(eval $(call BuildPackage,shadow-utils))
  125. $(eval $(call BuildPackage,shadow-common))
  126. $(eval $(call BuildPackage,shadow))