aboutsummaryrefslogtreecommitdiff
path: root/utils/gzip
diff options
context:
space:
mode:
authorHuangbin Zhan <zhanhb88@gmail.com>2020-06-23 22:37:43 +0800
committerHuangbin Zhan <zhanhb88@gmail.com>2020-06-23 22:37:43 +0800
commit77cc3464386b20bc25396d8fe6faed61b7b45eee (patch)
treeb054afd796b9528ef06073c6463c84f69cd4edea /utils/gzip
parent413027e865b4038f71eeb14a2973a285eae494a3 (diff)
gzip: alternatives instead of postinst
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
Diffstat (limited to 'utils/gzip')
-rw-r--r--utils/gzip/Makefile29
1 files changed, 9 insertions, 20 deletions
diff --git a/utils/gzip/Makefile b/utils/gzip/Makefile
index 0b64553e3..6a6eede46 100644
--- a/utils/gzip/Makefile
+++ b/utils/gzip/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gzip
PKG_VERSION:=1.10
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gzip
@@ -29,6 +29,10 @@ define Package/gzip
TITLE:=gzip (GNU zip) is a compression utility.
URL:=https://www.gnu.org/software/gzip/
MAINTAINER:=Christian Beier <dontmind@freeshell.org>
+ ALTERNATIVES:=\
+ 300:/bin/gunzip:/usr/libexec/gunzip-gnu \
+ 300:/bin/gzip:/usr/libexec/gzip-gnu \
+ 300:/bin/zcat:/usr/libexec/zcat-gnu
endef
define Package/gzip/description
@@ -42,25 +46,10 @@ CONFIGURE_VARS += \
define Package/gzip/install
$(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/{gunzip,zcat}
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{gunzip,gzip,zcat} $(1)/usr/bin/
-endef
-
-define Package/gzip/postinst
-#!/bin/sh
-for app in gunzip gzip zcat; do
- ln -sf ../usr/bin/$$app $${IPKG_INSTROOT}/bin/$$app
-done
-endef
-
-define Package/gzip/postrm
-#!/bin/sh
-for app in gunzip gzip zcat; do
- ln -sf busybox $${IPKG_INSTROOT}/bin/$$app
- $${IPKG_INSTROOT}/bin/$$app 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/$$app
-done
-exit 0
+ $(INSTALL_DIR) $(1)/usr/libexec
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunzip $(1)/usr/libexec/gunzip-gnu
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gzip $(1)/usr/libexec/gzip-gnu
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/zcat $(1)/usr/libexec/zcat-gnu
endef
$(eval $(call BuildPackage,gzip))
-