Merge pull request #10189 from dibdot/banIP
[feed/packages.git] / utils / grep / Makefile
1 #
2 # Copyright (C) 2010-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=grep
11 PKG_VERSION:=3.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/grep
16 PKG_HASH:=b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514
17
18 PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
19 PKG_LICENSE:=GPL-3.0
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:gnu:grep
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/grep
29 SECTION:=utils
30 CATEGORY:=Utilities
31 TITLE:=grep search utility - full version
32 DEPENDS:=+libpcre
33 URL:=https://www.gnu.org/software/grep/
34 endef
35
36 define Package/grep/description
37 The grep command searches one or more input files for lines
38 containing a match to a specified pattern. By default, grep
39 prints the matching lines.
40 endef
41
42 define Package/grep/install
43 $(INSTALL_DIR) $(1)/usr/bin
44 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/grep $(1)/usr/bin/grep
45 endef
46
47 define Package/grep/postinst
48 #!/bin/sh
49 [ -L "$${IPKG_INSTROOT}/bin/grep" ] && rm -f "$${IPKG_INSTROOT}/bin/grep"
50 exit 0
51 endef
52
53 define Package/grep/prerm
54 $${IPKG_INSTROOT}/bin/busybox grep -h 2>&1 | grep -q BusyBox && \
55 ln -sf busybox $${IPKG_INSTROOT}/bin/grep
56 exit 0
57 endef
58
59 $(eval $(call BuildPackage,grep))