| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | SUMMARY = "Pattern matching utilities" | 
 | 2 | DESCRIPTION = "The GNU versions of commonly used grep utilities.  The grep command searches one or more input \ | 
 | 3 | files for lines containing a match to a specified pattern." | 
 | 4 | SECTION = "console/utils" | 
 | 5 | LICENSE = "GPLv2" | 
 | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | 
 | 7 |  | 
 | 8 | PR = "r2" | 
 | 9 |  | 
 | 10 | SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \ | 
 | 11 |            file://uclibc-fix.patch \ | 
 | 12 |            file://grep_fix_for_automake-1.12.patch \ | 
 | 13 |            file://gettext.patch \ | 
 | 14 |            file://fix64-int-to-pointer.patch \ | 
 | 15 |            file://Makevars \ | 
 | 16 |            file://grep-CVE-2012-5667.patch \ | 
 | 17 |            file://fix-for-texinfo-5.1.patch \ | 
 | 18 |            file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \ | 
 | 19 |            file://search-fix-compilation-error-with-security-flags-ena.patch \ | 
 | 20 |           " | 
 | 21 |  | 
 | 22 | SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c" | 
 | 23 | SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132" | 
 | 24 |  | 
 | 25 | inherit autotools gettext texinfo | 
 | 26 |  | 
 | 27 | EXTRA_OECONF_INCLUDED_REGEX = "--without-included-regex" | 
 | 28 | EXTRA_OECONF_INCLUDED_REGEX_libc-musl = "--with-included-regex" | 
 | 29 |  | 
 | 30 | EXTRA_OECONF = "--disable-perl-regexp \ | 
 | 31 |                 ${EXTRA_OECONF_INCLUDED_REGEX}" | 
 | 32 |  | 
 | 33 | CFLAGS += "-D PROTOTYPES" | 
 | 34 | do_configure_prepend () { | 
 | 35 | 	rm -f ${S}/m4/init.m4 | 
 | 36 | 	cp -f ${WORKDIR}/Makevars ${S}/po/ | 
 | 37 | } | 
 | 38 |  | 
 | 39 | do_install () { | 
 | 40 | 	autotools_do_install | 
 | 41 |         if [ "${base_bindir}" != "${bindir}" ]; then | 
 | 42 |         	install -d ${D}${base_bindir} | 
 | 43 | 	        mv ${D}${bindir}/grep ${D}${base_bindir}/grep | 
 | 44 | 	        mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep | 
 | 45 | 	        mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep | 
 | 46 | 	        rmdir ${D}${bindir}/ | 
 | 47 |         fi | 
 | 48 | } | 
 | 49 |  | 
 | 50 | inherit update-alternatives | 
 | 51 |  | 
 | 52 | ALTERNATIVE_PRIORITY = "100" | 
 | 53 |  | 
 | 54 | ALTERNATIVE_${PN} = "grep egrep fgrep" | 
 | 55 | ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep" | 
 | 56 | ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep" | 
 | 57 | ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep" | 
 | 58 |  | 
 | 59 | export CONFIG_SHELL="/bin/sh" |