blob: 7005cbe164c5b0876bb2e1f2dff80fba54a92695 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "GNU grep utility"
2HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05003DESCRIPTION = "Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines."
Andrew Geissler82c905d2020-04-13 13:39:40 -05004BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
5SECTION = "console/utils"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006LICENSE = "GPL-3.0-only"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
8
Andrew Geissler9aee5002022-03-30 16:27:02 +00009SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
10 file://0001-mcontext-is-not-a-standard-layout-so-glibc-and-musl-.patch \
11 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050013SRC_URI[sha256sum] = "5c10da312460aec721984d5d83246d24520ec438dd48d7ab5a05dbc0d6d6823c"
Andrew Geissler82c905d2020-04-13 13:39:40 -050014
15inherit autotools gettext texinfo pkgconfig
16
17# Fix "Argument list too long" error when len(TMPDIR) = 410
18acpaths = "-I ./m4"
19
Patrick Williams213cb262021-08-07 19:21:33 -050020do_configure:prepend () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050021 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
Patrick Williams213cb262021-08-07 19:21:33 -050043ALTERNATIVE:${PN} = "grep egrep fgrep"
Andrew Geissler82c905d2020-04-13 13:39:40 -050044ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
45ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
46ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060047
48BBCLASSEXTEND = "nativesdk"