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.

115 lines
2.8 KiB

  1. #
  2. # Copyright (C) 2008-2017 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:=tar
  9. PKG_VERSION:=1.32
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  13. PKG_HASH:=d0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8
  14. PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
  15. PKG_LICENSE:=GPL-3.0-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:gnu:tar
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/tar
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. DEPENDS:=+PACKAGE_TAR_POSIX_ACL:libacl +PACKAGE_TAR_XATTR:libattr +PACKAGE_TAR_BZIP2:bzip2
  25. EXTRA_DEPENDS:=$(if $(CONFIG_PACKAGE_TAR_XZ),xz)
  26. TITLE:=GNU tar
  27. URL:=https://www.gnu.org/software/tar/
  28. MENU:=1
  29. endef
  30. define Package/tar/config
  31. if PACKAGE_tar
  32. config PACKAGE_TAR_POSIX_ACL
  33. bool "tar: Enable POSIX ACL support"
  34. default y if USE_FS_ACL_ATTR
  35. default n
  36. config PACKAGE_TAR_XATTR
  37. bool "tar: Enable extended attribute (xattr) support"
  38. default y if USE_FS_ACL_ATTR
  39. default n
  40. config PACKAGE_TAR_BZIP2
  41. bool "tar: Enable seamless bzip2 support"
  42. default y
  43. config PACKAGE_TAR_GZIP
  44. bool "tar: Enable seamless gzip support"
  45. default y
  46. config PACKAGE_TAR_XZ
  47. bool "tar: Enable seamless xz support"
  48. select PACKAGE_xz-utils
  49. select PACKAGE_xz
  50. default y
  51. config PACKAGE_TAR_ZSTD
  52. bool "tar: Enable seamless zstd support"
  53. select PACKAGE_libzstd
  54. default y
  55. endif
  56. endef
  57. define Package/tar/description
  58. Tar is a program for packaging a set of files as a
  59. single archive in tar format.
  60. endef
  61. define Package/tar/postinst
  62. #!/bin/sh
  63. if [ -e $${IPKG_INSTROOT}/bin/tar ]; then
  64. rm -r $${IPKG_INSTROOT}/bin/tar;
  65. fi
  66. ln -sf /usr/bin/tar $${IPKG_INSTROOT}/bin/tar
  67. endef
  68. define Package/tar/postrm
  69. #!/bin/sh
  70. rm $${IPKG_INSTROOT}/bin/tar
  71. ln -s busybox $${IPKG_INSTROOT}/bin/tar
  72. $${IPKG_INSTROOT}/bin/tar 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/tar
  73. exit 0
  74. endef
  75. CONFIGURE_ARGS += \
  76. $(if $(CONFIG_PACKAGE_TAR_POSIX_ACL),--with,--without)-posix-acls \
  77. $(if $(CONFIG_PACKAGE_TAR_XATTR),--with,--without)-xattrs \
  78. $(if $(CONFIG_PACKAGE_TAR_BZIP2),--with-bzip2=bzip2,--without-bzip2) \
  79. $(if $(CONFIG_PACKAGE_TAR_GZIP),--with-gzip=gzip,--without-gzip) \
  80. $(if $(CONFIG_PACKAGE_TAR_XZ),--with-xz=xz,--without-xz) \
  81. $(if $(CONFIG_PACKAGE_TAR_ZSTD),--with-zstd=zstd,--without-zstd) \
  82. --without-compress \
  83. --without-lzip \
  84. --without-lzma \
  85. --without-lzop \
  86. --without-selinux \
  87. --disable-rpath
  88. MAKE_FLAGS += \
  89. CFLAGS="$(TARGET_CFLAGS)" \
  90. LDFLAGS="$(TARGET_LDLAGS)"
  91. define Package/tar/install
  92. $(INSTALL_DIR) $(1)/usr/bin/
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
  94. endef
  95. $(eval $(call BuildPackage,tar))