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.

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