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