isc-dhcp: Update to 4.4.3-P1
[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:=9.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/coreutils
16 PKG_HASH:=61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423
17
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=GPL-3.0-or-later
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:gnu:coreutils
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 COREUTILS_APPLETS := \
29 base32 base64 basename basenc b2sum cat chcon chgrp chmod chown chroot \
30 cksum comm cp csplit cut date dd df dir dircolors dirname du echo env \
31 expand expr factor false fmt fold groups head hostid id install join \
32 kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl \
33 nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd \
34 readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum \
35 sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum \
36 sync tac tail tee test timeout touch tr true truncate tsort tty uname \
37 unexpand uniq unlink uptime users vdir wc who whoami yes
38
39 DIR_BIN := \
40 base64 cat chgrp chmod chown cp date dd df echo false kill link ln ls \
41 mkdir mknod mktemp mv nice printenv pwd rm rmdir sleep stat stty sync \
42 touch true uname
43
44 DIR_USR_BIN := \
45 basename chcon cksum comm cut dirname du env expand expr factor fold \
46 groups head hostid id install logname md5sum mkfifo nl nohup nproc od \
47 paste printf readlink realpath runcon seq sha1sum sha256sum sha512sum \
48 shred shuf sort split sum tac tail tee test timeout tr truncate tty \
49 unexpand uniq unlink uptime users wc who whoami yes
50
51 DIR_USR_SBIN := \
52 chroot
53
54 # BusyBox does not provide these yet
55 DIR_OTHERS := \
56 base32 b2sum basenc csplit dir dircolors fmt join numfmt pathchk pinky \
57 pr ptx sha224sum sha384sum stdbuf tsort vdir
58
59 $(eval $(foreach a,$(DIR_BIN),ALTS_$(a):=300:/bin/$(a):/usr/libexec/$(a)-coreutils$(newline)))
60 $(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/libexec/$(a)-coreutils$(newline)))
61 $(eval $(foreach a,$(DIR_USR_SBIN),ALTS_$(a):=300:/usr/sbin/$(a):/usr/libexec/$(a)-coreutils$(newline)))
62
63 DEPENDS_sort = +libpthread
64 DEPENDS_timeout = +librt
65 DEPENDS_expr = +libgmp
66 DEPENDS_factor = +libgmp
67 DEPENDS_cp = +libacl
68 DEPENDS_dir = +libacl +libcap
69 DEPENDS_install = +libacl
70 DEPENDS_ls = +libacl +libcap
71 DEPENDS_mv = +libacl
72 DEPENDS_vdir = +libacl +libcap
73
74 FILES_stdbuf := usr/lib/coreutils/libstdbuf.so
75
76 define Package/coreutils/Default
77 SECTION:=utils
78 CATEGORY:=Utilities
79 TITLE:=The GNU core utilities
80 URL:=http://www.gnu.org/software/coreutils/
81 endef
82
83 define Package/coreutils
84 $(call Package/coreutils/Default)
85 TITLE:=The GNU core utilities
86 MENU:=1
87 endef
88
89 define Package/coreutils/description
90 Full versions of standard GNU utilities. If an equivalent Busybox applet is
91 available, you should consider compiling that instead as Busybox applets are
92 usually smaller, at the expense of reduced functionality.
93 endef
94
95 define GenPlugin
96 define Package/$(1)
97 $(call Package/coreutils/Default)
98 DEPENDS:=coreutils $(DEPENDS_$(2))
99 TITLE:=Utility $(2) from the GNU core utilities
100 ALTERNATIVES:=$(ALTS_$(2))
101 endef
102
103 define Package/$(1)/description
104 Full version of standard GNU $(2) utility.
105 endef
106 endef
107
108 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
109
110 CONFIGURE_VARS += \
111 gl_cv_func_mbrtowc_incomplete_state=yes \
112 gl_cv_func_mbrtowc_retval=yes \
113 gl_cv_func_wcrtomb_retval=yes \
114 ac_cv_header_selinux_context_h=no \
115 ac_cv_header_selinux_flash_h=no \
116 ac_cv_header_selinux_selinux_h=no \
117 ac_cv_search_setfilecon=no
118
119 CONFIGURE_ARGS += \
120 --disable-xattr \
121 --enable-install-program=su \
122 --enable-threads=posix \
123 --enable-acl \
124 --disable-assert \
125 --disable-rpath \
126 --disable-libsmack \
127 --enable-libcap \
128 --without-linux-crypto \
129 --without-openssl \
130 --$(if $(CONFIG_USE_MUSL),with,without)-included-regex \
131 --without-selinux \
132 --with-gmp
133
134 define Package/coreutils/install
135 true
136 endef
137
138 define BuildPlugin
139 define Package/$(1)/install
140 $(INSTALL_DIR) $$(1)/usr/$(if $(ALTS_$(2)),libexec,bin)
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/$(if $(ALTS_$(2)),libexec/$(2)-coreutils,bin/$(2))
142 $(foreach f,$(FILES_$(2)),
143 $(INSTALL_DIR) $$(1)/$(dir $(f))
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(f) $$(1)/$(f)
145 )
146 endef
147
148 $$(eval $$(call BuildPackage,$(1)))
149 endef
150
151 $(eval $(call BuildPackage,coreutils))
152
153 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))