summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/grep
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/grep')
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/Makevars25
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch13
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch17
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/gettext.patch15
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch32
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch52
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch55
-rw-r--r--meta/recipes-extended/grep/grep_2.18.bb38
-rw-r--r--meta/recipes-extended/grep/grep_2.5.1a.bb49
9 files changed, 296 insertions, 0 deletions
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/Makevars b/meta/recipes-extended/grep/grep-2.5.1a/Makevars
new file mode 100644
index 0000000000..8b09f53b0f
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/Makevars
@@ -0,0 +1,25 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER = Free Software Foundation, Inc.
22
23# This is the list of locale categories, beyond LC_MESSAGES, for which the
24# message catalogs shall be used. It is usually empty.
25EXTRA_LOCALE_CATEGORIES =
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch b/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
new file mode 100644
index 0000000000..02dbd2031d
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
@@ -0,0 +1,13 @@
1Index: grep-2.5.1a/doc/grep.texi
2===================================================================
3--- grep-2.5.1a.orig/doc/grep.texi
4+++ grep-2.5.1a/doc/grep.texi
5@@ -288,7 +288,7 @@ This version number should be included i
6 Print a usage message briefly summarizing these command-line options
7 and the bug-reporting address, then exit.
8
9-@itemx --binary-files=@var{type}
10+@item --binary-files=@var{type}
11 @opindex --binary-files
12 @cindex binary files
13 If the first few bytes of a file indicate that the file contains binary
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch b/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
new file mode 100644
index 0000000000..3b91520fb2
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
@@ -0,0 +1,17 @@
1Always use locale.h as HAVE_LOCALE_H is no longer handled by ./configure
2Upstream-Status: Inappropriate [ old version that will not be maintained ]
3Signed-off-by: Alex DAMIAN <alexandru.damian@intel.com>
4
5diff --recursive --unified grep-2.5.1a-orig/lib/hard-locale.c grep-2.5.1a/lib/hard-locale.c
6--- grep-2.5.1a-orig/lib/hard-locale.c 2001-03-04 07:33:12.000000000 +0200
7+++ grep-2.5.1a/lib/hard-locale.c 2013-03-11 17:05:52.086444891 +0200
8@@ -38,9 +38,7 @@
9 # endif
10 #endif
11
12-#if HAVE_LOCALE_H
13 # include <locale.h>
14-#endif
15
16 #if HAVE_STRING_H
17 # include <string.h>
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch b/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
new file mode 100644
index 0000000000..57463355a7
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
@@ -0,0 +1,15 @@
1Enable operation with later versions of gettext.
2
3Upstream-Status: Inappropriate
4RP 2012/10/19
5
6Index: grep-2.5.1a/configure.in
7===================================================================
8--- grep-2.5.1a.orig/configure.in 2012-10-19 12:57:51.646970204 +0000
9+++ grep-2.5.1a/configure.in 2012-10-19 12:59:49.946968803 +0000
10@@ -140,4 +140,4 @@
11 AC_CHECK_LIB(pcre, pcre_exec)
12 fi
13
14-AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
15+AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [echo timestamp > stamp-h])
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch b/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
new file mode 100644
index 0000000000..059d0687b3
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
@@ -0,0 +1,32 @@
1The patch to fix CVE-2012-5667
2Reference: https://bugzilla.redhat.com/attachment.cgi?id=686605&action=diff
3
4Multiple integer overflows in GNU Grep before 2.11 might allow
5context-dependent attackers to execute arbitrary code via vectors
6involving a long input line that triggers a heap-based buffer overflow.
7
8http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-5667
9
10Upstream-Status: Inappropriate [other]
11This version of GNU Grep has been abandoned upstream and they are no longer
12accepting patches. This is not a backport.
13
14Signed-off-by Ming Liu <ming.liu@windriver.com>
15---
16 grep.c | 7 +++----
17 1 file changed, 3 insertions(+), 4 deletions(-)
18
19--- a/src/grep.c 2013-05-15 13:39:33.359191769 +0800
20+++ a/src/grep.c 2013-05-15 13:50:22.609191882 +0800
21@@ -306,6 +306,11 @@ fillbuf (size_t save, struct stats const
22 int cc = 1;
23 char *readbuf;
24 size_t readsize;
25+ const size_t max_save = INT_MAX / 2;
26+
27+ /* Limit the amount of saved data to INT_MAX to fix CVE-2012-5667 */
28+ if (save > max_save)
29+ error (2, 0, _("line too long"));
30
31 /* Offset from start of buffer to start of old stuff
32 that we want to save. */
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch b/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
new file mode 100644
index 0000000000..3ccce5fc36
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
@@ -0,0 +1,52 @@
1Upstream-Status: Pending
2
3automake 1.12 has depricated automatic de-ANSI-fication support
4
5this patch avoids these kinds of errors:
6
7| configure.in:33: error: automatic de-ANSI-fication support has been removed
8| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
9| configure.in:33: the top level
10| autom4te: m4 failed with exit status: 1
11...
12| lib/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
13| src/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
14| autoreconf: automake failed with exit status: 1
15
16Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
172012/05/04
18
19Index: grep-2.5.1a/configure.in
20===================================================================
21--- grep-2.5.1a.orig/configure.in
22+++ grep-2.5.1a/configure.in
23@@ -30,7 +30,6 @@ AC_PROG_RANLIB
24
25 dnl Checks for typedefs, structures, and compiler characteristics.
26 AC_SYS_LARGEFILE
27-AM_C_PROTOTYPES
28 AC_TYPE_SIZE_T
29 AC_CHECK_TYPE(ssize_t, int)
30 AC_C_CONST
31Index: grep-2.5.1a/lib/Makefile.am
32===================================================================
33--- grep-2.5.1a.orig/lib/Makefile.am
34+++ grep-2.5.1a/lib/Makefile.am
35@@ -1,5 +1,5 @@
36 #
37-AUTOMAKE_OPTIONS = ../src/ansi2knr
38+AUTOMAKE_OPTIONS =
39
40 SUBDIRS = posix
41
42Index: grep-2.5.1a/src/Makefile.am
43===================================================================
44--- grep-2.5.1a.orig/src/Makefile.am
45+++ grep-2.5.1a/src/Makefile.am
46@@ -1,5 +1,5 @@
47 ## Process this file with automake to create Makefile.in
48-AUTOMAKE_OPTIONS = ansi2knr no-dependencies
49+AUTOMAKE_OPTIONS = no-dependencies
50
51 LN = ln
52
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
new file mode 100644
index 0000000000..de054fc755
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
@@ -0,0 +1,55 @@
1Upstream-Status: Inappropriate [licensing]
2
3# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
4# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
5# mempcpy, we'll just use that instead.
6# Patch source: OpenEmbedded
7
8Index: grep-2.5.1/intl/localealias.c
9===================================================================
10--- grep-2.5.1.orig/intl/localealias.c 2002-03-14 00:39:06.000000000 +1100
11+++ grep-2.5.1/intl/localealias.c 2007-05-17 13:53:58.000000000 +1000
12@@ -65,7 +65,7 @@
13 # define strcasecmp __strcasecmp
14
15 # ifndef mempcpy
16-# define mempcpy __mempcpy
17+# error "mempcpy not detected"
18 # endif
19 # define HAVE_MEMPCPY 1
20 # define HAVE___FSETLOCKING 1
21Index: grep-2.5.1/lib/getopt.c
22===================================================================
23--- grep-2.5.1.orig/lib/getopt.c 2001-03-04 16:33:12.000000000 +1100
24+++ grep-2.5.1/lib/getopt.c 2007-05-17 13:51:44.000000000 +1000
25@@ -326,7 +326,7 @@
26 nonoption_flags_len = nonoption_flags_max_len = 0;
27 else
28 {
29- memset (__mempcpy (new_str, __getopt_nonoption_flags,
30+ memset (mempcpy (new_str, __getopt_nonoption_flags,
31 nonoption_flags_max_len),
32 '\0', top + 1 - nonoption_flags_max_len);
33 nonoption_flags_max_len = top + 1;
34@@ -437,7 +437,7 @@
35 if (__getopt_nonoption_flags == NULL)
36 nonoption_flags_max_len = -1;
37 else
38- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
39+ memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
40 '\0', nonoption_flags_max_len - len);
41 }
42 }
43Index: grep-2.5.1/lib/regex.c
44===================================================================
45--- grep-2.5.1.orig/lib/regex.c 2001-04-03 04:04:45.000000000 +1000
46+++ grep-2.5.1/lib/regex.c 2007-05-17 13:51:48.000000000 +1000
47@@ -7842,7 +7842,7 @@
48 if (msg_size > errbuf_size)
49 {
50 #if defined HAVE_MEMPCPY || defined _LIBC
51- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
52+ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
53 #else
54 memcpy (errbuf, msg, errbuf_size - 1);
55 errbuf[errbuf_size - 1] = 0;
diff --git a/meta/recipes-extended/grep/grep_2.18.bb b/meta/recipes-extended/grep/grep_2.18.bb
new file mode 100644
index 0000000000..5ffeaf0d99
--- /dev/null
+++ b/meta/recipes-extended/grep/grep_2.18.bb
@@ -0,0 +1,38 @@
1SUMMARY = "GNU grep utility"
2HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
3BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
4SECTION = "console/utils"
5LICENSE = "GPLv3"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
7
8SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz"
9
10SRC_URI[md5sum] = "7439f8266f50844b56cc3e2721606541"
11SRC_URI[sha256sum] = "e6436e5077fa1497feccc8feaabd3f507b172369bf120fbc9e4874bba81be720"
12
13inherit autotools gettext
14
15EXTRA_OECONF = "--disable-perl-regexp"
16
17do_configure_prepend () {
18 rm -f ${S}/m4/init.m4
19}
20
21do_install () {
22 autotools_do_install
23 install -d ${D}${base_bindir}
24 mv ${D}${bindir}/grep ${D}${base_bindir}/grep
25 mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
26 mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
27 rmdir ${D}${bindir}/
28}
29
30inherit update-alternatives
31
32ALTERNATIVE_PRIORITY = "100"
33
34ALTERNATIVE_${PN} = "grep egrep fgrep"
35ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
36ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
37ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
38
diff --git a/meta/recipes-extended/grep/grep_2.5.1a.bb b/meta/recipes-extended/grep/grep_2.5.1a.bb
new file mode 100644
index 0000000000..088959c9ca
--- /dev/null
+++ b/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Pattern matching utilities"
2DESCRIPTION = "The GNU versions of commonly used grep utilities. The grep command searches one or more input \
3files for lines containing a match to a specified pattern."
4SECTION = "console/utils"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
7
8PR = "r2"
9
10SRC_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 "
19
20SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
21SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
22
23inherit autotools gettext
24
25EXTRA_OECONF = "--disable-perl-regexp --disable-ncurses"
26
27CFLAGS += "-D PROTOTYPES"
28do_configure_prepend () {
29 rm -f ${S}/m4/init.m4
30 cp -f ${WORKDIR}/Makevars ${S}/po/
31}
32
33do_install () {
34 autotools_do_install
35 install -d ${D}${base_bindir}
36 mv ${D}${bindir}/grep ${D}${base_bindir}/grep
37 mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
38 mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
39 rmdir ${D}${bindir}/
40}
41
42inherit update-alternatives
43
44ALTERNATIVE_PRIORITY = "100"
45
46ALTERNATIVE_${PN} = "grep egrep fgrep"
47ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
48ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
49ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"