xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-extended/grep/grep_3.7.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "GNU grep utility"
2HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
3DESCRIPTION = "Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines."
4BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
5SECTION = "console/utils"
6LICENSE = "GPL-3.0-only"
7LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
8
9SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
10           file://0001-mcontext-is-not-a-standard-layout-so-glibc-and-musl-.patch \
11          "
12
13SRC_URI[sha256sum] = "5c10da312460aec721984d5d83246d24520ec438dd48d7ab5a05dbc0d6d6823c"
14
15inherit autotools gettext texinfo pkgconfig
16
17# Fix "Argument list too long" error when len(TMPDIR) = 410
18acpaths = "-I ./m4"
19
20do_configure:prepend () {
21	sed -i -e '1s,#!@SHELL@,#!/bin/sh,' ${S}/src/egrep.sh
22	rm -f ${S}/m4/init.m4
23}
24
25do_install () {
26	autotools_do_install
27	if [ "${base_bindir}" != "${bindir}" ]; then
28		install -d ${D}${base_bindir}
29		mv ${D}${bindir}/grep ${D}${base_bindir}/grep
30		mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
31		mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
32		rmdir ${D}${bindir}/
33	fi
34}
35
36inherit update-alternatives
37
38PACKAGECONFIG ??= "pcre"
39PACKAGECONFIG[pcre] = "--enable-perl-regexp,--disable-perl-regexp,libpcre"
40
41ALTERNATIVE_PRIORITY = "100"
42
43ALTERNATIVE:${PN} = "grep egrep fgrep"
44ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
45ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
46ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
47
48BBCLASSEXTEND = "nativesdk"
49