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