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.

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