1
0

Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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:=3
  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. PKG_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 y if USE_FS_ACL_ATTR
  34. default n
  35. config PACKAGE_TAR_XATTR
  36. bool "tar: Enable extended attribute (xattr) support"
  37. default y if USE_FS_ACL_ATTR
  38. default n
  39. config PACKAGE_TAR_GZIP
  40. bool "tar: Enable seamless gzip support"
  41. default y
  42. config PACKAGE_TAR_BZIP2
  43. bool "tar: Enable seamless bzip2 support"
  44. default y
  45. config PACKAGE_TAR_XZ
  46. bool "tar: Enable seamless xz support"
  47. select PACKAGE_xz-utils
  48. select PACKAGE_xz
  49. default y
  50. endif
  51. endef
  52. define Package/tar/description
  53. Tar is a program for packaging a set of files as a
  54. single archive in tar format.
  55. endef
  56. define Package/tar/postinst
  57. #!/bin/sh
  58. if [ -e $${IPKG_INSTROOT}/bin/tar ]; then
  59. rm -r $${IPKG_INSTROOT}/bin/tar;
  60. fi
  61. ln -sf /usr/bin/tar $${IPKG_INSTROOT}/bin/tar
  62. endef
  63. define Package/tar/postrm
  64. #!/bin/sh
  65. rm $${IPKG_INSTROOT}/bin/tar
  66. ln -s busybox $${IPKG_INSTROOT}/bin/tar
  67. $${IPKG_INSTROOT}/bin/tar 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/tar
  68. exit 0
  69. endef
  70. CONFIGURE_ARGS += \
  71. $(if $(CONFIG_PACKAGE_TAR_POSIX_ACL),--with,--without)-posix-acls \
  72. $(if $(CONFIG_PACKAGE_TAR_XATTR),--with,--without)-xattrs \
  73. $(if $(CONFIG_PACKAGE_TAR_GZIP),--with-gzip=gzip,--without-gzip) \
  74. $(if $(CONFIG_PACKAGE_TAR_BZIP2),--with-bzip2=bzip2,--without-bzip2) \
  75. $(if $(CONFIG_PACKAGE_TAR_XZ),--with-xz=xz,--without-xz) \
  76. --without-compress \
  77. --without-lzip \
  78. --without-lzma \
  79. --without-lzop \
  80. --without-selinux
  81. MAKE_FLAGS += \
  82. CFLAGS="$(TARGET_CFLAGS)" \
  83. LDFLAGS="$(TARGET_LDLAGS)"
  84. define Package/tar/install
  85. $(INSTALL_DIR) $(1)/usr/bin/
  86. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
  87. endef
  88. $(eval $(call BuildPackage,tar))