You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.5 KiB

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