PKG_NAME:=coreutils
PKG_VERSION:=8.23
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/coreutils
timeout touch tr true truncate tsort tty uname unexpand uniq unlink \
uptime users vdir wc who whoami yes
+DIR_BIN := \
+ base64 cat chgrp chmod chown cp date dd echo false kill link ln ls \
+ mkdir mknod mktemp mv nice printenv pwd rm rmdir sleep stat stty sync \
+ touch true uname
+
+DIR_USR_BIN := \
+ basename cksum comm cut dirname du env expand expr factor fold groups \
+ head hostid id install logname md5sum mkfifo nl nohup nproc od paste \
+ printf readlink realpath seq sha1sum sha256sum sha512sum shred shuf \
+ sort split sum tac tail tee test timeout tr truncate tty unexpand uniq \
+ unlink uptime users wc who whoami yes
+
+DIR_USR_SBIN := \
+ chroot
+
+# BusyBox does not provide these yet
+DIR_OTHERS := \
+ chcon csplit dir dircolors fmt join pathchk pinky pr ptx runcon \
+ sha224sum sha384sum stdbuf tsort vdir
+
+$(eval $(foreach a,$(DIR_BIN),ALTS_$(a):=300:/bin/$(a):/usr/bin/gnu-$(a)$(newline)))
+$(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/bin/gnu-$(a)$(newline)))
+$(eval $(foreach a,$(DIR_USR_SBIN),ALTS_$(a):=300:/usr/sbin/$(a):/usr/bin/gnu-$(a)$(newline)))
+
DEPENDS_sort = +libpthread
DEPENDS_timeout = +librt
DEPENDS_expr = +libgmp
$(call Package/coreutils/Default)
DEPENDS:=coreutils $(DEPENDS_$(2))
TITLE:=Utility $(2) from the GNU core utilities
+ ALTERNATIVES:=$(ALTS_$(2))
endef
define Package/$(1)/description
define BuildPlugin
define Package/$(1)/install
$(INSTALL_DIR) $$(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/$(if $(ALTS_$(2)),gnu-$(2),$(2))
$(foreach f,$(FILES_$(2)),
$(INSTALL_DIR) $$(1)/$(dir $(f))
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(f) $$(1)/$(f)