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.

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