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.

120 lines
3.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.23
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/coreutils
  13. PKG_HASH:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d
  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. DEPENDS_sort = +libpthread
  28. DEPENDS_timeout = +librt
  29. DEPENDS_expr = +libgmp
  30. DEPENDS_factor = +libgmp
  31. DEPENDS_cp = +libacl
  32. DEPENDS_dir = +libacl +libcap
  33. DEPENDS_install = +libacl
  34. DEPENDS_ls = +libacl +libcap
  35. DEPENDS_mv = +libacl
  36. DEPENDS_vdir = +libacl +libcap
  37. FILES_stdbuf := usr/lib/coreutils/libstdbuf.so
  38. define Package/coreutils/Default
  39. SECTION:=utils
  40. CATEGORY:=Utilities
  41. TITLE:=The GNU core utilities
  42. URL:=http://www.gnu.org/software/coreutils/
  43. endef
  44. define Package/coreutils
  45. $(call Package/coreutils/Default)
  46. TITLE:=The GNU core utilities
  47. MENU:=1
  48. endef
  49. define Package/coreutils/description
  50. Full versions of standard GNU utilities. If an equivalent Busybox applet is
  51. available, you should consider compiling that instead as Busybox applets are
  52. usually smaller, at the expense of reduced functionality.
  53. endef
  54. define GenPlugin
  55. define Package/$(1)
  56. $(call Package/coreutils/Default)
  57. DEPENDS:=coreutils $(DEPENDS_$(2))
  58. TITLE:=Utility $(2) from the GNU core utilities
  59. endef
  60. define Package/$(1)/description
  61. Full version of standard GNU $(2) utility.
  62. endef
  63. endef
  64. $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
  65. CONFIGURE_VARS += \
  66. gl_cv_func_mbrtowc_incomplete_state=yes \
  67. gl_cv_func_mbrtowc_retval=yes \
  68. gl_cv_func_wcrtomb_retval=yes
  69. ifneq ($(CONFIG_USE_UCLIBC),)
  70. CONFIGURE_VARS += \
  71. ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes)
  72. endif
  73. CONFIGURE_ARGS += \
  74. --disable-xattr \
  75. --enable-install-program=su
  76. define Build/Compile
  77. $(MAKE) -C $(PKG_BUILD_DIR) \
  78. DESTDIR="$(PKG_INSTALL_DIR)" \
  79. SHELL="/bin/bash" \
  80. all install
  81. endef
  82. define Package/coreutils/install
  83. true
  84. endef
  85. define BuildPlugin
  86. define Package/$(1)/install
  87. $(INSTALL_DIR) $$(1)/usr/bin
  88. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
  89. $(foreach f,$(FILES_$(2)),
  90. $(INSTALL_DIR) $$(1)/$(dir $(f))
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(f) $$(1)/$(f)
  92. )
  93. endef
  94. $$(eval $$(call BuildPackage,$(1)))
  95. endef
  96. $(eval $(call BuildPackage,coreutils))
  97. $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))