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.

106 lines
2.5 KiB

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