[packages] add gnu grep

Signed-off-by: Peter Wagner <tripolar@gmx.at>


git-svn-id: svn://svn.openwrt.org/openwrt/packages@38542 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
tripolar 2013-10-26 16:05:56 +00:00
parent a655840774
commit 2292e7f361

58
utils/grep/Makefile Normal file
View File

@ -0,0 +1,58 @@
#
# Copyright (C) 2010-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=grep
PKG_VERSION:=2.14
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/grep
PKG_MD5SUM:=d4a3f03849d1e17ce56ab76aa5a24cab
include $(INCLUDE_DIR)/package.mk
define Package/grep
SECTION:=utils
CATEGORY:=Utilities
TITLE:=grep search utility - full version
DEPENDS:=+libpcre
URL:=http://www.gnu.org/software/grep/
endef
define Package/grep/description
The grep command searches one or more input files for lines
containing a match to a specified pattern. By default, grep
prints the matching lines.
endef
define Package/grep/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/grep $(1)/usr/bin/grep
endef
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 && \
touch $${IPKG_INSTROOT}/tmp/bb_with_grep
endef
define Package/grep/postrm
#!/bin/sh
[ -f $${IPKG_INSTROOT}/tmp/bb_with_grep ] && \
ln -sf busybox $${IPKG_INSTROOT}/bin/grep && \
rm $${IPKG_INSTROOT}/tmp/bb_with_grep
exit 0
endef
$(eval $(call BuildPackage,grep))