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