d1e4d8f3b8b961272dcc67281e1e9445ab51c158
[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
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/grep
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=grep search utility - full version
31 DEPENDS:=+libpcre
32 URL:=https://www.gnu.org/software/grep/
33 endef
34
35 define Package/grep/description
36 The grep command searches one or more input files for lines
37 containing a match to a specified pattern. By default, grep
38 prints the matching lines.
39 endef
40
41 define Package/grep/install
42 $(INSTALL_DIR) $(1)/usr/bin
43 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/grep $(1)/usr/bin/grep
44 endef
45
46 define Package/grep/postinst
47 #!/bin/sh
48 [ -L "$${IPKG_INSTROOT}/bin/grep" ] && rm -f "$${IPKG_INSTROOT}/bin/grep"
49 exit 0
50 endef
51
52 define Package/grep/prerm
53 $${IPKG_INSTROOT}/bin/busybox grep -h 2>&1 | grep -q BusyBox && \
54 ln -sf busybox $${IPKG_INSTROOT}/bin/grep
55 exit 0
56 endef
57
58 $(eval $(call BuildPackage,grep))