Browse Source

shadow: adopt here

Signed-off-by: Steven Barth <steven@midlink.org>
Steven Barth 10 years ago
parent
commit
7766038afb

+ 112
- 0
utils/shadow/Makefile View File

@@ -0,0 +1,112 @@
1
+#
2
+# Copyright (C) 2008-2013 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.1.5.1
12
+PKG_RELEASE:=4
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
+PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
16
+PKG_MD5SUM:=a00449aa439c69287b6d472191dc2247
17
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
18
+
19
+PKG_FIXUP:=autoreconf
20
+PKG_BUILD_PARALLEL:=1
21
+PKG_INSTALL:=1
22
+
23
+PKG_BUILD_DEPENDS:=libintl
24
+
25
+include $(INCLUDE_DIR)/package.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
+
40
+define Package/shadow/Default
41
+  SECTION:=utils
42
+  CATEGORY:=Utilities
43
+  TITLE:=The PLD Linux shadow utilities
44
+  URL:=http://pkg-shadow.alioth.debian.org/
45
+endef
46
+
47
+define Package/shadow
48
+  $(call Package/shadow/Default)
49
+  DEPENDS:=$(foreach u,$(SHADOW_APPLETS),+shadow-$(u))
50
+endef
51
+
52
+define Package/shadow/description
53
+  Full versions of standard shadow utilities. Normally, you would not
54
+  use this package, since the functionality in BusyBox is more than
55
+  sufficient and much smaller.
56
+endef
57
+
58
+define Package/shadow/install
59
+	true
60
+endef
61
+
62
+
63
+define Package/shadow-common
64
+  $(call Package/shadow/Default)
65
+  TITLE:=Shared definitions for the PLD Linux shadow utilities
66
+endef
67
+
68
+
69
+define GenPlugin
70
+  define Package/shadow-$(1)
71
+    $(call Package/shadow/Default)
72
+    TITLE:=Utility $(1) from the PLD Linux shadow utilities
73
+    DEPENDS:=+shadow-common
74
+  endef
75
+
76
+  define Package/shadow-$(1)/description
77
+    Full version of standard $(1) utility. Normally, you would not use this
78
+    package, since the functionality in BusyBox is more than sufficient.
79
+  endef
80
+endef
81
+
82
+$(foreach u,$(SHADOW_APPLETS),$(eval $(call GenPlugin,$(u))))
83
+
84
+
85
+define Package/shadow-common/conffiles
86
+/etc/login.defs
87
+endef
88
+
89
+define Package/shadow-common/install
90
+	$(INSTALL_DIR) $(1)/etc
91
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/login.defs $(1)/etc/
92
+endef
93
+
94
+
95
+define BuildPlugin
96
+  define Package/shadow-$(1)/install
97
+	[ -x "$(PKG_INSTALL_DIR)/usr/sbin/$(1)" ] && { \
98
+		$(INSTALL_DIR) $$(1)/usr/sbin; \
99
+		$(CP) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
100
+	} || { \
101
+		$(INSTALL_DIR) $$(1)/usr/bin; \
102
+		$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/; \
103
+	}
104
+  endef
105
+
106
+  $$(eval $$(call BuildPackage,shadow-$(1)))
107
+endef
108
+
109
+$(foreach u,$(SHADOW_APPLETS),$(eval $(call BuildPlugin,$(u))))
110
+
111
+$(eval $(call BuildPackage,shadow))
112
+$(eval $(call BuildPackage,shadow-common))

+ 13
- 0
utils/shadow/patches/001-busybox_ash.patch View File

@@ -0,0 +1,13 @@
1
+diff --git a/etc/login.defs b/etc/login.defs
2
+index 5b6fab3..79eeccf 100644
3
+--- a/etc/login.defs
4
++++ b/etc/login.defs
5
+@@ -111,7 +111,7 @@ NOLOGINS_FILE	/etc/nologin
6
+ # command is "-su".  If not defined, then "ps" would display the
7
+ # name of the shell actually being run, e.g. something like "-sh".
8
+ #
9
+-SU_NAME		su
10
++#SU_NAME		su
11
+ 
12
+ #
13
+ # *REQUIRED*

+ 10
- 0
utils/shadow/patches/002-disable-ruser-lookup.patch View File

@@ -0,0 +1,10 @@
1
+--- a/configure.in
2
++++ b/configure.in
3
+@@ -195,7 +195,6 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$sha
4
+ dnl XXX - quick hack, should disappear before anyone notices :).
5
+ AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
6
+ AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
7
+-AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
8
+ 
9
+ AC_ARG_ENABLE(shadowgrp,
10
+ 	[AC_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])],