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.

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