2 # Copyright (C) 2008-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=@GNU
/coreutils
16 PKG_HASH
:=61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423
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
26 include $(INCLUDE_DIR
)/package.mk
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
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 \
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
54 # BusyBox does not provide these yet
56 base32 b2sum basenc csplit
dir dircolors fmt
join numfmt pathchk pinky \
57 pr ptx sha224sum sha384sum stdbuf tsort vdir
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
)))
63 DEPENDS_sort
= +libpthread
64 DEPENDS_timeout
= +librt
65 DEPENDS_expr
= +libgmp
66 DEPENDS_factor
= +libgmp
68 DEPENDS_dir
= +libacl
+libcap
69 DEPENDS_install
= +libacl
70 DEPENDS_ls
= +libacl
+libcap
72 DEPENDS_vdir
= +libacl
+libcap
74 FILES_stdbuf
:= usr
/lib
/coreutils
/libstdbuf.so
76 define Package
/coreutils
/Default
79 TITLE
:=The GNU core utilities
80 URL
:=http
://www.gnu.org
/software
/coreutils
/
83 define Package
/coreutils
84 $(call Package
/coreutils
/Default
)
85 TITLE
:=The GNU core utilities
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.
97 $(call Package
/coreutils
/Default
)
98 DEPENDS
:=coreutils
$(DEPENDS_
$(2))
99 TITLE
:=Utility
$(2) from the GNU core utilities
100 ALTERNATIVES
:=$(ALTS_
$(2))
103 define Package
/$(1)/description
104 Full version of standard GNU
$(2) utility.
108 $(foreach a
,$(COREUTILS_APPLETS
),$(eval
$(call GenPlugin
,coreutils-
$(a
),$(a
))))
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
121 --enable-install-program
=su \
122 --enable-threads
=posix \
128 --without-linux-crypto \
130 --$(if
$(CONFIG_USE_MUSL
),with
,without
)-included-regex \
134 define Package
/coreutils
/install
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
)
148 $$(eval
$$(call BuildPackage
,$(1)))
151 $(eval
$(call BuildPackage
,coreutils
))
153 $(foreach a
,$(COREUTILS_APPLETS
),$(eval
$(call BuildPlugin
,coreutils-
$(a
),$(a
))))