grep: alternatives instead of postinst
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
This commit is contained in:
parent
6b5fa7e9b9
commit
413027e865
1 changed files with 9 additions and 15 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=grep
|
PKG_NAME:=grep
|
||||||
PKG_VERSION:=3.4
|
PKG_VERSION:=3.4
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@GNU/grep
|
PKG_SOURCE_URL:=@GNU/grep
|
||||||
|
@ -31,6 +31,10 @@ define Package/grep
|
||||||
TITLE:=grep search utility - full version
|
TITLE:=grep search utility - full version
|
||||||
DEPENDS:=+libpcre
|
DEPENDS:=+libpcre
|
||||||
URL:=https://www.gnu.org/software/grep/
|
URL:=https://www.gnu.org/software/grep/
|
||||||
|
ALTERNATIVES:=\
|
||||||
|
300:/bin/egrep:/usr/libexec/egrep-gnu \
|
||||||
|
300:/bin/fgrep:/usr/libexec/fgrep-gnu \
|
||||||
|
300:/bin/grep:/usr/libexec/grep-gnu
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/grep/description
|
define Package/grep/description
|
||||||
|
@ -40,20 +44,10 @@ prints the matching lines.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/grep/install
|
define Package/grep/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/libexec
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/egrep $(1)/usr/libexec/egrep-gnu
|
||||||
endef
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fgrep $(1)/usr/libexec/fgrep-gnu
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/grep $(1)/usr/libexec/grep-gnu
|
||||||
define Package/grep/postinst
|
|
||||||
#!/bin/sh
|
|
||||||
[ -L "$${IPKG_INSTROOT}/bin/grep" ] && rm -f "$${IPKG_INSTROOT}/bin/grep"
|
|
||||||
exit 0
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/grep/prerm
|
|
||||||
$${IPKG_INSTROOT}/bin/busybox grep -h 2>&1 | grep -q BusyBox && \
|
|
||||||
ln -sf busybox $${IPKG_INSTROOT}/bin/grep
|
|
||||||
exit 0
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,grep))
|
$(eval $(call BuildPackage,grep))
|
||||||
|
|
Loading…
Reference in a new issue