From 4dfb0645e98d9396b57c15b79a5180644f6b991b Mon Sep 17 00:00:00 2001 From: Huangbin Zhan Date: Tue, 23 Jun 2020 22:40:35 +0800 Subject: [PATCH] sed: alternatives instead of postinst Signed-off-by: Huangbin Zhan --- utils/sed/Makefile | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/utils/sed/Makefile b/utils/sed/Makefile index 938728312..50b35de3c 100644 --- a/utils/sed/Makefile +++ b/utils/sed/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sed PKG_VERSION:=4.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/sed @@ -31,6 +31,7 @@ define Package/sed TITLE:=sed stream editor utility - full version DEPENDS:=+libpcre URL:=https://www.gnu.org/software/sed/ + ALTERNATIVES:=300:/bin/sed:/usr/libexec/sed-gnu endef define Package/sed/description @@ -42,22 +43,10 @@ occurrences of a string within a file. endef define Package/sed/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/libexec + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sed $(1)/usr/libexec/sed-gnu endef CONFIGURE_ARGS+= --disable-acl -define Package/sed/postinst -#!/bin/sh -[ -L "$${IPKG_INSTROOT}/bin/sed" ] && rm -f "$${IPKG_INSTROOT}/bin/sed" -exit 0 -endef - -define Package/sed/prerm -$${IPKG_INSTROOT}/bin/busybox sed -h 2>&1 | grep -q BusyBox && \ -ln -sf busybox $${IPKG_INSTROOT}/bin/sed -exit 0 -endef - $(eval $(call BuildPackage,sed))