mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
gzip: alternatives instead of postinst
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
This commit is contained in:
+9
-20
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=gzip
|
PKG_NAME:=gzip
|
||||||
PKG_VERSION:=1.10
|
PKG_VERSION:=1.10
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@GNU/gzip
|
PKG_SOURCE_URL:=@GNU/gzip
|
||||||
@@ -29,6 +29,10 @@ define Package/gzip
|
|||||||
TITLE:=gzip (GNU zip) is a compression utility.
|
TITLE:=gzip (GNU zip) is a compression utility.
|
||||||
URL:=https://www.gnu.org/software/gzip/
|
URL:=https://www.gnu.org/software/gzip/
|
||||||
MAINTAINER:=Christian Beier <dontmind@freeshell.org>
|
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
|
endef
|
||||||
|
|
||||||
define Package/gzip/description
|
define Package/gzip/description
|
||||||
@@ -42,25 +46,10 @@ CONFIGURE_VARS += \
|
|||||||
|
|
||||||
define Package/gzip/install
|
define Package/gzip/install
|
||||||
$(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/{gunzip,zcat}
|
$(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/{gunzip,zcat}
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/libexec
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{gunzip,gzip,zcat} $(1)/usr/bin/
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunzip $(1)/usr/libexec/gunzip-gnu
|
||||||
endef
|
$(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
|
||||||
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
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,gzip))
|
$(eval $(call BuildPackage,gzip))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user