[packages] gzip: update to 1.4, correct symlinks on post{inst,rm}
[openwrt/svn-archive/archive.git] / utils / gzip / Makefile
1 #
2 # Copyright (C) 2006-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:=gzip
11 PKG_VERSION:=1.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@GNU/gzip
16 PKG_MD5SUM:=e381b8506210c794278f5527cba0e765
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/gzip
23 SECTION:=utils
24 CATEGORY:=Utilities
25 TITLE:=gzip (GNU zip) is a compression utility.
26 URL:=http://www.gzip.org/
27 endef
28
29 define Package/gzip/description
30 gzip (GNU zip) is a compression utility designed to be a \
31 replacement for compress.
32 endef
33
34 CONFIGURE_VARS += \
35 gl_cv_func_getopt_gnu=yes \
36
37 define Package/gzip/install
38 $(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/{gunzip,zcat}
39 $(INSTALL_DIR) $(1)/usr/bin
40 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{gunzip,gzip,zcat} $(1)/usr/bin/
41 endef
42
43 define Package/gzip/postinst
44 #!/bin/sh
45 for app in gunzip gzip zcat; do
46 ln -sf $${IPKG_INSTROOT}/usr/bin/$$app $${IPKG_INSTROOT}/bin/$$app
47 done
48 endef
49
50 define Package/gzip/postrm
51 #!/bin/sh
52 for app in gunzip gzip zcat; do
53 ln -sf busybox $${IPKG_INSTROOT}/bin/$$app
54 $${IPKG_INSTROOT}/bin/$$app 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/$$app
55 done
56 exit 0
57 endef
58
59 $(eval $(call BuildPackage,gzip))
60