From 56350f77c34ce1401d35561a51efdf1897c65ae7 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Tue, 1 Jul 2014 18:17:52 +0200 Subject: [PATCH] grep: import from packages and update to the latest version --- utils/grep/Makefile | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 utils/grep/Makefile diff --git a/utils/grep/Makefile b/utils/grep/Makefile new file mode 100644 index 0000000000..5bf77e69a4 --- /dev/null +++ b/utils/grep/Makefile @@ -0,0 +1,51 @@ +# +# 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.20 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/grep +PKG_MD5SUM:=2cbea44a4f1548aee20b9ff2d3076908 + +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 && \ +ln -sf busybox $${IPKG_INSTROOT}/bin/grep +exit 0 +endef + +$(eval $(call BuildPackage,grep))