d56be82713f96467aebb8af9dd53ba98a92d8208
[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:=5
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 default y
77
78 comment "Utilities"
79
80 $(foreach u,$(SHADOW_APPLETS), \
81 config PACKAGE_shadow-$(u)
82 prompt "Full PLD version of $(u) utility"
83
84 )
85
86 endmenu
87
88 endef
89
90 Package/shadow-utils/description = $(Package/shadow/description)
91
92 define Package/shadow-common
93 $(call Package/shadow/Default)
94 TITLE:=Shared definitions for the PLD Linux shadow utilities
95 DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS)
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))