at: bump version
[feed/packages.git] / utils / coreutils / 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:=coreutils
11 PKG_VERSION:=8.23
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/coreutils
16 PKG_HASH:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d
17 PKG_BUILD_DEPENDS:=libpthread
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
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_expr = +libgmp
38 DEPENDS_factor = +libgmp
39 DEPENDS_cp = +libacl
40 DEPENDS_dir = +libacl +libcap
41 DEPENDS_install = +libacl
42 DEPENDS_ls = +libacl +libcap
43 DEPENDS_mv = +libacl
44 DEPENDS_vdir = +libacl +libcap
45
46 FILES_stdbuf := usr/lib/coreutils/libstdbuf.so
47
48 define Package/coreutils/Default
49 SECTION:=utils
50 CATEGORY:=Utilities
51 TITLE:=The GNU core utilities
52 URL:=http://www.gnu.org/software/coreutils/
53 endef
54
55 define Package/coreutils
56 $(call Package/coreutils/Default)
57 TITLE:=The GNU core utilities
58 MENU:=1
59 endef
60
61 define Package/coreutils/description
62 Full versions of standard GNU utilities. If an equivalent Busybox applet is
63 available, you should consider compiling that instead as Busybox applets are
64 usually smaller, at the expense of reduced functionality.
65 endef
66
67 define GenPlugin
68 define Package/$(1)
69 $(call Package/coreutils/Default)
70 DEPENDS:=coreutils $(DEPENDS_$(2))
71 TITLE:=Utility $(2) from the GNU core utilities
72 endef
73
74 define Package/$(1)/description
75 Full version of standard GNU $(2) utility.
76 endef
77 endef
78
79 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
80
81 CONFIGURE_VARS += \
82 gl_cv_func_mbrtowc_incomplete_state=yes \
83 gl_cv_func_mbrtowc_retval=yes \
84 gl_cv_func_wcrtomb_retval=yes
85
86 ifneq ($(CONFIG_USE_UCLIBC),)
87 CONFIGURE_VARS += \
88 ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes)
89 endif
90
91 CONFIGURE_ARGS += \
92 --disable-xattr \
93 --enable-install-program=su
94
95 define Build/Compile
96 $(MAKE) -C $(PKG_BUILD_DIR) \
97 DESTDIR="$(PKG_INSTALL_DIR)" \
98 SHELL="/bin/bash" \
99 all install
100 endef
101
102 define Package/coreutils/install
103 true
104 endef
105
106 define BuildPlugin
107 define Package/$(1)/install
108 $(INSTALL_DIR) $$(1)/usr/bin
109 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
110 $(foreach f,$(FILES_$(2)),
111 $(INSTALL_DIR) $$(1)/$(dir $(f))
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(f) $$(1)/$(f)
113 )
114 endef
115
116 $$(eval $$(call BuildPackage,$(1)))
117 endef
118
119 $(eval $(call BuildPackage,coreutils))
120
121 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))