Parcourir la source

coreutils: import from packages, add myself as maintainer

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich il y a 10 ans
Parent
révision
2abee9646c

+ 110
- 0
utils/coreutils/Makefile Voir le fichier

@@ -0,0 +1,110 @@
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:=coreutils
11
+PKG_VERSION:=8.16
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=@GNU/coreutils
16
+PKG_MD5SUM:=89b06f91634208dceba7b36ad1f9e8b9
17
+PKG_BUILD_DEPENDS:=libpthread
18
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
19
+
20
+PKG_BUILD_PARALLEL:=1
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+COREUTILS_APPLETS := \
25
+	base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit \
26
+	cut date dd dir dircolors dirname du echo env expand expr factor	\
27
+	false fmt fold groups head hostid id install join kill link ln logname	\
28
+	ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste	\
29
+	pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir	\
30
+	runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred	\
31
+	shuf sleep sort split stat stdbuf stty sum sync tac tail tee test	\
32
+	timeout touch tr true truncate tsort tty uname unexpand	uniq unlink	\
33
+	uptime users vdir wc who whoami yes
34
+
35
+DEPENDS_sort = +libpthread
36
+DEPENDS_timeout = +librt
37
+DEPENDS_uptime = +libelf1
38
+DEPENDS_expr = +libgmp
39
+DEPENDS_factor = +libgmp
40
+
41
+define Package/coreutils/Default
42
+  SECTION:=utils
43
+  CATEGORY:=Utilities
44
+  TITLE:=The GNU core utilities
45
+  URL:=http://www.gnu.org/software/coreutils/
46
+endef
47
+
48
+define Package/coreutils
49
+  $(call Package/coreutils/Default)
50
+  TITLE:=The GNU core utilities
51
+  MENU:=1
52
+endef
53
+
54
+define Package/coreutils/description
55
+ Full versions of standard GNU utilities. Normally, you would not use this
56
+ package, since the functionality in BusyBox is more than sufficient and
57
+ smaller.
58
+endef
59
+
60
+define GenPlugin
61
+ define Package/$(1)
62
+   $(call Package/coreutils/Default)
63
+   DEPENDS:=coreutils $(DEPENDS_$(2))
64
+   TITLE:=Utility $(2) from the GNU core utilities
65
+ endef
66
+
67
+ define Package/$(1)/description
68
+  Full version of standard GNU $(2) utility. Normally, you would not use this
69
+  package, since the functionality in BusyBox is more than sufficient.
70
+ endef
71
+endef
72
+
73
+$(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
74
+
75
+CONFIGURE_VARS += \
76
+	gl_cv_func_mbrtowc_incomplete_state=yes \
77
+	gl_cv_func_mbrtowc_retval=yes \
78
+	gl_cv_func_wcrtomb_retval=yes
79
+
80
+ifneq ($(CONFIG_USE_UCLIBC),)
81
+  CONFIGURE_VARS += \
82
+	ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes)
83
+endif
84
+
85
+CONFIGURE_ARGS += \
86
+	--enable-install-program=su
87
+
88
+define Build/Compile
89
+	$(MAKE) -C $(PKG_BUILD_DIR) \
90
+		DESTDIR="$(PKG_INSTALL_DIR)" \
91
+		SHELL="/bin/bash" \
92
+		all install install-root
93
+endef
94
+
95
+define Package/coreutils/install
96
+	true
97
+endef
98
+
99
+define BuildPlugin
100
+  define Package/$(1)/install
101
+	$(INSTALL_DIR) $$(1)/usr/bin
102
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
103
+  endef
104
+
105
+  $$(eval $$(call BuildPackage,$(1)))
106
+endef
107
+
108
+$(eval $(call BuildPackage,coreutils))
109
+
110
+$(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))

+ 22
- 0
utils/coreutils/patches/001-no_docs_man_tests.patch Voir le fichier

@@ -0,0 +1,22 @@
1
+--- a/Makefile.am
2
++++ b/Makefile.am
3
+@@ -17,7 +17,7 @@
4
+ 
5
+ ALL_RECURSIVE_TARGETS =
6
+ 
7
+-SUBDIRS = lib src doc man po tests gnulib-tests
8
++SUBDIRS = lib src po
9
+ 
10
+ changelog_etc =				\
11
+   ChangeLog-2005			\
12
+--- a/Makefile.in
13
++++ b/Makefile.in
14
+@@ -1639,7 +1639,7 @@ top_srcdir = @top_srcdir@
15
+ 
16
+ # Some tests always need root privileges, others need them only sometimes.
17
+ ALL_RECURSIVE_TARGETS = install-root check-root distcheck-hook
18
+-SUBDIRS = lib src doc man po tests gnulib-tests
19
++SUBDIRS = lib src po
20
+ changelog_etc = \
21
+   ChangeLog-2005			\
22
+   ChangeLog-2006			\

+ 12
- 0
utils/coreutils/patches/002-fix_compile_with_uclibc.patch Voir le fichier

@@ -0,0 +1,12 @@
1
+--- a/lib/pthread.in.h
2
++++ b/lib/pthread.in.h
3
+@@ -232,6 +232,9 @@ pthread_mutex_unlock (pthread_mutex_t *m
4
+ 
5
+ /* Approximate spinlocks with mutexes.  */
6
+ 
7
++#ifdef __UCLIBC__
8
++#define pthread_spinlock_t original_pthread_spinlock_t
9
++#endif
10
+ typedef pthread_mutex_t pthread_spinlock_t;
11
+ 
12
+ static inline int

+ 15
- 0
utils/coreutils/patches/010-fix-gets-removal.patch Voir le fichier

@@ -0,0 +1,15 @@
1
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
2
+index 9dc7c4a..9fdac77 100644
3
+--- a/lib/stdio.in.h
4
++++ b/lib/stdio.in.h
5
+@@ -711,10 +711,6 @@ _GL_CXXALIAS_SYS (gets, char *, (char *s));
6
+ #  undef gets
7
+ # endif
8
+ _GL_CXXALIASWARN (gets);
9
+-/* It is very rare that the developer ever has full control of stdin,
10
+-   so any use of gets warrants an unconditional warning.  Assume it is
11
+-   always declared, since it is required by C89.  */
12
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
13
+ #endif
14
+ 
15
+