ddns-scripts: fix update_porkbun_v3 shell syntax
[feed/packages.git] / utils / shadow / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=shadow
11 PKG_VERSION:=4.8.1
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=https://github.com/shadow-maint/shadow/releases/download/$(PKG_VERSION)
16 PKG_HASH:=a3ad4630bdc41372f02a647278a8c3514844295d36eefe68ece6c3a641c1ae62
17
18 PKG_MAINTAINER:=
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:debian:shadow
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25 PKG_BUILD_DEPENDS:=libxcrypt
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/nls.mk
29
30 SHADOW_APPLETS := \
31 chage chfn chgpasswd chpasswd chsh expiry faillog gpasswd \
32 groupadd groupdel groupmems groupmod groups grpck grpconv grpunconv \
33 lastlog login logoutd newgidmap newgrp newuidmap newusers nologin \
34 passwd pwck pwconv pwunconv su \
35 useradd userdel usermod vipw
36
37 CONFIGURE_ARGS += \
38 --without-audit \
39 --without-libpam \
40 --without-selinux \
41 --without-acl \
42 --without-attr \
43 --without-tcb \
44 --without-nscd \
45 --with-bcrypt
46
47 CONFIGURE_VARS += \
48 ac_cv_func_ruserok=no
49
50 define Package/shadow/Default
51 SECTION:=utils
52 CATEGORY:=Utilities
53 TITLE:=The PLD Linux shadow utilities
54 URL:=https://github.com/shadow-maint/shadow
55 endef
56
57 define Package/shadow
58 $(call Package/shadow/Default)
59 TITLE+= (all)
60 DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
61 HIDDEN:=1
62 endef
63
64 define Package/shadow/description
65 Full versions of standard shadow utilities. Normally, you would not
66 use this package, since the functionality in BusyBox is more than
67 sufficient and much smaller.
68 endef
69
70 define Package/shadow/install
71 true
72 endef
73
74 define Package/shadow-utils
75 $(call Package/shadow/Default)
76 endef
77
78 define Package/shadow-utils/config
79 menu "Select shadow utilities"
80 depends on PACKAGE_shadow-utils
81
82 config shadow-all
83 bool "Include all PLD shadow utilities"
84 select PACKAGE_shadow
85 default y
86
87 comment "Utilities"
88
89 $(foreach u,$(SHADOW_APPLETS), \
90 config PACKAGE_shadow-$(u)
91 prompt "Full PLD version of $(u) utility"
92
93 )
94
95 endmenu
96
97 endef
98
99 Package/shadow-utils/description = $(Package/shadow/description)
100
101 define Package/shadow-common
102 $(call Package/shadow/Default)
103 TITLE:=Shared definitions for the PLD Linux shadow utilities
104 DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
105 HIDDEN:=1
106 endef
107
108 define GenPlugin
109 define Package/shadow-$(1)
110 $(call Package/shadow/Default)
111 TITLE:=Utility $(1) from the PLD Linux shadow utilities
112 DEPENDS:=+shadow-common
113 HIDDEN:=1
114 endef
115
116 define Package/shadow-$(1)/description
117 Full version of standard $(1) utility. Normally, you would not use this
118 package, since the functionality in BusyBox is more than sufficient.
119 endef
120 endef
121
122 $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
123
124 define Package/shadow-common/conffiles
125 /etc/login.defs
126 endef
127
128 #hack to get libxcrypt working
129 TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/libxcrypt $(TARGET_LDFLAGS)
130
131 define Package/shadow-common/install
132 $(INSTALL_DIR) $(1)/etc
133 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
134 $(SED) 's,SU_NAME,#SU_NAME,g' $(1)/etc/login.defs
135 $(SED) 's,#ENCRYPT_METHOD DES,ENCRYPT_METHOD BCRYPT,g' $(1)/etc/login.defs
136 endef
137
138 define Package/shadow-utils/install
139 true
140 endef
141
142 define BuildPlugin
143 define Package/shadow-$(1)/install
144 [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
145 $(INSTALL_DIR) $$(1)/usr/sbin; \
146 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
147 } || { \
148 $(INSTALL_DIR) $$(1)/usr/bin; \
149 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
150 }
151 endef
152
153 $$(eval $$(call BuildPackage,shadow-$(1)))
154 endef
155
156 $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
157
158 $(eval $(call BuildPackage,shadow-utils))
159 $(eval $(call BuildPackage,shadow-common))
160 $(eval $(call BuildPackage,shadow))