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