8896f71add50000287941f6302035372c6b82ea3
[feed/packages.git] / utils / shadow / Makefile
1 #
2 # Copyright (C) 2008-2014 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:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
16 PKG_MD5SUM:=2bfafe7d4962682d31b5eba65dba4fc8
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 groupadd groupdel groupmod groups passwd su \
29 useradd userdel usermod
30
31 CONFIGURE_ARGS += \
32 --without-audit \
33 --without-libpam \
34 --without-selinux \
35 --without-acl \
36 --without-attr \
37 --without-tcb \
38 --without-nscd \
39 --disable-subordinate-ids \
40
41 define Package/shadow/Default
42 SECTION:=utils
43 CATEGORY:=Utilities
44 TITLE:=The PLD Linux shadow utilities
45 URL:=http://pkg-shadow.alioth.debian.org/
46 endef
47
48 define Package/shadow
49 $(call Package/shadow/Default)
50 TITLE+= (all)
51 DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
52 HIDDEN:=1
53 endef
54
55 define Package/shadow/description
56 Full versions of standard shadow utilities. Normally, you would not
57 use this package, since the functionality in BusyBox is more than
58 sufficient and much smaller.
59 endef
60
61 define Package/shadow/install
62 true
63 endef
64
65 define Package/shadow-utils
66 $(call Package/shadow/Default)
67 endef
68
69 define Package/shadow-utils/config
70 menu "Select shadow utilities"
71 depends on PACKAGE_shadow-utils
72
73 config shadow-all
74 bool "Include all PLD shadow utilities"
75 select PACKAGE_shadow
76
77 comment "Utilities"
78
79 $(foreach u,$(SHADOW_APPLETS), \
80 config PACKAGE_shadow-$(u)
81 prompt "Full PLD version of $(u) utility"
82
83 )
84
85 endmenu
86
87 endef
88
89 Package/shadow-utils/description = $(Package/shadow/description)
90
91 define Package/shadow-common
92 $(call Package/shadow/Default)
93 TITLE:=Shared definitions for the PLD Linux shadow utilities
94 DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
95 HIDDEN:=1
96 endef
97
98 define GenPlugin
99 define Package/shadow-$(1)
100 $(call Package/shadow/Default)
101 TITLE:=Utility $(1) from the PLD Linux shadow utilities
102 DEPENDS:=+shadow-common
103 HIDDEN:=1
104 endef
105
106 define Package/shadow-$(1)/description
107 Full version of standard $(1) utility. Normally, you would not use this
108 package, since the functionality in BusyBox is more than sufficient.
109 endef
110 endef
111
112 $(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
113
114 define Package/shadow-common/conffiles
115 /etc/login.defs
116 endef
117
118 define Package/shadow-common/install
119 $(INSTALL_DIR) $(1)/etc
120 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
121 endef
122
123 define Package/shadow-utils/install
124 true
125 endef
126
127 define BuildPlugin
128 define Package/shadow-$(1)/install
129 [ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
130 $(INSTALL_DIR) $$(1)/usr/sbin; \
131 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
132 } || { \
133 $(INSTALL_DIR) $$(1)/usr/bin; \
134 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
135 }
136 endef
137
138 $$(eval $$(call BuildPackage,shadow-$(1)))
139 endef
140
141 $(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
142
143 $(eval $(call BuildPackage,shadow-utils))
144 $(eval $(call BuildPackage,shadow-common))
145 $(eval $(call BuildPackage,shadow))