correct tar link
[openwrt/svn-archive/archive.git] / utils / tar / Makefile
1 #
2 # Copyright (C) 2008-2010 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.23
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
16 PKG_MD5SUM:=41e2ca4b924ec7860e51b43ad06cdb7e
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/tar
23 SECTION:=utils
24 CATEGORY:=Utilities
25 DEPENDS:=+bzip2
26 TITLE:=GNU tar
27 URL:=http://www.gnu.org/software/tar/
28 endef
29
30 define Package/tar/description
31 Tar is a program for packaging a set of files as a
32 single archive in tar format.
33 endef
34
35 define Package/tar/postinst
36 #!/bin/sh
37 if [ -e $${IPKG_INSTROOT}/bin/tar ]; then
38 rm -r $${IPKG_INSTROOT}/bin/tar;
39 fi
40 ln -sf /usr/bin/tar $${IPKG_INSTROOT}/bin/tar
41 endef
42
43 define Package/tar/postrm
44 #!/bin/sh
45 rm $${IPKG_INSTROOT}/bin/tar
46 ln -s busybox $${IPKG_INSTROOT}/bin/tar
47 $${IPKG_INSTROOT}/bin/tar 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/tar
48 exit 0
49 endef
50
51 MAKE_FLAGS += \
52 CFLAGS="$(TARGET_CFLAGS)" \
53 LDFLAGS="$(TARGET_LDLAGS)"
54
55 define Package/tar/install
56 $(INSTALL_DIR) $(1)/usr/bin/
57 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
58 endef
59
60 $(eval $(call BuildPackage,tar))