diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-devtools/rpm | |
download | poky-c527fd1f14c27855a37f2e8ac5346ce8d940ced2.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/rpm')
47 files changed, 3153 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/meta/recipes-devtools/rpm/rpm/dbconvert.patch new file mode 100644 index 0000000000..27dba8c960 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/dbconvert.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | Upstream-Status: Not applicable | ||
2 | |||
3 | Hack to prevent unneeded demo app from building on older libc | ||
4 | where it will break the build | ||
5 | |||
6 | Index: rpm-5.4.9/tools/Makefile.am | ||
7 | =================================================================== | ||
8 | --- rpm-5.4.9.orig/tools/Makefile.am | ||
9 | +++ rpm-5.4.9/tools/Makefile.am | ||
10 | @@ -24,7 +24,7 @@ AM_CFLAGS = $(OPENMP_CFLAGS) | ||
11 | |||
12 | EXTRA_DIST = hashtab.h bsdiff.1 bspatch.1 dotgraph.hh | ||
13 | |||
14 | -EXTRA_PROGRAMS = augtool cudftool dbconvert debugedit \ | ||
15 | +EXTRA_PROGRAMS = augtool cudftool debugedit \ | ||
16 | nix-build nix-channel nix-collect-garbage nix-copy-closure \ | ||
17 | nix-env nix-hash nix-install-package nix-instantiate \ | ||
18 | nix-log2xml nix-prefetch-url nix-pull nix-push nix-store nix-worker \ | ||
19 | @@ -60,7 +60,7 @@ pkgbin_PROGRAMS = \ | ||
20 | rpmcache rpmdigest rpmrepo rpmspecdump \ | ||
21 | rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ | ||
22 | if WITH_DB | ||
23 | -pkgbin_PROGRAMS += dbconvert | ||
24 | +pkgbin_PROGRAMS += | ||
25 | endif | ||
26 | dist_man_MANS = rpmgrep.1 | ||
27 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch new file mode 100644 index 0000000000..74efe6570c --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | During the recalculation of the buildid, it's necessary to change the word | ||
2 | back to the original endian. However, if we do this in-place, we've also | ||
3 | affected the headers that we're also working on. The side effect of this is | ||
4 | we can no longer rely on 'sh_type' as it may have been changed. | ||
5 | |||
6 | This patch ensures that any time we translate the loaded data to the machine | ||
7 | format, we only do it in a backup copy and never the original copy. | ||
8 | |||
9 | Note: in all other places a backup copy was used, just not buildid processing. | ||
10 | |||
11 | Also the process (...) function was modified to verify the data is not | ||
12 | NULL as well. This is an extra check and is not strictly necessary. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
17 | |||
18 | Index: rpm-5.4.9/tools/debugedit.c | ||
19 | =================================================================== | ||
20 | --- rpm-5.4.9.orig/tools/debugedit.c | ||
21 | +++ rpm-5.4.9/tools/debugedit.c | ||
22 | @@ -1432,21 +1432,24 @@ handle_build_id (DSO *dso, Elf_Data *bui | ||
23 | auto inline void process (const void *data, size_t size) | ||
24 | { | ||
25 | memchunk chunk = { .data = (void *) data, .size = size }; | ||
26 | - hashFunctionContextUpdateMC (&ctx, &chunk); | ||
27 | + if (data != NULL && size != 0) | ||
28 | + hashFunctionContextUpdateMC (&ctx, &chunk); | ||
29 | } | ||
30 | union | ||
31 | { | ||
32 | GElf_Ehdr ehdr; | ||
33 | GElf_Phdr phdr; | ||
34 | GElf_Shdr shdr; | ||
35 | - } u; | ||
36 | - Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u }; | ||
37 | - | ||
38 | - x.d_type = ELF_T_EHDR; | ||
39 | - x.d_size = sizeof u.ehdr; | ||
40 | - u.ehdr = dso->ehdr; | ||
41 | - u.ehdr.e_phoff = u.ehdr.e_shoff = 0; | ||
42 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
43 | + } u1, u2; | ||
44 | + Elf_Data src = { .d_version = EV_CURRENT, .d_buf = &u1 }; | ||
45 | + Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 }; | ||
46 | + | ||
47 | + src.d_type = ELF_T_EHDR; | ||
48 | + src.d_size = sizeof u1.ehdr; | ||
49 | + dest.d_size = sizeof u2.ehdr; | ||
50 | + u1.ehdr = dso->ehdr; | ||
51 | + u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0; | ||
52 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
53 | { | ||
54 | bad: | ||
55 | fprintf (stderr, "Failed to compute header checksum: %s\n", | ||
56 | @@ -1454,29 +1457,31 @@ handle_build_id (DSO *dso, Elf_Data *bui | ||
57 | exit (1); | ||
58 | } | ||
59 | |||
60 | - x.d_type = ELF_T_PHDR; | ||
61 | - x.d_size = sizeof u.phdr; | ||
62 | + src.d_type = ELF_T_PHDR; | ||
63 | + src.d_size = sizeof u1.phdr; | ||
64 | + dest.d_size = sizeof u2.phdr; | ||
65 | for (i = 0; i < dso->ehdr.e_phnum; ++i) | ||
66 | { | ||
67 | - if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL) | ||
68 | + if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL) | ||
69 | goto bad; | ||
70 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
71 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
72 | goto bad; | ||
73 | - process (x.d_buf, x.d_size); | ||
74 | + process (dest.d_buf, dest.d_size); | ||
75 | } | ||
76 | |||
77 | - x.d_type = ELF_T_SHDR; | ||
78 | - x.d_size = sizeof u.shdr; | ||
79 | + src.d_type = ELF_T_SHDR; | ||
80 | + src.d_size = sizeof u1.shdr; | ||
81 | + dest.d_size = sizeof u2.shdr; | ||
82 | for (i = 0; i < dso->ehdr.e_shnum; ++i) | ||
83 | if (dso->scn[i] != NULL) | ||
84 | { | ||
85 | - u.shdr = dso->shdr[i]; | ||
86 | - u.shdr.sh_offset = 0; | ||
87 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
88 | + u1.shdr = dso->shdr[i]; | ||
89 | + u1.shdr.sh_offset = 0; | ||
90 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
91 | goto bad; | ||
92 | - process (x.d_buf, x.d_size); | ||
93 | + process (dest.d_buf, dest.d_size); | ||
94 | |||
95 | - if (u.shdr.sh_type != SHT_NOBITS) | ||
96 | + if (u1.shdr.sh_type != SHT_NOBITS) | ||
97 | { | ||
98 | Elf_Data *d = elf_rawdata (dso->scn[i], NULL); | ||
99 | if (d == NULL) | ||
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch new file mode 100644 index 0000000000..2696cd3168 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | debugedit: fix segment fault while file's bss offset have a large number | ||
2 | |||
3 | While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file | ||
4 | into memory. While the file's bss Offset has a large number, elf_update | ||
5 | caculated file size by __elf64_updatenull_wrlock and the size was | ||
6 | enlarged. | ||
7 | |||
8 | In this situation, elf_update invoked ftruncate to enlarge the file, | ||
9 | and memory size (elf->maximum_size) also was incorrectly updated. | ||
10 | There was segment fault in elf_end which invoked munmap with the | ||
11 | length is the enlarged file size, not the mmap's length. | ||
12 | |||
13 | Before the above operations, invoke elf_begin/elf_update/elf_end | ||
14 | with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it | ||
15 | could make sure the file is safe for the following elf operations. | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
19 | --- | ||
20 | tools/debugedit.c | 25 +++++++++++++++++++++++++ | ||
21 | 1 file changed, 25 insertions(+) | ||
22 | |||
23 | diff --git a/tools/debugedit.c b/tools/debugedit.c | ||
24 | --- a/tools/debugedit.c | ||
25 | +++ b/tools/debugedit.c | ||
26 | @@ -1512,6 +1512,28 @@ handle_build_id (DSO *dso, Elf_Data *build_id, | ||
27 | } | ||
28 | } | ||
29 | |||
30 | +/* It avoided the segment fault while file's bss offset have a large number. | ||
31 | + See https://bugzilla.redhat.com/show_bug.cgi?id=1019707 | ||
32 | + https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */ | ||
33 | +void valid_file(int fd) | ||
34 | +{ | ||
35 | + Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL); | ||
36 | + if (elf == NULL) | ||
37 | + { | ||
38 | + error (1, 0, "elf_begin: %s", elf_errmsg (-1)); | ||
39 | + return; | ||
40 | + } | ||
41 | + | ||
42 | + elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT); | ||
43 | + | ||
44 | + if (elf_update (elf, ELF_C_WRITE) < 0) | ||
45 | + error (1, 0, "elf_update: %s", elf_errmsg (-1)); | ||
46 | + | ||
47 | + elf_end (elf); | ||
48 | + | ||
49 | + return; | ||
50 | +} | ||
51 | + | ||
52 | int | ||
53 | main (int argc, char *argv[]) | ||
54 | { | ||
55 | @@ -1608,6 +1630,9 @@ main (int argc, char *argv[]) | ||
56 | exit (1); | ||
57 | } | ||
58 | |||
59 | + /* Make sure the file is valid. */ | ||
60 | + valid_file(fd); | ||
61 | + | ||
62 | dso = fdopen_dso (fd, file); | ||
63 | if (dso == NULL) | ||
64 | exit (1); | ||
65 | -- | ||
66 | 1.8.1.2 | ||
67 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch new file mode 100644 index 0000000000..0474c65a89 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Some options checked in this loop are needing linking to find out | ||
2 | if the option can be used or not e.g. -fstack-protector which needs | ||
3 | libssp to be staged and available for compiler to link against | ||
4 | Therefore we change the compile only check to compile and link check | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Index: rpm-5.4.0/configure.ac | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.0.orig/configure.ac 2012-06-01 11:41:19.741480143 -0700 | ||
12 | +++ rpm-5.4.0/configure.ac 2012-06-01 11:41:51.773481676 -0700 | ||
13 | @@ -193,7 +193,7 @@ | ||
14 | my_save_cflags="$CFLAGS" | ||
15 | CFLAGS=$c | ||
16 | AC_MSG_CHECKING([whether GCC supports $c]) | ||
17 | - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
18 | + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], | ||
19 | [AC_MSG_RESULT([yes])] | ||
20 | [my_cflags=$c], | ||
21 | [AC_MSG_RESULT([no])] | ||
diff --git a/meta/recipes-devtools/rpm/rpm/header-include-fix.patch b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch new file mode 100644 index 0000000000..6aa072d7c8 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h | ||
4 | index 0e1bdd7..8b522bb 100644 | ||
5 | --- a/rpmdb/rpmdb.h | ||
6 | +++ b/rpmdb/rpmdb.h | ||
7 | @@ -9,6 +9,7 @@ | ||
8 | |||
9 | #include <assert.h> | ||
10 | #include <mire.h> | ||
11 | +#include <errno.h> | ||
12 | |||
13 | #include <rpmtypes.h> | ||
14 | #include <rpmtag.h> /* XXX Header typedef */ | ||
15 | diff --git a/rpmdb/rpmtag.h b/rpmdb/rpmtag.h | ||
16 | index 8af6480..2166b4c 100644 | ||
17 | --- a/rpmdb/rpmtag.h | ||
18 | +++ b/rpmdb/rpmtag.h | ||
19 | @@ -7,6 +7,7 @@ | ||
20 | |||
21 | #include <rpmiotypes.h> | ||
22 | #include <rpmsw.h> | ||
23 | +#include <stdint.h> | ||
24 | |||
25 | #ifdef __cplusplus | ||
26 | extern "C" { | ||
diff --git a/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch new file mode 100644 index 0000000000..12f85b7fc9 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | rpm: Resolve parallel install issue when installing lua | ||
2 | |||
3 | When lua is being installed on some systems that are being run with high levels | ||
4 | of parallelization there are cases where install-data-am and install-exec-hook | ||
5 | are processed at the same or a very short time apart. This causes | ||
6 | install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the | ||
7 | same time This sometimes causes file contention and will sometimes be in a state | ||
8 | where install-exec-hook is looking for a file that is being installed or both | ||
9 | install-pkgbinPROGRAMS being run are installing the same file and fail because | ||
10 | it cannon create a new file. | ||
11 | |||
12 | This patch allows install-exec-hook to be called by install-data-am instead of | ||
13 | install-exec-am. It also removed the dependency in install-data-hook on | ||
14 | install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once | ||
15 | so there whould be any file contention. | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Morgan Little <morgan.little@windriver.com> | ||
20 | |||
21 | --- a/lua/Makefile.am.orig | ||
22 | +++ b/lua/Makefile.am | ||
23 | @@ -320,7 +320,7 @@ | ||
24 | # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. | ||
25 | # XXX CVS has lua/luac sub-directories in the Attic that collide with the | ||
26 | # XXX lua/luac executable names when using cvs update. | ||
27 | -install-exec-hook: install-pkgbinPROGRAMS | ||
28 | +install-data-hook: | ||
29 | mkdir -p $(DESTDIR)$(pkgbindir) | ||
30 | $(__RM) -f $(DESTDIR)$(pkgbindir)/lua | ||
31 | $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua | ||
diff --git a/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh new file mode 100755 index 0000000000..b72c9f0265 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | : ${RPMDEPS:=rpmdeps} | ||
4 | |||
5 | process() { | ||
6 | while read file_name ; do | ||
7 | printf "%s\t" ${file_name} | ||
8 | if [ ! -d $file_name ]; then | ||
9 | printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g') | ||
10 | fi | ||
11 | printf "\n" | ||
12 | done | ||
13 | } | ||
14 | |||
15 | usage() { | ||
16 | echo "$0 {-P|--provides} {-R|--requires} FILE ..." | ||
17 | } | ||
18 | |||
19 | while [ $# -gt 0 ]; do | ||
20 | case "$1" in | ||
21 | --rpmdeps) | ||
22 | RPMDEPS=$2 | ||
23 | shift | ||
24 | shift | ||
25 | ;; | ||
26 | -R|--requires) | ||
27 | process_type=--requires | ||
28 | shift | ||
29 | ;; | ||
30 | -P|--provides) | ||
31 | process_type=--provides | ||
32 | shift | ||
33 | ;; | ||
34 | *) | ||
35 | break; | ||
36 | ;; | ||
37 | esac | ||
38 | done | ||
39 | |||
40 | if [ -z "$process_type" ]; then | ||
41 | usage | ||
42 | exit 1 | ||
43 | fi | ||
44 | |||
45 | if [ $# -gt 0 ]; then | ||
46 | find "$@" | process $process_type | ||
47 | exit $? | ||
48 | fi | ||
49 | |||
50 | process $process_type | ||
diff --git a/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch new file mode 100644 index 0000000000..c1fab3e1a0 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | rpmmodule.c: Export a few additional RPMSENSE values | ||
2 | |||
3 | We want to see the RPMSENSE_SCRIPT values for use with SMART. We also | ||
4 | want to see the MISSINGOK value so we can avoid recommended packages causing | ||
5 | failures. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | Index: rpm-5.4.9/python/rpmmodule.c | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.9.orig/python/rpmmodule.c | ||
14 | +++ rpm-5.4.9/python/rpmmodule.c | ||
15 | @@ -494,12 +494,16 @@ void init_rpm(void) | ||
16 | REGISTER_ENUM(RPMSENSE_EQUAL); | ||
17 | REGISTER_ENUM(RPMSENSE_NOTEQUAL); | ||
18 | REGISTER_ENUM(RPMSENSE_FIND_REQUIRES); | ||
19 | -#if defined(RPM_VENDOR_MANDRIVA) | ||
20 | +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
21 | REGISTER_ENUM(RPMSENSE_PREREQ); | ||
22 | REGISTER_ENUM(RPMSENSE_SCRIPT_PRE); | ||
23 | REGISTER_ENUM(RPMSENSE_SCRIPT_POST); | ||
24 | REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN); | ||
25 | - REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN) | ||
26 | + REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN); | ||
27 | +#endif | ||
28 | + | ||
29 | +#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
30 | + REGISTER_ENUM(RPMSENSE_MISSINGOK); | ||
31 | #endif | ||
32 | |||
33 | REGISTER_ENUM(RPMDEPS_FLAG_NOUPGRADE); | ||
diff --git a/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/meta/recipes-devtools/rpm/rpm/pythondeps.sh new file mode 100755 index 0000000000..083b174f17 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/pythondeps.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ $# -ge 1 ] || { | ||
4 | cat > /dev/null | ||
5 | exit 0 | ||
6 | } | ||
7 | |||
8 | case $1 in | ||
9 | -R|--requires) | ||
10 | shift | ||
11 | grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python" | ||
12 | exit 0 | ||
13 | ;; | ||
14 | esac | ||
15 | |||
16 | exit 0 | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch new file mode 100644 index 0000000000..5129833381 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Remove the sanity checking from the rpm autogen.sh. This is required because | ||
2 | we may have slightly different, but yet compatible versions. If we do end | ||
3 | up breaking things, we'll deal with it at that time. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | Index: rpm-5.4.8/syck/autogen.sh | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.8.orig/syck/autogen.sh | ||
12 | +++ rpm-5.4.8/syck/autogen.sh | ||
13 | @@ -34,12 +34,6 @@ libtoolize () { | ||
14 | eval $_libtoolize $_libtoolize_args | ||
15 | } | ||
16 | |||
17 | -# requirements sanity check | ||
18 | -[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1 | ||
19 | -[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1 | ||
20 | -[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1 | ||
21 | -[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1 | ||
22 | - | ||
23 | echo "---> generate files via GNU libtool (libtoolize)" | ||
24 | libtoolize --quiet --copy --force --install | ||
25 | echo "---> generate files via GNU autoconf (aclocal, autoheader)" | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch new file mode 100644 index 0000000000..3aac1164d6 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | |||
@@ -0,0 +1,136 @@ | |||
1 | lib/rpmrc.c: Update --target processing to support full GNU canonical arch | ||
2 | |||
3 | Prior to this patch, when using --target, RPM supported the format: | ||
4 | <arch> | ||
5 | <arch>-<os> | ||
6 | <arch>-<os>-gnu | ||
7 | <arch>-<arbitrary items>-<os> | ||
8 | <arch>-<arbitrary items>-<os>-gnu | ||
9 | |||
10 | This patch changes the list of supported items to: | ||
11 | <arch> | ||
12 | <arch>-<os> | ||
13 | <arch>-<os>-gnu | ||
14 | <arch>-<vendor>-<os> | ||
15 | <arch>-<vendor>-<os>-<extension> | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
20 | |||
21 | Index: rpm-5.4.0/lib/rpmrc.c | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.0.orig/lib/rpmrc.c 2011-08-10 17:04:35.798814821 -0500 | ||
24 | +++ rpm-5.4.0/lib/rpmrc.c 2011-08-10 17:33:51.505871895 -0500 | ||
25 | @@ -916,8 +916,8 @@ | ||
26 | |||
27 | static void rpmRebuildTargetVars(const char ** target, const char ** canontarget) | ||
28 | { | ||
29 | - | ||
30 | - char *ca = NULL, *co = NULL, *ct = NULL; | ||
31 | + /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */ | ||
32 | + char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL; | ||
33 | int x; | ||
34 | |||
35 | /* Rebuild the compat table to recalculate the current target arch. */ | ||
36 | @@ -927,23 +927,60 @@ | ||
37 | rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); | ||
38 | |||
39 | if (target && *target) { | ||
40 | + /* GNU canonical format is: | ||
41 | + * <arch>-<vendor>-<os>[-extension] | ||
42 | + * | ||
43 | + * We support the both the GNU canonical format | ||
44 | + * as well as the traditional RPM formats: | ||
45 | + * <arch> | ||
46 | + * <arch>-<os>[-gnu] | ||
47 | + */ | ||
48 | char *c; | ||
49 | /* Set arch and os from specified build target */ | ||
50 | ca = xstrdup(*target); | ||
51 | - if ((c = strchr(ca, '-')) != NULL) { | ||
52 | + if ((c = strchr(ca, '-')) == NULL) { | ||
53 | + /* Format is <arch> */ | ||
54 | + ; | ||
55 | + } else { | ||
56 | *c++ = '\0'; | ||
57 | - | ||
58 | - if ((co = strrchr(c, '-')) == NULL) { | ||
59 | - co = c; | ||
60 | + cv = c; | ||
61 | + | ||
62 | + if ((c = strchr(c, '-')) == NULL) { | ||
63 | + /* Format is <arch>-<os> */ | ||
64 | + co = cv; | ||
65 | + cv = NULL; | ||
66 | } else { | ||
67 | - if (!xstrcasecmp(co, "-gnu")) | ||
68 | - *co = '\0'; | ||
69 | - if ((co = strrchr(c, '-')) == NULL) | ||
70 | - co = c; | ||
71 | - else | ||
72 | - co++; | ||
73 | + *c++ = '\0'; | ||
74 | + co = c; | ||
75 | + | ||
76 | + if ((c = strchr(c, '-')) == NULL) { | ||
77 | + /* Might be: | ||
78 | + * <arch>-<vendor>-<os> | ||
79 | + * <arch>-<os>-gnu | ||
80 | + */ | ||
81 | + if (!xstrcasecmp(co, "gnu")) { | ||
82 | + /* Format was <arch>-<os>-gnu */ | ||
83 | + ce = co; | ||
84 | + co = cv; | ||
85 | + cv = NULL; | ||
86 | + } | ||
87 | + } else { | ||
88 | + /* Format was <arch>-<vendor>-<os>-<extension> */ | ||
89 | + *c++ = '\0'; | ||
90 | + ce = c; | ||
91 | + } | ||
92 | } | ||
93 | + if (cv != NULL) cv = xstrdup(cv); | ||
94 | if (co != NULL) co = xstrdup(co); | ||
95 | + if (ce != NULL) { | ||
96 | + /* We need to prefix it with a "-" */ | ||
97 | + char * lce = NULL; | ||
98 | + | ||
99 | + lce = xmalloc(strlen(ce) + sizeof("-")); | ||
100 | + sprintf(lce, "-%s", ce); | ||
101 | + | ||
102 | + ce = lce; | ||
103 | + } | ||
104 | } | ||
105 | } else { | ||
106 | const char *a = NULL; | ||
107 | @@ -988,8 +1025,16 @@ | ||
108 | addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC); | ||
109 | delMacro(NULL, "_target_cpu"); | ||
110 | addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC); | ||
111 | + if (cv) { | ||
112 | + delMacro(NULL, "_target_vendor"); | ||
113 | + addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC); | ||
114 | + } | ||
115 | delMacro(NULL, "_target_os"); | ||
116 | addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC); | ||
117 | + if (ce) { | ||
118 | + delMacro(NULL, "_gnu"); | ||
119 | + addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC); | ||
120 | + } | ||
121 | |||
122 | if (canontarget) | ||
123 | *canontarget = ct; | ||
124 | @@ -997,8 +1041,12 @@ | ||
125 | ct = _free(ct); | ||
126 | ca = _free(ca); | ||
127 | /*@-usereleased@*/ | ||
128 | + cv = _free(cv); | ||
129 | + /*@-usereleased@*/ | ||
130 | co = _free(co); | ||
131 | /*@=usereleased@*/ | ||
132 | + ce = _free(ce); | ||
133 | + /*@-usereleased@*/ | ||
134 | } | ||
135 | |||
136 | void rpmFreeRpmrc(void) | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch new file mode 100644 index 0000000000..d9b4e33fdd --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Change cache size to reduce the usage of disk space from 62MB to 26MB. | ||
4 | |||
5 | Signed-off-by: Mei Lei <lei.mei@intel.com> | ||
6 | |||
7 | Index: rpm-5.4.8/rpmdb/DB_CONFIG.in | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.8.orig/rpmdb/DB_CONFIG.in | ||
10 | +++ rpm-5.4.8/rpmdb/DB_CONFIG.in | ||
11 | @@ -29,7 +29,7 @@ set_thread_count 64 | ||
12 | |||
13 | # ================ Memory Pool | ||
14 | #XXX initializing dbenv with set_cachesize has unimplemented prerequsites | ||
15 | -#set_cachesize 0 1048576 0 | ||
16 | +set_cachesize 0 1048576 0 | ||
17 | set_mp_mmapsize 268435456 | ||
18 | |||
19 | # ================ Locking | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch new file mode 100644 index 0000000000..59022f4e63 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | In certain cases with BerkleyDB 5.3.x we are getting the error: | ||
2 | |||
3 | db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value | ||
4 | |||
5 | See https://bugs.launchpad.net/rpm/+bug/934420 for more information. | ||
6 | |||
7 | It appears to be some type of a bug in the BerkleyDB 5.3.x. In an attempt | ||
8 | to workaround the problem, when we encounter this situation we attempt | ||
9 | to adjust the size of the mmap buffer until the call works, or we | ||
10 | end up trying 10 times. The new size is either the updated vp->size | ||
11 | from the failed pget call, or the previous size + 1024. | ||
12 | |||
13 | If DBI debugging is enabled, additional diagnostics are printed, otherwise | ||
14 | a basic retry and success message is added to show that the failure was | ||
15 | resolved. | ||
16 | |||
17 | Upstream-Status: Inappropriate (workaround) | ||
18 | |||
19 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
20 | |||
21 | Index: rpm-5.4.9/rpmdb/rpmdb.c | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.9.orig/rpmdb/rpmdb.c | ||
24 | +++ rpm-5.4.9/rpmdb/rpmdb.c | ||
25 | @@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC * | ||
26 | vp->flags |= DB_DBT_USERMEM; | ||
27 | rc = dbiGet(dbi, dbcursor, kp, vp, flags); | ||
28 | if (rc == DB_BUFFER_SMALL) { | ||
29 | + int retry = 0; | ||
30 | + size_t origlen = vp->size; | ||
31 | size_t uhlen = vp->size; | ||
32 | - void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off); | ||
33 | + void * uh; | ||
34 | +retry_get: | ||
35 | + uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off); | ||
36 | if (uh == NULL || uh == (void *)-1) | ||
37 | fprintf(stderr, | ||
38 | "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n", | ||
39 | @@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC * | ||
40 | if (munmap(uh, uhlen) != 0) | ||
41 | fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n", | ||
42 | uh, (unsigned)uhlen, errno, strerror(errno)); | ||
43 | + /* We want to be sure to limit the number of retry attempts to avoid a loop! */ | ||
44 | + if (rc == DB_BUFFER_SMALL && retry < 10) { | ||
45 | + /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */ | ||
46 | + uhlen = vp->size > uhlen ? vp->size : uhlen + 1024; | ||
47 | + retry++; | ||
48 | + if ((dbi)->dbi_debug) | ||
49 | + fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n", | ||
50 | + origlen, vp->ulen, uhlen, vp->size); | ||
51 | + else | ||
52 | + fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen); | ||
53 | + goto retry_get; | ||
54 | + } | ||
55 | + } | ||
56 | + if (retry) { | ||
57 | + if ((dbi)->dbi_debug) | ||
58 | + fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n", | ||
59 | + origlen, vp->ulen, uhlen, vp->size); | ||
60 | + else | ||
61 | + fprintf(stderr, "==> success\n"); | ||
62 | } | ||
63 | } | ||
64 | } else | ||
65 | Index: rpm-5.4.9/rpmdb/db3.c | ||
66 | =================================================================== | ||
67 | --- rpm-5.4.9.orig/rpmdb/db3.c | ||
68 | +++ rpm-5.4.9/rpmdb/db3.c | ||
69 | @@ -1452,7 +1452,7 @@ assert(db != NULL); | ||
70 | #endif | ||
71 | } | ||
72 | |||
73 | -DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, data, NULL))); | ||
74 | +DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, rc == DB_BUFFER_SMALL ? NULL : data, NULL))); | ||
75 | return rc; | ||
76 | } | ||
77 | /*@=mustmod@*/ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch new file mode 100644 index 0000000000..25ebbdcbed --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | Debug the platform score generation... | ||
2 | |||
3 | Index: rpm-5.4.9/lib/rpmrc.c | ||
4 | =================================================================== | ||
5 | --- rpm-5.4.9.orig/lib/rpmrc.c | ||
6 | +++ rpm-5.4.9/lib/rpmrc.c | ||
7 | @@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl | ||
8 | |||
9 | rc = (rpmRC) rpmiobSlurp(platform, &iob); | ||
10 | |||
11 | + fprintf(stderr, "D: rpmPlatform file %s\n", platform); | ||
12 | + | ||
13 | if (rc || iob == NULL) { | ||
14 | rc = RPMRC_FAIL; | ||
15 | goto exit; | ||
16 | @@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl | ||
17 | while (--t > p && xisspace(*t)) | ||
18 | *t = '\0'; | ||
19 | if (t > p) { | ||
20 | + fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p); | ||
21 | xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre); | ||
22 | } | ||
23 | continue; | ||
24 | @@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl | ||
25 | _gnu = rpmExpand("-", cvog->gnu, NULL); | ||
26 | |||
27 | addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1); | ||
28 | + fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n", | ||
29 | + rpmExpand("%{_platform_cpu}", NULL), | ||
30 | + rpmExpand("%{_platform_vendor}", NULL), | ||
31 | + rpmExpand("%{_platform_os}", NULL), | ||
32 | + rpmExpand("%{_platform_gnu}", NULL)); | ||
33 | #else | ||
34 | addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); | ||
35 | addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); | ||
36 | @@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl | ||
37 | #endif | ||
38 | } | ||
39 | |||
40 | + fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p); | ||
41 | #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ | ||
42 | /* do not use vendor and GNU attribution */ | ||
43 | p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL); | ||
44 | @@ -518,6 +527,7 @@ static rpmRC rpmPlatform(const char * pl | ||
45 | (cvog && *cvog->gnu ? "-" : NULL), | ||
46 | (cvog ? cvog->gnu : NULL), NULL); | ||
47 | #endif | ||
48 | + fprintf(stderr, "%s\n", p); | ||
49 | xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre); | ||
50 | p = _free(p); | ||
51 | |||
52 | @@ -686,9 +696,12 @@ int rpmPlatformScore(const char * platfo | ||
53 | |||
54 | if ((mire = (miRE) mi_re) != NULL) | ||
55 | for (i = 0; i < mi_nre; i++) { | ||
56 | - if (mireRegexec(mire + i, platform, 0) >= 0) | ||
57 | + if (mireRegexec(mire + i, platform, 0) >= 0) { | ||
58 | + fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1); | ||
59 | return (i + 1); | ||
60 | + } | ||
61 | } | ||
62 | + fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0); | ||
63 | return 0; | ||
64 | } | ||
65 | /*@=onlytrans@*/ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch new file mode 100644 index 0000000000..1f948cd65a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | rpmfc.c: Always generate per-file information | ||
2 | |||
3 | Even when the per-file dependency generate is disabled, we want to generate | ||
4 | per file classification and other associated data. | ||
5 | |||
6 | Note: this is a temporary workaround. Eventually we will want to have a way | ||
7 | to seed per-file dependency and other information in order to generate a | ||
8 | package from previously determined information. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
13 | |||
14 | diff --git a/lib/rpmfc.c b/lib/rpmfc.c | ||
15 | index 0c3befd..9306999 100644 | ||
16 | --- a/lib/rpmfc.c | ||
17 | +++ b/lib/rpmfc.c | ||
18 | @@ -1692,7 +1692,6 @@ rpmRC rpmfcGenerateDepends(void * specp, void * pkgp) | ||
19 | /* ... then generate dependencies using %{__find_requires} et al. */ | ||
20 | rc = rpmfcGenerateDependsHelper(spec, pkg, fi); | ||
21 | printDeps(pkg->header); | ||
22 | - return rc; | ||
23 | } | ||
24 | |||
25 | /* Generate scriptlet Dependencies. */ | ||
26 | @@ -1720,8 +1719,8 @@ rpmRC rpmfcGenerateDepends(void * specp, void * pkgp) | ||
27 | av[ac] = NULL; | ||
28 | |||
29 | fc = rpmfcNew(); | ||
30 | - fc->skipProv = !pkg->autoProv; | ||
31 | - fc->skipReq = !pkg->autoReq; | ||
32 | + fc->skipProv = !pkg->autoProv || !internaldeps; | ||
33 | + fc->skipReq = !pkg->autoReq || !internaldeps; | ||
34 | fc->tracked = 0; | ||
35 | |||
36 | { const char * buildRootURL; | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch new file mode 100644 index 0000000000..b5ff2637c2 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | During installation, the libtool relink attempts to link to -lrpm... | ||
2 | The problem is that it hasn't been installed yet! So small change causes | ||
3 | the libtool to instead use the build version. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | --- rpm-5.4.0/lib/Makefile.am.orig | ||
10 | +++ rpm-5.4.0/lib/Makefile.am | ||
11 | @@ -90,6 +90,9 @@ | ||
12 | libsql_la_SOURCES = libsql.c | ||
13 | libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON) | ||
14 | |||
15 | +# pkglib libraries needs to have usrlib libraries already installed! | ||
16 | +install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES | ||
17 | + | ||
18 | install-data-hook: | ||
19 | if !ENABLE_BUILD_LAFILES | ||
20 | -for l in $(usrlib_LTLIBRARIES); do \ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch new file mode 100644 index 0000000000..4f484c426d --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | |||
2 | Upstream-Status: Inappropriate [configuration] | ||
3 | |||
4 | diff --git a/rpmdb/DB_CONFIG.in b/rpmdb/DB_CONFIG.in | ||
5 | index 8b94c94..e0b4689 100644 | ||
6 | --- a/rpmdb/DB_CONFIG.in | ||
7 | +++ b/rpmdb/DB_CONFIG.in | ||
8 | @@ -4,6 +4,7 @@ | ||
9 | set_create_dir . | ||
10 | set_lg_dir ./log | ||
11 | set_tmp_dir ./tmp | ||
12 | +set_flags db_log_autoremove on | ||
13 | |||
14 | # -- thread_count must be >= 8 | ||
15 | set_thread_count 64 | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch new file mode 100644 index 0000000000..7101e5cbda --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Enable platform tag matching workaround in OE. | ||
2 | |||
3 | When installing some LSB packages the 'platform' field in the package | ||
4 | appears to be invalid. Instead of relying solely on the platform comparison | ||
5 | we also want to generate a perceived platform based on the valid rpm contents | ||
6 | of arch and os. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
11 | |||
12 | Index: rpm-5.4.9/lib/depends.c | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.9.orig/lib/depends.c | ||
15 | +++ rpm-5.4.9/lib/depends.c | ||
16 | @@ -594,7 +594,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea | ||
17 | platform = rpmExpand(arch, "-unknown-", os, NULL); | ||
18 | |||
19 | rc = rpmPlatformScore(platform, platpat, nplatpat); | ||
20 | -#if defined(RPM_VENDOR_MANDRIVA) | ||
21 | +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) | ||
22 | /* | ||
23 | * If no match on platform tag, we'll try again with arch tag | ||
24 | * in case platform tag is inconsistent with it, which is the case | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lua.patch b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch new file mode 100644 index 0000000000..348a9198dd --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Add support for cross compiling lua | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | diff -ur rpm-5.4.9.orig/configure.ac rpm-5.4.9/configure.ac | ||
8 | --- rpm-5.4.9.orig/configure.ac 2012-05-16 12:16:36.589813548 -0500 | ||
9 | +++ rpm-5.4.9/configure.ac 2012-05-16 12:26:01.070813518 -0500 | ||
10 | @@ -120,6 +120,9 @@ | ||
11 | |||
12 | AC_PATH_PROG(AS, as, as) | ||
13 | |||
14 | +CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)} | ||
15 | +AC_SUBST(CC_FOR_BUILD) | ||
16 | + | ||
17 | dnl # GCC specifics | ||
18 | AC_PROG_GCC_TRADITIONAL | ||
19 | AC_ARG_ENABLE(build-pic, | ||
20 | diff -ur rpm-5.4.9.orig/lua/Makefile.am rpm-5.4.9/lua/Makefile.am | ||
21 | --- rpm-5.4.9.orig/lua/Makefile.am 2012-04-07 19:15:25.000000000 -0500 | ||
22 | +++ rpm-5.4.9/lua/Makefile.am 2012-05-16 12:26:19.556856688 -0500 | ||
23 | @@ -40,7 +40,7 @@ | ||
24 | |||
25 | # --- bin2c doesn't need anything but a compiler | ||
26 | bin2c$(EXEEXT): bin2c.c | ||
27 | - $(CC) -o $@ $< | ||
28 | + $(CC_FOR_BUILD) -o $@ $< | ||
29 | |||
30 | liblua_la_SOURCES = | ||
31 | liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch new file mode 100644 index 0000000000..c1516a422a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | macros/macros.in: Revert settings to the same as RPM 5.4.0 | ||
2 | |||
3 | Enable a reasonable set of rpmdeps dependency helper macros. These sets | ||
4 | were used by RPM 5.4.0. | ||
5 | |||
6 | Upstream-Status: Inappropriate [configuration] | ||
7 | |||
8 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
9 | |||
10 | diff -ur rpm-5.4.8.orig/macros/macros.in rpm-5.4.8/macros/macros.in | ||
11 | --- rpm-5.4.8.orig/macros/macros.in 2012-03-21 19:04:06.000000000 -0500 | ||
12 | +++ rpm-5.4.8/macros/macros.in 2012-06-07 17:02:53.903046624 -0500 | ||
13 | @@ -985,7 +985,7 @@ | ||
14 | |||
15 | #============================================================================== | ||
16 | # ---- rpmbuild macros. | ||
17 | -#%%{load:%{_usrlibrpm}/macros.rpmbuild} | ||
18 | +%{load:%{_usrlibrpm}/macros.rpmbuild} | ||
19 | |||
20 | #------------------------------------------------------------------------ | ||
21 | # cmake(...) configuration | ||
22 | @@ -997,15 +997,15 @@ | ||
23 | |||
24 | #------------------------------------------------------------------------ | ||
25 | # perl(...) configuration | ||
26 | -#%%{load:%{_usrlibrpm}/macros.d/perl} | ||
27 | +%{load:%{_usrlibrpm}/macros.d/perl} | ||
28 | |||
29 | #------------------------------------------------------------------------ | ||
30 | # python(...) configuration. | ||
31 | -#%%{load:%{_usrlibrpm}/macros.d/python} | ||
32 | +%{load:%{_usrlibrpm}/macros.d/python} | ||
33 | |||
34 | #------------------------------------------------------------------------ | ||
35 | # php(...) configuration. | ||
36 | -#%%{load:%{_usrlibrpm}/macros.d/php} | ||
37 | +%{load:%{_usrlibrpm}/macros.d/php} | ||
38 | |||
39 | #------------------------------------------------------------------------ | ||
40 | # java(...) configuration. | ||
41 | @@ -1013,11 +1013,11 @@ | ||
42 | |||
43 | #------------------------------------------------------------------------ | ||
44 | # libtool(...) configuration. | ||
45 | -#%%{load:%{_usrlibrpm}/macros.d/libtool} | ||
46 | +%{load:%{_usrlibrpm}/macros.d/libtool} | ||
47 | |||
48 | #------------------------------------------------------------------------ | ||
49 | # pkgconfig(...) configuration. | ||
50 | -#%%{load:%{_usrlibrpm}/macros.d/pkgconfig} | ||
51 | +%{load:%{_usrlibrpm}/macros.d/pkgconfig} | ||
52 | |||
53 | #------------------------------------------------------------------------ | ||
54 | # mono(...) configuration. | ||
55 | @@ -1029,7 +1029,7 @@ | ||
56 | |||
57 | #------------------------------------------------------------------------ | ||
58 | # tcl(...) configuration. | ||
59 | -#%%{load:%{_usrlibrpm}/macros.d/tcl} | ||
60 | +%{load:%{_usrlibrpm}/macros.d/tcl} | ||
61 | |||
62 | # \endverbatim | ||
63 | #*/ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch new file mode 100644 index 0000000000..c4b4c03de8 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | lib/order.c: Make the dependency loop messages into debug msgs | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | diff -urN rpm-5.4.0.orig/lib/order.c rpm-5.4.0/lib/order.c | ||
8 | --- rpm-5.4.0.orig/lib/order.c 2010-12-13 17:36:39.000000000 -0600 | ||
9 | +++ rpm-5.4.0/lib/order.c 2011-08-10 11:11:43.194686332 -0500 | ||
10 | @@ -2170,7 +2170,7 @@ | ||
11 | const char * dp; | ||
12 | rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) | ||
13 | ? RPMLOG_WARNING : RPMLOG_ERR; | ||
14 | -#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */ | ||
15 | +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */ | ||
16 | // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable | ||
17 | msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}"); | ||
18 | #endif | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch new file mode 100644 index 0000000000..442afbc43b --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | Disable perl-URPM support | ||
2 | |||
3 | This causes a configure failure when perl-URPM is not used. | ||
4 | |||
5 | | configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found | ||
6 | | configure.ac:1159: required file `perl-URPM/Makefile.in' not found | ||
7 | |||
8 | Upstream-Status: Inappropriate [disable feature] | ||
9 | |||
10 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
11 | |||
12 | --- rpm-5.4.8/configure.ac.orig 2012-04-24 09:10:01.856749153 -0500 | ||
13 | +++ rpm-5.4.8/configure.ac 2012-04-24 09:10:35.198731504 -0500 | ||
14 | @@ -1149,30 +1149,10 @@ | ||
15 | AC_SUBST(WITH_PERL_SUBPACKAGE) | ||
16 | AC_SUBST(WITH_PERL_LIBS) | ||
17 | |||
18 | -dnl # optional Perl-URPM language bindings | ||
19 | +dnl # disable Perl-URPM language bindings | ||
20 | WITH_PERL_URPM_SUBDIR="" | ||
21 | WITH_PERL_URPM_SUBPACKAGE=0 | ||
22 | WITH_PERL_URPM_LIBS="" | ||
23 | -if test ".$WITH_PTHREADS" = .yes; then | ||
24 | - WITH_PERL_URPM_LIBS="$LIBS" | ||
25 | -fi | ||
26 | -AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [ | ||
27 | - if test ".$withval" != .no; then | ||
28 | - PERL_URPM_INSTALLDIRS="" | ||
29 | - if test "$withval" == "vendor"; then | ||
30 | - PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," | ||
31 | - fi | ||
32 | - if test "$withval" == "site"; then | ||
33 | - PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site'," | ||
34 | - fi | ||
35 | - AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)]) | ||
36 | - AC_SUBST(PERL_URPM_INSTALLDIRS) | ||
37 | - WITH_PERL_URPM_SUBDIR=perl-URPM | ||
38 | - WITH_PERL_URPM_SUBPACKAGE=1 | ||
39 | - AC_CONFIG_FILES([perl-URPM/Makefile.PL]) | ||
40 | - AC_CONFIG_FILES([perl-URPM/Makefile]) | ||
41 | - fi | ||
42 | -]) | ||
43 | AC_SUBST(WITH_PERL_URPM_SUBDIR) | ||
44 | AC_SUBST(WITH_PERL_URPM_SUBPACKAGE) | ||
45 | AC_SUBST(WITH_PERL_URPM_LIBS) | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch new file mode 100644 index 0000000000..db424b8493 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Fix integration of ossp-uuid | ||
2 | |||
3 | We need to avoid including the util-linux uuid library, instead | ||
4 | we need ossp-uuid. There is a related hack in do_configure to | ||
5 | make sure that we use the right .pc file as well. | ||
6 | |||
7 | Upstream-Status: Inappropriate [disable feature] | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | diff -ur rpm-5.4.9.orig/configure.ac rpm-5.4.9/configure.ac | ||
12 | --- rpm-5.4.9.orig/configure.ac 2012-05-17 16:37:20.594790192 -0500 | ||
13 | +++ rpm-5.4.9/configure.ac 2012-05-17 16:39:23.126933596 -0500 | ||
14 | @@ -1909,7 +1909,7 @@ | ||
15 | esac | ||
16 | RPM_CHECK_LIB( | ||
17 | [OSSP uuid], [uuid], | ||
18 | - [ossp-uuid uuid], [uuid_import], [uuid.h], | ||
19 | + [ossp-uuid], [uuid_import], [uuid.h], | ||
20 | [no,external:none], [], | ||
21 | [ dnl # enable OSSP uuid native API support for embedded Lua | ||
22 | if test ".$WITH_LUA" = .yes; then | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch new file mode 100644 index 0000000000..7e090a3442 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Add the ability to query the packageorigin | ||
2 | |||
3 | Written by jbj at rpm5.org | ||
4 | |||
5 | Upstream-Status: Inappropriate [not author] | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | Index: rpm-5.4.8/rpmdb/hdrfmt.c | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.8.orig/rpmdb/hdrfmt.c | ||
12 | +++ rpm-5.4.8/rpmdb/hdrfmt.c | ||
13 | @@ -2403,8 +2403,10 @@ static int pkgoriginTag(Header h, HE_t | ||
14 | int rc = 1; | ||
15 | |||
16 | he->tag = RPMTAG_PACKAGEORIGIN; | ||
17 | - if (!headerGet(h, he, HEADERGET_NOEXTENSION) | ||
18 | - && (origin = headerGetOrigin(h)) != NULL) | ||
19 | + /* XXX two sources for tag data: what search precedence? */ | ||
20 | + if (headerGet(h, he, HEADERGET_NOEXTENSION)) | ||
21 | + rc = 0; | ||
22 | + else if ((origin = headerGetOrigin(h)) != NULL) | ||
23 | { | ||
24 | he->t = RPM_STRING_TYPE; | ||
25 | he->p.str = xstrdup(origin); | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch new file mode 100644 index 0000000000..f192545abb --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory | ||
2 | |||
3 | Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths, | ||
4 | we don't want this as it may lead to inaccurate results in some corner cases. | ||
5 | |||
6 | PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory. | ||
7 | |||
8 | Upstream-Status: Inappropriate [configuration] | ||
9 | |||
10 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
11 | |||
12 | diff -ur rpm-5.4.9.orig/scripts/pkgconfigdeps.sh rpm-5.4.9/scripts/pkgconfigdeps.sh | ||
13 | --- rpm-5.4.9.orig/scripts/pkgconfigdeps.sh 2009-02-13 08:13:37.000000000 -0600 | ||
14 | +++ rpm-5.4.9/scripts/pkgconfigdeps.sh 2012-06-07 17:35:42.730003847 -0500 | ||
15 | @@ -18,8 +18,8 @@ | ||
16 | *.pc) | ||
17 | # Query the dependencies of the package. | ||
18 | DIR=`dirname ${filename}` | ||
19 | - PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" | ||
20 | - export PKG_CONFIG_PATH | ||
21 | + PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" | ||
22 | + export PKG_CONFIG_LIBDIR | ||
23 | $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do | ||
24 | [ -n "$n" ] || continue | ||
25 | # We have a dependency. Make a note that we need the pkgconfig | ||
26 | @@ -42,8 +42,8 @@ | ||
27 | [ -n "$oneshot" ] && echo "$oneshot"; oneshot="" | ||
28 | # Query the dependencies of the package. | ||
29 | DIR=`dirname ${filename}` | ||
30 | - PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" | ||
31 | - export PKG_CONFIG_PATH | ||
32 | + PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" | ||
33 | + export PKG_CONFIG_LIBDIR | ||
34 | $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do | ||
35 | [ -n "$n" ] || continue | ||
36 | if [ -n "$r" ] && [ -n "$v" ]; then | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch new file mode 100644 index 0000000000..1432b16244 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | Don't add the first line of /etc/rpm/platform to the list of patterns | ||
2 | to match when computing an arch score, use it just for getting | ||
3 | information about the platform (cpu/vendor/os). Fixes #3864. | ||
4 | |||
5 | Upstream-Status: Inappropriate [embedded specific] | ||
6 | |||
7 | diff --git a/lib/rpmrc.c b/lib/rpmrc.c | ||
8 | index e676601..9140bbe 100644 | ||
9 | --- a/lib/rpmrc.c | ||
10 | +++ b/lib/rpmrc.c | ||
11 | @@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * platform) | ||
12 | #endif | ||
13 | } | ||
14 | |||
15 | +#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */ | ||
16 | #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ | ||
17 | /* do not use vendor and GNU attribution */ | ||
18 | p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL); | ||
19 | @@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * platform) | ||
20 | #endif | ||
21 | xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre); | ||
22 | p = _free(p); | ||
23 | - | ||
24 | +#endif | ||
25 | + | ||
26 | init_platform++; | ||
27 | } | ||
28 | rc = (init_platform ? RPMRC_OK : RPMRC_FAIL); | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch new file mode 100644 index 0000000000..172510cb9e --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch | |||
@@ -0,0 +1,134 @@ | |||
1 | Fix up platform and related sysinfo file loading. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | This ensures that RPM knows the compatible set of package types at all times. | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | diff -ur rpm-5.4.0.orig/lib/depends.c rpm-5.4.0/lib/depends.c | ||
10 | --- rpm-5.4.0.orig/lib/depends.c 2011-02-15 20:40:13.002849708 -0600 | ||
11 | +++ rpm-5.4.0/lib/depends.c 2011-02-15 20:47:05.838981632 -0600 | ||
12 | @@ -248,7 +248,7 @@ | ||
13 | he->p.ptr = _free(he->p.ptr); | ||
14 | } | ||
15 | |||
16 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
17 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
18 | /* | ||
19 | * If we're capable of installing multiple colors | ||
20 | * but at least one of the packages are white (0), we | ||
21 | @@ -505,7 +505,7 @@ | ||
22 | return 0; | ||
23 | } | ||
24 | |||
25 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
26 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
27 | /* Is "compat" compatible w/ arch? */ | ||
28 | int _isCompatibleArch(const char * arch, const char * compat) | ||
29 | { | ||
30 | @@ -649,7 +649,7 @@ | ||
31 | |||
32 | if (arch == NULL || (parch = rpmteA(p)) == NULL) | ||
33 | continue; | ||
34 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
35 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
36 | /* XXX hackery for alias matching. */ | ||
37 | if (!_isCompatibleArch(arch, parch)) | ||
38 | continue; | ||
39 | @@ -815,6 +815,12 @@ | ||
40 | return rc; | ||
41 | } | ||
42 | |||
43 | +#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
44 | +#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo" | ||
45 | +#else | ||
46 | +#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo" | ||
47 | +#endif | ||
48 | + | ||
49 | /*@only@*/ /*@null@*/ /*@unchecked@*/ | ||
50 | static char *sysinfo_path = NULL; | ||
51 | |||
52 | @@ -1296,7 +1302,7 @@ | ||
53 | sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL); | ||
54 | if (!(sysinfo_path != NULL && *sysinfo_path == '/')) { | ||
55 | sysinfo_path = _free(sysinfo_path); | ||
56 | - sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo"); | ||
57 | + sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | diff -ur rpm-5.4.0.orig/lib/rpmds.c rpm-5.4.0/lib/rpmds.c | ||
62 | --- rpm-5.4.0.orig/lib/rpmds.c 2011-02-15 20:40:13.004855352 -0600 | ||
63 | +++ rpm-5.4.0/lib/rpmds.c 2011-02-15 20:41:55.598846670 -0600 | ||
64 | @@ -1737,7 +1737,7 @@ | ||
65 | /*@-observertrans @*/ | ||
66 | _sysinfo_path = _free(_sysinfo_path); | ||
67 | /*@=observertrans @*/ | ||
68 | - _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO); | ||
69 | + _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); | ||
70 | } | ||
71 | } | ||
72 | /*@=modobserver@*/ | ||
73 | diff -ur rpm-5.4.0.orig/lib/rpmrc.c rpm-5.4.0/lib/rpmrc.c | ||
74 | --- rpm-5.4.0.orig/lib/rpmrc.c 2011-02-15 20:40:13.006853913 -0600 | ||
75 | +++ rpm-5.4.0/lib/rpmrc.c 2011-02-15 20:44:39.708972391 -0600 | ||
76 | @@ -38,7 +38,13 @@ | ||
77 | static const char * configTarget = NULL; | ||
78 | |||
79 | /*@observer@*/ /*@unchecked@*/ | ||
80 | -static const char * platform = SYSCONFIGDIR "/platform"; | ||
81 | +#if defined(RPM_VENDOR_WINDRIVER) | ||
82 | +#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform" | ||
83 | +#else | ||
84 | +#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform" | ||
85 | +#endif | ||
86 | + | ||
87 | +static const char * _platform = NULL; | ||
88 | |||
89 | /*@only@*/ /*@relnull@*/ /*@unchecked@*/ | ||
90 | void * platpat = NULL; | ||
91 | @@ -685,16 +691,17 @@ | ||
92 | int rc; | ||
93 | |||
94 | while (!gotDefaults) { | ||
95 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
96 | - const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL); | ||
97 | -#else | ||
98 | - const char * _platform = platform; | ||
99 | -#endif | ||
100 | + if (_platform == NULL) { | ||
101 | + _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL); | ||
102 | + /* XXX may need to validate path existence somewhen. */ | ||
103 | + if (!(_platform != NULL && *_platform == '/')) { | ||
104 | + _platform = _free(_platform); | ||
105 | + _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL); | ||
106 | + } | ||
107 | + } | ||
108 | CVOG_t cvog = NULL; | ||
109 | #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ | ||
110 | const char *cp; | ||
111 | -#endif | ||
112 | -#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ | ||
113 | /* utsname fields on some platforms (like HP-UX) are very small | ||
114 | (just about 8 characters). This is too small for OpenPKG, so cheat! */ | ||
115 | rc = uname(&un_real); | ||
116 | @@ -771,9 +778,7 @@ | ||
117 | if (cp != NULL && cp != _platform) | ||
118 | cp = _free(cp); | ||
119 | #endif | ||
120 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
121 | _platform = _free(_platform); | ||
122 | -#endif | ||
123 | |||
124 | if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) { | ||
125 | gotDefaults = 1; | ||
126 | @@ -1096,6 +1101,8 @@ | ||
127 | |||
128 | #ifdef PREMACROFILES | ||
129 | if (rpmReadRC(PREMACROFILES)) return -1; | ||
130 | +#else | ||
131 | + if (rpmReadRC(NULL)) return -1; | ||
132 | #endif | ||
133 | |||
134 | /* Reset umask to its default umask(2) value. */ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch new file mode 100644 index 0000000000..79124bb6c4 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch | |||
@@ -0,0 +1,105 @@ | |||
1 | Fix up platform and related sysinfo file loading (part 2). | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | We need to ensure that we set the _gnu flag somehow. We do this by reading | ||
6 | from the platform file, and setting a new _platform_gnu and related vars. | ||
7 | |||
8 | The default values of _host_cpu, _host_vendor and _host_os are changed to | ||
9 | reference either the automatically determined _target_... or _platform_... | ||
10 | values. The macros file uses the configure time defaults in _platform_... | ||
11 | versions have not been defined. This preserves existing behavior, but | ||
12 | ensures reasonable defaults are always available. | ||
13 | |||
14 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
15 | |||
16 | Index: rpm-5.4.9/lib/rpmrc.c | ||
17 | =================================================================== | ||
18 | --- rpm-5.4.9.orig/lib/rpmrc.c | ||
19 | +++ rpm-5.4.9/lib/rpmrc.c | ||
20 | @@ -328,10 +328,15 @@ static void setDefaults(void) | ||
21 | /*@modifies rpmGlobalMacroContext, internalState @*/ | ||
22 | { | ||
23 | |||
24 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
25 | +#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
26 | addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT); | ||
27 | addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT); | ||
28 | addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT); | ||
29 | + | ||
30 | + addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT); | ||
31 | + addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT); | ||
32 | + addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT); | ||
33 | + addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT); | ||
34 | #endif | ||
35 | |||
36 | addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT); | ||
37 | @@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl | ||
38 | } | ||
39 | |||
40 | if (!parseCVOG(p, &cvog) && cvog != NULL) { | ||
41 | +#if defined(RPM_VENDOR_OE) | ||
42 | + char * _gnu = NULL; | ||
43 | + | ||
44 | + addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1); | ||
45 | + addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1); | ||
46 | + addMacro(NULL, "_platform_os", NULL, cvog->os, -1); | ||
47 | + | ||
48 | + if (cvog->gnu && cvog->gnu[0] != '\0') | ||
49 | + _gnu = rpmExpand("-", cvog->gnu, NULL); | ||
50 | + | ||
51 | + addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1); | ||
52 | +#else | ||
53 | addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); | ||
54 | addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); | ||
55 | addMacro(NULL, "_host_os", NULL, cvog->os, -1); | ||
56 | +#endif | ||
57 | } | ||
58 | |||
59 | #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ | ||
60 | Index: rpm-5.4.9/macros/macros.in | ||
61 | =================================================================== | ||
62 | --- rpm-5.4.9.orig/macros/macros.in | ||
63 | +++ rpm-5.4.9/macros/macros.in | ||
64 | @@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar | ||
65 | %_os @RPMCANONOS@ | ||
66 | %_gnu @RPMCANONGNU@ | ||
67 | |||
68 | -%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} | ||
69 | -%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} | ||
70 | -%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu} | ||
71 | +%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} | ||
72 | +%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} | ||
73 | +%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} | ||
74 | |||
75 | #============================================================================== | ||
76 | # ---- configure macros. | ||
77 | @@ -920,9 +920,10 @@ $_arbitrary_tags_tests Foo:Bar | ||
78 | %_build_os %{_host_os} | ||
79 | %_host @host@ | ||
80 | %_host_alias @host_alias@%{nil} | ||
81 | -%_host_cpu @host_cpu@ | ||
82 | -%_host_vendor @host_vendor@ | ||
83 | -%_host_os @host_os@ | ||
84 | +%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}} | ||
85 | +%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}} | ||
86 | +%_host_os %{?_platform_os}%{!?_platform_os:%{_os}} | ||
87 | +%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}} | ||
88 | %_target %{_host} | ||
89 | %_target_alias %{_host_alias} | ||
90 | %_target_cpu %{_host_cpu} | ||
91 | Index: rpm-5.4.9/python/rpmmodule.c | ||
92 | =================================================================== | ||
93 | --- rpm-5.4.9.orig/python/rpmmodule.c | ||
94 | +++ rpm-5.4.9/python/rpmmodule.c | ||
95 | @@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s | ||
96 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch)) | ||
97 | return NULL; | ||
98 | |||
99 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
100 | - platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL); | ||
101 | +#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
102 | + platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL); | ||
103 | #else | ||
104 | platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL); | ||
105 | #endif | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch new file mode 100644 index 0000000000..b65abc24a0 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | python/rpmmodules.c: Change the way the python module loads the RPM config | ||
2 | |||
3 | In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic | ||
4 | runtime relocation paths, we need to call rpmcliInit instead of | ||
5 | rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles | ||
6 | after the necessary relocation processing (if enabled). | ||
7 | |||
8 | Code derived from changes suggested by Paul Eggleton. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
13 | |||
14 | diff --git a/python/rpmmodule.c b/python/rpmmodule.c | ||
15 | index f7282bc..dde68ca 100644 | ||
16 | --- a/python/rpmmodule.c | ||
17 | +++ b/python/rpmmodule.c | ||
18 | @@ -392,7 +392,8 @@ void init_rpm(void) | ||
19 | if (Py_AtExit(rpm_exithook) == -1) | ||
20 | return; | ||
21 | |||
22 | - rpmReadConfigFiles(NULL, NULL); | ||
23 | + const char *argv[1] = {"rpmmodule", 0}; | ||
24 | + rpmcliInit(1, argv, NULL); | ||
25 | |||
26 | d = PyModule_GetDict(m); | ||
27 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch new file mode 100644 index 0000000000..33ec8e21e1 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | macros: Use dyanmic config vs hard coded settings | ||
2 | |||
3 | When the dynamic, runtime relocation is enables we need to make sure that the | ||
4 | RPM macro file does not override the dynamic settings. Fix this by forcing the | ||
5 | dynamic version to be used in all cases. | ||
6 | |||
7 | Upstream-Status: Inapproriate (OpenEmbedded specific) | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | Index: rpm-5.4.9/macros/macros.in | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.9.orig/macros/macros.in | ||
14 | +++ rpm-5.4.9/macros/macros.in | ||
15 | @@ -27,11 +27,12 @@ | ||
16 | #============================================================================== | ||
17 | # ---- filesystem macros. | ||
18 | # | ||
19 | -%_usr @usrprefix@ | ||
20 | +%_usr %{_usrlibrpm}/../.. | ||
21 | %_usrsrc %{_usr}/src | ||
22 | -%_var @varprefix@ | ||
23 | -%_usrlibrpm @USRLIBRPM@ | ||
24 | -%_etcrpm @SYSCONFIGDIR@ | ||
25 | +%_var %{_usr}/../var | ||
26 | +# The dynamic relocation code sets the following two items | ||
27 | +#%_usrlibrpm @USRLIBRPM@ | ||
28 | +#%_etcrpm @SYSCONFIGDIR@ | ||
29 | |||
30 | %__objext @objext@ | ||
31 | %__libext @libext@ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch new file mode 100644 index 0000000000..89ee41001d --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | diff --git a/syck/lib/syck.h b/syck/lib/syck.h | ||
2 | index 04be1d9..73830a6 100644 | ||
3 | --- a/syck/lib/syck.h | ||
4 | +++ b/syck/lib/syck.h | ||
5 | @@ -621,9 +621,6 @@ long syck_seq_count( SyckNode *seq ) | ||
6 | */ | ||
7 | void syckerror( char *msg ) | ||
8 | /*@*/; | ||
9 | -int syckparse( void * ) | ||
10 | - /*@globals fileSystem @*/ | ||
11 | - /*@modifies fileSystem @*/; | ||
12 | /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */ | ||
13 | int sycklex( void *_sycklval, SyckParser *parser ) | ||
14 | /*@modifies _sycklval, parser @*/; | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch new file mode 100644 index 0000000000..d272fe9cff --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | lib/rpmts.c: Ensure that we check both providename and filepaths | ||
2 | |||
3 | When looking up a missing dependencies, such as /bin/sh, we need to lookup | ||
4 | in both the providename and filepaths DB, not just the filepaths DB. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
9 | |||
10 | --- rpm-5.4.0.orig/lib/rpmts.c 2010-12-27 16:08:25.000000000 -0600 | ||
11 | +++ rpm-5.4.0/lib/rpmts.c 2012-04-12 15:01:12.990184067 -0500 | ||
12 | @@ -403,8 +403,8 @@ | ||
13 | if (sdb == NULL) | ||
14 | continue; | ||
15 | |||
16 | - /* Look for a matching Provides: in suggested universe. */ | ||
17 | - rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME); | ||
18 | + rpmtag = RPMTAG_PROVIDENAME; | ||
19 | + do { | ||
20 | mi = rpmmiInit(sdb, rpmtag, keyp, keylen); | ||
21 | while ((h = rpmmiNext(mi)) != NULL) { | ||
22 | size_t hnamelen; | ||
23 | @@ -439,6 +439,15 @@ | ||
24 | bhnamelen = hnamelen; | ||
25 | } | ||
26 | mi = rpmmiFree(mi); | ||
27 | + | ||
28 | + if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) { | ||
29 | + rpmtag = RPMTAG_FILEPATHS; | ||
30 | + continue; | ||
31 | + } | ||
32 | + | ||
33 | + break; | ||
34 | + } while (1); | ||
35 | + | ||
36 | } | ||
37 | |||
38 | /* Is there a suggested resolution? */ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch b/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch new file mode 100644 index 0000000000..9b63b37fea --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | rpmts.c: respect to the arch priorities | ||
2 | |||
3 | Let rpm respect to the priorities when choose alternatives rpm, the arch | ||
4 | which comes first is preferred. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
9 | --- | ||
10 | lib/rpmts.c | 14 ++++++++++++++ | ||
11 | 1 files changed, 14 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/lib/rpmts.c b/lib/rpmts.c | ||
14 | index 3fbbc9e..40ec08e 100644 | ||
15 | --- a/lib/rpmts.c | ||
16 | +++ b/lib/rpmts.c | ||
17 | @@ -353,6 +353,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data) | ||
18 | Header h = NULL; | ||
19 | size_t bhnamelen = 0; | ||
20 | time_t bhtime = 0; | ||
21 | + const char *bharch = NULL; | ||
22 | rpmTag rpmtag; | ||
23 | const char * keyp; | ||
24 | size_t keylen = 0; | ||
25 | @@ -409,6 +410,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data); | ||
26 | while ((h = rpmmiNext(mi)) != NULL) { | ||
27 | size_t hnamelen; | ||
28 | time_t htime; | ||
29 | + const char *harch = NULL; | ||
30 | |||
31 | if (rpmtag == RPMTAG_PROVIDENAME && !rpmdsAnyMatchesDep(h, ds, 1)) | ||
32 | continue; | ||
33 | @@ -431,12 +433,23 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data); | ||
34 | if (htime <= bhtime) | ||
35 | continue; | ||
36 | |||
37 | + /* XXX Respect to the arch priorities */ | ||
38 | + he->tag = RPMTAG_ARCH; | ||
39 | + xx = headerGet(h, he, 0); | ||
40 | + harch = ((xx && he->p.str) ? xstrdup(he->p.str) : NULL); | ||
41 | + he->p.ptr = _free(he->p.ptr); | ||
42 | + if (bharch && (strcmp(bharch, harch) != 0)) | ||
43 | + continue; | ||
44 | + | ||
45 | /* Save new "best" candidate. */ | ||
46 | (void)headerFree(bh); | ||
47 | bh = NULL; | ||
48 | bh = headerLink(h); | ||
49 | bhtime = htime; | ||
50 | bhnamelen = hnamelen; | ||
51 | + bharch = _free(bharch); | ||
52 | + bharch = xstrdup(harch); | ||
53 | + harch = _free(harch); | ||
54 | } | ||
55 | mi = rpmmiFree(mi); | ||
56 | |||
57 | @@ -449,6 +462,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data); | ||
58 | } while (1); | ||
59 | |||
60 | } | ||
61 | + bharch = _free(bharch); | ||
62 | |||
63 | /* Is there a suggested resolution? */ | ||
64 | if (bh == NULL) | ||
65 | -- | ||
66 | 1.7.1 | ||
67 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch new file mode 100644 index 0000000000..f4e42287da --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch | |||
@@ -0,0 +1,160 @@ | |||
1 | Enable a cross-install scriptlet helper. | ||
2 | |||
3 | The helper is called from outside of the chroot with the arguments: | ||
4 | |||
5 | <root> <prog> <script> <arg1> [<arg2> ... <argN>] | ||
6 | |||
7 | The helper script is used by oe-core to facilitate shell script actions that | ||
8 | can not be run from within a chroot on a foreign target system during a | ||
9 | cross install. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
14 | |||
15 | Index: rpm-5.4.9/lib/psm.c | ||
16 | =================================================================== | ||
17 | --- rpm-5.4.9.orig/lib/psm.c | ||
18 | +++ rpm-5.4.9/lib/psm.c | ||
19 | @@ -801,6 +801,10 @@ static rpmRC runScript(rpmpsm psm, Heade | ||
20 | int xx; | ||
21 | int i; | ||
22 | |||
23 | +#ifdef RPM_VENDOR_OE | ||
24 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
25 | +#endif | ||
26 | + | ||
27 | if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX) | ||
28 | ssp = psm->sstates + ix; | ||
29 | if (ssp != NULL) | ||
30 | @@ -867,14 +871,29 @@ assert(he->p.str != NULL); | ||
31 | (F_ISSET(psm, UNORDERED) ? "a" : "")); | ||
32 | |||
33 | if (Phe->p.argv == NULL) { | ||
34 | - argv = (const char **) alloca(5 * sizeof(*argv)); | ||
35 | - argv[0] = "/bin/sh"; | ||
36 | - argc = 1; | ||
37 | + argv = (const char **) alloca(7 * sizeof(*argv)); | ||
38 | + argc = 0; | ||
39 | + } else { | ||
40 | + argv = (const char **) alloca((Phe->c + 6) * sizeof(*argv)); | ||
41 | + argc = 0; | ||
42 | + } | ||
43 | + | ||
44 | +#ifdef RPM_VENDOR_OE | ||
45 | + if (scriptletWrapper && *scriptletWrapper) { | ||
46 | + argv[argc++] = scriptletWrapper; | ||
47 | + argv[argc] = rpmtsRootDir(ts); | ||
48 | + if (!argv[argc] || !*argv[argc]) | ||
49 | + argv[argc] = "/"; | ||
50 | + argc++; | ||
51 | + } | ||
52 | +#endif | ||
53 | + | ||
54 | + if (Phe->p.argv == NULL) { | ||
55 | + argv[argc++] = "/bin/sh"; | ||
56 | ldconfig_done = 0; | ||
57 | } else { | ||
58 | - argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv)); | ||
59 | - memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv)); | ||
60 | - argc = Phe->c; | ||
61 | + memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv)); | ||
62 | + argc += Phe->c; | ||
63 | ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path) | ||
64 | ? 1 : 0); | ||
65 | } | ||
66 | @@ -925,7 +944,12 @@ assert(he->p.str != NULL); | ||
67 | goto exit; | ||
68 | |||
69 | if (rpmIsDebug() && | ||
70 | - (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) | ||
71 | + (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")) | ||
72 | +#ifdef RPM_VENDOR_OE | ||
73 | + || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh")) | ||
74 | + || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash")) | ||
75 | +#endif | ||
76 | + ) | ||
77 | { | ||
78 | static const char set_x[] = "set -x\n"; | ||
79 | nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); | ||
80 | @@ -1060,12 +1084,22 @@ assert(he->p.str != NULL); | ||
81 | |||
82 | { const char * rootDir = rpmtsRootDir(ts); | ||
83 | if (!rpmtsChrootDone(ts) && rootDir != NULL && | ||
84 | +#ifdef RPM_VENDOR_OE | ||
85 | + !(scriptletWrapper && *scriptletWrapper) && | ||
86 | +#endif | ||
87 | !(rootDir[0] == '/' && rootDir[1] == '\0')) | ||
88 | { | ||
89 | /*@-modobserver@*/ | ||
90 | xx = Chroot(rootDir); | ||
91 | /*@=modobserver@*/ | ||
92 | } | ||
93 | +#ifdef RPM_VENDOR_OE | ||
94 | + if (!rpmtsChrootDone(ts) && rootDir != NULL && | ||
95 | + (scriptletWrapper && *scriptletWrapper) && | ||
96 | + !(rootDir[0] == '/' && rootDir[1] == '\0')) | ||
97 | + xx = Chdir(rootDir); | ||
98 | + else | ||
99 | +#endif | ||
100 | xx = Chdir("/"); | ||
101 | rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"), | ||
102 | psm->stepName, sln, NVRA, | ||
103 | @@ -2977,6 +3011,13 @@ assert(psm->te != NULL); | ||
104 | case PSM_SCRIPT: /* Run current package scriptlets. */ | ||
105 | /* XXX running %verifyscript/%sanitycheck doesn't have psm->te */ | ||
106 | { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL); | ||
107 | + | ||
108 | +#ifdef RPM_VENDOR_OE | ||
109 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
110 | + if (scriptletWrapper && *scriptletWrapper) | ||
111 | + rc = rpmpsmNext(psm, PSM_CHROOT_OUT); | ||
112 | +#endif | ||
113 | + | ||
114 | xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL); | ||
115 | rc = runInstScript(psm); | ||
116 | if (rc) | ||
117 | @@ -2984,11 +3025,24 @@ assert(psm->te != NULL); | ||
118 | else | ||
119 | xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); | ||
120 | rpmtsGetRdb(ts)->db_txn = NULL; | ||
121 | +#ifdef RPM_VENDOR_OE | ||
122 | + if (scriptletWrapper && *scriptletWrapper) | ||
123 | + rc = rpmpsmNext(psm, PSM_CHROOT_IN); | ||
124 | +#endif | ||
125 | } break; | ||
126 | case PSM_TRIGGERS: | ||
127 | /* Run triggers in other package(s) this package sets off. */ | ||
128 | if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; | ||
129 | +#ifdef RPM_VENDOR_OE | ||
130 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
131 | + if (scriptletWrapper && *scriptletWrapper) | ||
132 | + rc = rpmpsmNext(psm, PSM_CHROOT_OUT); | ||
133 | +#endif | ||
134 | rc = runTriggers(psm); | ||
135 | +#ifdef RPM_VENDOR_OE | ||
136 | + if (scriptletWrapper && *scriptletWrapper) | ||
137 | + rc = rpmpsmNext(psm, PSM_CHROOT_IN); | ||
138 | +#endif | ||
139 | break; | ||
140 | case PSM_IMMED_TRIGGERS: | ||
141 | /* Run triggers in this package other package(s) set off. */ | ||
142 | @@ -2998,7 +3052,18 @@ assert(psm->te != NULL); | ||
143 | F_SET(psm, GOTTRIGGERS); | ||
144 | } | ||
145 | if (psm->triggers != NULL) | ||
146 | +#ifdef RPM_VENDOR_OE | ||
147 | + { | ||
148 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
149 | + if (scriptletWrapper && *scriptletWrapper) | ||
150 | + rc = rpmpsmNext(psm, PSM_CHROOT_OUT); | ||
151 | +#endif | ||
152 | rc = runImmedTriggers(psm); | ||
153 | +#ifdef RPM_VENDOR_OE | ||
154 | + if (scriptletWrapper && *scriptletWrapper) | ||
155 | + rc = rpmpsmNext(psm, PSM_CHROOT_IN); | ||
156 | + } | ||
157 | +#endif | ||
158 | break; | ||
159 | |||
160 | case PSM_RPMIO_FLAGS: | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch new file mode 100644 index 0000000000..b38b34d9db --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Workaround for a memory leak in --showrc. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | diff -ur rpm-5.4.0.orig/lib/rpmrc.c rpm-5.4.0/lib/rpmrc.c | ||
8 | --- rpm-5.4.0.orig/lib/rpmrc.c 2011-02-15 20:40:13.006853913 -0600 | ||
9 | +++ rpm-5.4.0/lib/rpmrc.c 2011-02-15 20:44:39.708972391 -0600 | ||
10 | @@ -1216,11 +1223,15 @@ | ||
11 | if (DNEVR != NULL) | ||
12 | fprintf(fp, " %s\n", DNEVR+2); | ||
13 | } | ||
14 | +#if 0 | ||
15 | (void)rpmdsFree(ds); | ||
16 | ds = NULL; | ||
17 | +#endif | ||
18 | fprintf(fp, "\n"); | ||
19 | } | ||
20 | +#if 0 | ||
21 | PRCO = rpmdsFreePRCO(PRCO); | ||
22 | +#endif | ||
23 | } | ||
24 | |||
25 | if (rpmIsVerbose()) { | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-solvedb.patch b/meta/recipes-devtools/rpm/rpm/rpm-solvedb.patch new file mode 100644 index 0000000000..d6f43a2c06 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-solvedb.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Increase the maximum number of solver databases! | ||
2 | |||
3 | Previously the max was set to 5, up this to 20... this should be more | ||
4 | then enough for now.. also add an RPM_ERROR message in case we exceed the | ||
5 | new maximum. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | diff -urN rpm-5.4.0.orig/rpmio/rpmbag.c rpm-5.4.0/rpmio/rpmbag.c | ||
12 | --- rpm-5.4.0.orig/rpmio/rpmbag.c 2010-10-17 21:43:55.000000000 -0500 | ||
13 | +++ rpm-5.4.0/rpmio/rpmbag.c 2011-02-18 18:46:00.246892502 -0600 | ||
14 | @@ -16,7 +16,7 @@ | ||
15 | /*@unchecked@*/ | ||
16 | int _rpmbag_debug = 0; | ||
17 | |||
18 | -static size_t _maxnsdbp = 5; | ||
19 | +static size_t _maxnsdbp = 20; | ||
20 | |||
21 | static void rpmbagFini(void * _bag) | ||
22 | /*@globals fileSystem @*/ | ||
23 | @@ -70,6 +70,8 @@ | ||
24 | sdbp[i] = xcalloc(1, sizeof(*sdbp[i])); | ||
25 | sdbp[i]->dbmode = dbmode; | ||
26 | sdbp[i]->_db = _db; | ||
27 | + } else if (bag && bag->sdbp && bag->nsdbp >= _maxnsdbp) { | ||
28 | + rpmlog(RPMLOG_ERR, _("Attempted to open more then %d solver databases. Increase _maxnsdbp in rpmio/rpmbag.c\n"), _maxnsdbp); | ||
29 | } | ||
30 | |||
31 | return 0; | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-stub-out-git_strerror.patch b/meta/recipes-devtools/rpm/rpm/rpm-stub-out-git_strerror.patch new file mode 100644 index 0000000000..cbeeb29f52 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-stub-out-git_strerror.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | git: fix: stud-out git_strerror when --without-git | ||
2 | |||
3 | Patch taken from the cvs repo,http://www.mail-archive.com/rpm-cvs@rpm5.org/msg08907.html. | ||
4 | |||
5 | Upstream-Status: Backport | ||
6 | |||
7 | Signed-off-by: Morgan Little <morgan.little@windriver.com> | ||
8 | |||
9 | Server: rpm5.org Name: Jeff Johnson | ||
10 | Root: /v/rpm/cvs Email: j...@rpm5.org | ||
11 | Module: rpm Date: 07-Jun-2012 16:17:02 | ||
12 | Branch: rpm-5_4 Handle: 2012060714165803 | ||
13 | |||
14 | Modified files: (Branch: rpm-5_4) | ||
15 | rpm CHANGES | ||
16 | rpm/rpmio rpmgit.c tgit.c | ||
17 | |||
18 | Log: | ||
19 | - git: fix: stub-out git_strerror when --without-git. | ||
20 | |||
21 | Summary: | ||
22 | Revision Changes Path | ||
23 | 2.1.2.11 +3 -1 rpm/rpmio/rpmgit.c | ||
24 | 1.1.2.7 +0 -1 rpm/rpmio/tgit.c | ||
25 | ____________________________________________________________________________ | ||
26 | Index: rpm/rpmio/rpmgit.c | ||
27 | ============================================================================ | ||
28 | --- rpm/rpmio/rpmgit.c | ||
29 | +++ rpm/rpmio/rpmgit.c | ||
30 | @@ -145,6 +145,9 @@ | ||
31 | #endif /* defined(WITH_LIBGT2) */ | ||
32 | |||
33 | /*==============================================================*/ | ||
34 | +#if !defined(WITH_LIBGIT2) | ||
35 | +#define git_strerror(_rc) "" | ||
36 | +#endif | ||
37 | |||
38 | static int Xchkgit(/*@unused@*/ rpmgit git, const char * msg, | ||
39 | int error, int printit, | ||
40 | @@ -157,7 +157,6 @@ | ||
41 | int rc = error; | ||
42 | |||
43 | if (printit && rc) { | ||
44 | - /* XXX git_strerror? */ | ||
45 | rpmlog(RPMLOG_ERR, "%s:%s:%u: %s(%d): %s\n", | ||
46 | func, fn, ln, msg, rc, git_strerror(rc)); | ||
47 | } | ||
48 | Index: rpm/rpmio/tgit.c | ||
49 | ============================================================================ | ||
50 | --- rpm/rpmio/tgit.c | ||
51 | +++ rpm/rpmio/tgit.c | ||
52 | @@ -34,7 +34,6 @@ | ||
53 | int rc = error; | ||
54 | |||
55 | if (printit && rc) { | ||
56 | - /* XXX git_strerror? */ | ||
57 | rpmlog(RPMLOG_ERR, "%s:%s:%u: %s(%d): %s\n", | ||
58 | func, fn, ln, msg, rc, git_strerror(rc)); | ||
59 | } | ||
60 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch new file mode 100644 index 0000000000..e487b821b2 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | fix a endian incompatible error in generating rpm tag | ||
2 | |||
3 | A flaw was found in the way rpm generating arbitrary tags, which leads to a | ||
4 | incorrect query result, this issue is introduced by a incompatible endianess | ||
5 | when the generating process is executed on different architectures. | ||
6 | |||
7 | This patch resolves it by taking the byte order that host uses. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
12 | --- | ||
13 | tagname.c | 16 ++++++++++++++++ | ||
14 | 1 file changed, 16 insertions(+) | ||
15 | |||
16 | diff -urpN a/rpmdb/tagname.c b/rpmdb/tagname.c | ||
17 | --- a/rpmdb/tagname.c | ||
18 | +++ b/rpmdb/tagname.c | ||
19 | @@ -3,6 +3,19 @@ | ||
20 | */ | ||
21 | |||
22 | #include "system.h" | ||
23 | +#include <endian.h> | ||
24 | + | ||
25 | +/* Don't redefine this macro if it already exists */ | ||
26 | +#ifndef le32toh | ||
27 | +#ifdef __USE_BSD | ||
28 | +#include <byteswap.h> | ||
29 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
30 | +#define le32toh(x) (x) | ||
31 | +#else | ||
32 | +#define le32toh(x) __bswap_32(x) | ||
33 | +#endif | ||
34 | +#endif /* __USE_BSD */ | ||
35 | +#endif /* le32toh */ | ||
36 | |||
37 | #include <rpmio_internal.h> /* XXX DIGEST_CTX, xtolower, xstrcasecmp */ | ||
38 | #include <rpmmacro.h> | ||
39 | @@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s | ||
40 | xx = rpmDigestUpdate(ctx, s, nb); | ||
41 | xx = rpmDigestFinal(ctx, &digest, &digestlen, 0); | ||
42 | if (digest && digestlen > 4) { | ||
43 | + /* The tag is stored in a uniform byte order for cross-endian compatibility. | ||
44 | + Swap to the host uses. */ | ||
45 | memcpy(&tag, digest + (digestlen - 4), 4); | ||
46 | + tag = le32toh(tag); | ||
47 | tag = (rpmTag) (tag & 0x3fffffff); | ||
48 | tag = (rpmTag) (tag | 0x40000000); | ||
49 | } | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch new file mode 100644 index 0000000000..dd8d8bd5de --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Source: None | ||
2 | Upstream-Status: Pending | ||
3 | Author: Khem Raj <raj.khem@gmail.com> | ||
4 | Date: 2011-03-03 | ||
5 | Description: | ||
6 | This patch fixes build issue found when compiling rpm-natibe on ubuntu | ||
7 | 11.04-alpha. Problem is that linker does not get correct set of dependent | ||
8 | libraries when linking mtree binary which results in undefined symbols | ||
9 | in librpmio.so. This patch adds correct flags to mtree_LDADD to account | ||
10 | for rpmio deps | ||
11 | |||
12 | Index: rpm-5.4.0/tools/Makefile.am | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.0.orig/tools/Makefile.am | ||
15 | +++ rpm-5.4.0/tools/Makefile.am | ||
16 | @@ -169,7 +169,7 @@ grep_LDADD = $(RPMIO_LDADD_COMMON) | ||
17 | |||
18 | mtree_SOURCES = rpmmtree.c | ||
19 | mtree_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
20 | -mtree_LDADD = $(RPM_LDADD_COMMON) | ||
21 | +mtree_LDADD = $(RPMIO_LDADD_COMMON) | ||
22 | |||
23 | rpmrepo_SOURCES = rpmrepo.c | ||
24 | rpmrepo_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS) | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch new file mode 100644 index 0000000000..600e2c280c --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | A patch to fix a problem when compiling with uuid. | ||
2 | |||
3 | When attempting to build with uuid and all tests compiling will error because | ||
4 | uuid.h doesn't exist in the rpm tarball. Fix this by changing the include to | ||
5 | use the one in ossp which solves the issue. | ||
6 | |||
7 | The recipe already depends on ossp so ossp/uuid.h will be there when rpm-native | ||
8 | is built. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Morgan Little <morgan.little@windriver.com> | ||
13 | |||
14 | |||
15 | --- a/lua/local/luuid.c.orig | ||
16 | +++ b/lua/local/luuid.c | ||
17 | @@ -21,7 +21,7 @@ | ||
18 | |||
19 | #ifdef LUA_USE_UUID | ||
20 | |||
21 | -#include "uuid.h" | ||
22 | +#include <ossp/uuid.h> | ||
23 | |||
24 | /* Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>]) */ | ||
25 | static int luuid_generate(lua_State *L) | ||
26 | |||
27 | --- a/rpmio/rpmuuid.c.orig | ||
28 | +++ b/rpmio/rpmuuid.c | ||
29 | @@ -16,7 +16,7 @@ | ||
30 | #include "rpmlog.h" | ||
31 | #include "rpmuuid.h" | ||
32 | #ifdef WITH_UUID | ||
33 | -#include "uuid.h" | ||
34 | +#include <ossp/uuid.h> | ||
35 | #endif | ||
36 | #include "debug.h" | ||
37 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm2cpio b/meta/recipes-devtools/rpm/rpm/rpm2cpio new file mode 100755 index 0000000000..6bcef6a4ce --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm2cpio | |||
@@ -0,0 +1,39 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Prevent gawk >= 4.0.x from getting funny ideas wrt UTF in printf() | ||
4 | LANG=C | ||
5 | |||
6 | pkg=$1 | ||
7 | if [ "$pkg" = "" -o ! -e "$pkg" ]; then | ||
8 | echo "no package supplied" 1>&2 | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | leadsize=96 | ||
13 | o=`expr $leadsize + 8` | ||
14 | set `od -j $o -N 8 -t u1 $pkg` | ||
15 | il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` | ||
16 | dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` | ||
17 | # echo "sig il: $il dl: $dl" | ||
18 | |||
19 | sigsize=`expr 8 + 16 \* $il + $dl` | ||
20 | o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8` | ||
21 | set `od -j $o -N 8 -t u1 $pkg` | ||
22 | il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` | ||
23 | dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` | ||
24 | # echo "hdr il: $il dl: $dl" | ||
25 | |||
26 | hdrsize=`expr 8 + 16 \* $il + $dl` | ||
27 | o=`expr $o + $hdrsize` | ||
28 | comp=`dd if=$pkg ibs=$o skip=1 count=1 2>/dev/null | dd bs=3 count=1 2> /dev/null` | ||
29 | |||
30 | gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`" | ||
31 | lzma="`echo . | awk '{ printf("%cLZ", 0xff); }'`" | ||
32 | xz="`echo . | awk '{ printf("%c7z", 0xfd); }'`" | ||
33 | case "$comp" in | ||
34 | BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;; | ||
35 | "$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;; | ||
36 | "$xz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | xzcat ;; | ||
37 | "$lzma"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;; | ||
38 | *) echo "Unrecognized rpm file: $pkg"; exit 1 ;; | ||
39 | esac | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpmatch.patch b/meta/recipes-devtools/rpm/rpm/rpmatch.patch new file mode 100644 index 0000000000..8ea349003a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpmatch.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | Add configure check for rpmatch() and | ||
2 | creates a compatable macro if it is not provided by the C library. | ||
3 | |||
4 | This is needed for uclibc since it does not have the above function | ||
5 | implemented. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | Index: rpm-5.4.0/configure.ac | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.0.orig/configure.ac 2012-05-31 15:40:05.985990822 -0700 | ||
14 | +++ rpm-5.4.0/configure.ac 2012-05-31 15:41:15.601995311 -0700 | ||
15 | @@ -800,7 +800,7 @@ | ||
16 | ftok getaddrinfo getattrlist getcwd getdelim getline getmode getnameinfo dnl | ||
17 | getpassphrase getxattr getwd iconv inet_aton lchflags lchmod lchown dnl | ||
18 | lgetxattr lsetxattr lutimes madvise mempcpy mkdtemp mkstemp mtrace dnl | ||
19 | - posix_fadvise posix_fallocate putenv realpath regcomp __secure_getenv dnl | ||
20 | + posix_fadvise posix_fallocate putenv realpath regcomp rpmatch __secure_getenv dnl | ||
21 | setattrlist setenv setlocale setmode setxattr dnl | ||
22 | sigaddset sigdelset sigemptyset sighold sigrelse sigpause dnl | ||
23 | sigprocmask sigsuspend sigaction dnl | ||
24 | Index: rpm-5.4.0/system.h | ||
25 | =================================================================== | ||
26 | --- rpm-5.4.0.orig/system.h 2012-05-31 15:40:05.997991504 -0700 | ||
27 | +++ rpm-5.4.0/system.h 2012-05-31 15:42:04.941997731 -0700 | ||
28 | @@ -410,6 +410,14 @@ | ||
29 | #endif /* defined(__GNUC__) */ | ||
30 | #endif /* HAVE_MCHECK_H */ | ||
31 | |||
32 | +#ifndef HAVE_RPMATCH | ||
33 | +#define rpmatch(line) \ | ||
34 | + ( (line == NULL)? -1 : \ | ||
35 | + (*line == 'y' || *line == 'Y')? 1 : \ | ||
36 | + (*line == 'n' || *line == 'N')? 0 : \ | ||
37 | + -1 ) | ||
38 | +#endif | ||
39 | + | ||
40 | /* Retrofit glibc __progname */ | ||
41 | #if defined __GLIBC__ && __GLIBC__ >= 2 | ||
42 | #if __GLIBC_MINOR__ >= 1 | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch new file mode 100644 index 0000000000..f29866b934 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch | |||
@@ -0,0 +1,194 @@ | |||
1 | Add an "rpmdeps-oecore" binary which allows batch processing of individual file | ||
2 | dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing | ||
3 | each line of output with the filename that has the dependency. | ||
4 | |||
5 | This is much faster than individually calling rpmdeps on each file. | ||
6 | |||
7 | This binary is used by package.bbclass. | ||
8 | |||
9 | Upstream-Status: Inappropriate [OE Specific] | ||
10 | |||
11 | RP 2012/2/7 | ||
12 | |||
13 | --- | ||
14 | tools/Makefile.am | 6 ++- | ||
15 | tools/rpmdeps-oecore.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++ | ||
16 | 2 files changed, 152 insertions(+), 1 deletions(-) | ||
17 | create mode 100644 tools/rpmdeps-oecore.c | ||
18 | |||
19 | Index: rpm-5.4.9/tools/Makefile.am | ||
20 | =================================================================== | ||
21 | --- rpm-5.4.9.orig/tools/Makefile.am | ||
22 | +++ rpm-5.4.9/tools/Makefile.am | ||
23 | @@ -58,7 +58,7 @@ pkgbin_PROGRAMS = \ | ||
24 | @WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \ | ||
25 | @WITH_SEMANAGE_SEMODULE@ wget \ | ||
26 | rpmcache rpmdigest rpmrepo rpmspecdump \ | ||
27 | - rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ | ||
28 | + rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ | ||
29 | if WITH_DB | ||
30 | pkgbin_PROGRAMS += dbconvert | ||
31 | endif | ||
32 | @@ -168,6 +168,10 @@ rpmdeps_SOURCES = rpmdeps.c | ||
33 | rpmdeps_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
34 | rpmdeps_LDADD = $(RPM_LDADD_COMMON) | ||
35 | |||
36 | +rpmdeps_oecore_SOURCES = rpmdeps-oecore.c | ||
37 | +rpmdeps_oecore_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
38 | +rpmdeps_oecore_LDADD = $(RPM_LDADD_COMMON) | ||
39 | + | ||
40 | rpmdigest_SOURCES = rpmdigest.c | ||
41 | rpmdigest_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
42 | rpmdigest_LDADD = $(RPMIO_LDADD_COMMON) | ||
43 | Index: rpm-5.4.9/tools/rpmdeps-oecore.c | ||
44 | =================================================================== | ||
45 | --- /dev/null | ||
46 | +++ rpm-5.4.9/tools/rpmdeps-oecore.c | ||
47 | @@ -0,0 +1,147 @@ | ||
48 | +#include "system.h" | ||
49 | +const char *__progname; | ||
50 | + | ||
51 | +#include <rpmio.h> | ||
52 | +#include <rpmiotypes.h> | ||
53 | +#include <rpmcb.h> | ||
54 | +#include <argv.h> | ||
55 | +#include <rpmtypes.h> | ||
56 | +#include <rpmtag.h> | ||
57 | + | ||
58 | +#include <rpmds.h> | ||
59 | +#define _RPMFC_INTERNAL /* XXX for debugging */ | ||
60 | +#include <rpmfc.h> | ||
61 | + | ||
62 | +#include <rpmcli.h> | ||
63 | + | ||
64 | +#include "debug.h" | ||
65 | + | ||
66 | +/*@unchecked@*/ | ||
67 | +char *progname; | ||
68 | + | ||
69 | +#define RPMDEP_RPMFC 1 | ||
70 | + | ||
71 | +static int rpmdepPrint(char *filename, rpmds ds, FILE * fp) | ||
72 | +{ | ||
73 | + if (fp == NULL) fp = stderr; | ||
74 | + | ||
75 | + ds = rpmdsInit(ds); | ||
76 | + while (rpmdsNext(ds) >= 0) { | ||
77 | + fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2); | ||
78 | + } | ||
79 | + return 0; | ||
80 | +} | ||
81 | + | ||
82 | +static struct poptOption optionsTable[] = { | ||
83 | + | ||
84 | + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, | ||
85 | + N_("Common options:"), | ||
86 | + NULL }, | ||
87 | + | ||
88 | + POPT_AUTOALIAS | ||
89 | + POPT_AUTOHELP | ||
90 | + POPT_TABLEEND | ||
91 | +}; | ||
92 | + | ||
93 | + | ||
94 | +int | ||
95 | +main(int argc, char *argv[]) | ||
96 | +{ | ||
97 | + poptContext optCon; | ||
98 | + ARGV_t av = NULL; | ||
99 | + rpmfc fc = NULL; | ||
100 | + FILE * fp = NULL; | ||
101 | + int flags = 0; | ||
102 | + int ac = 0; | ||
103 | + int ec = 1; | ||
104 | + int xx; | ||
105 | + int i; | ||
106 | + char buf[BUFSIZ]; | ||
107 | + int nddict; | ||
108 | + const char * s; | ||
109 | + char * se; | ||
110 | + const char * fn; | ||
111 | + const char * N; | ||
112 | + const char * EVR; | ||
113 | + evrFlags Flags; | ||
114 | + unsigned char deptype; | ||
115 | + int ix; | ||
116 | + rpmds ds; | ||
117 | + | ||
118 | +/*@-modobserver@*/ | ||
119 | + if ((progname = strrchr(argv[0], '/')) != NULL) | ||
120 | + progname++; | ||
121 | + else | ||
122 | + progname = argv[0]; | ||
123 | +/*@=modobserver@*/ | ||
124 | + | ||
125 | + optCon = rpmcliInit(argc, argv, optionsTable); | ||
126 | + if (optCon == NULL) | ||
127 | + goto exit; | ||
128 | + | ||
129 | + av = poptGetArgs(optCon); | ||
130 | + ac = argvCount(av); | ||
131 | + | ||
132 | + if (ac == 0) { | ||
133 | + av = NULL; | ||
134 | + xx = argvFgets(&av, NULL); | ||
135 | + ac = argvCount(av); | ||
136 | + } | ||
137 | + | ||
138 | + /* Make sure file names are sorted. */ | ||
139 | + xx = argvSort(av, NULL); | ||
140 | + | ||
141 | + /* Build file class dictionary. */ | ||
142 | + fc = rpmfcNew(); | ||
143 | + xx = rpmfcClassify(fc, av, NULL); | ||
144 | + | ||
145 | + /* Build file/package dependency dictionary. */ | ||
146 | + xx = rpmfcApply(fc); | ||
147 | + | ||
148 | + /* Generate per-file indices into package dependencies. */ | ||
149 | + nddict = argvCount(fc->ddict); | ||
150 | + | ||
151 | + for (i = 0; i < nddict; i++) { | ||
152 | + s = fc->ddict[i]; | ||
153 | + | ||
154 | + /* Parse out (file#,deptype,N,EVR,Flags) */ | ||
155 | + ix = strtol(s, &se, 10); | ||
156 | + assert(se != NULL); | ||
157 | + deptype = *se++; | ||
158 | + se++; | ||
159 | + N = se; | ||
160 | + while (*se && *se != ' ') | ||
161 | + se++; | ||
162 | + *se++ = '\0'; | ||
163 | + EVR = se; | ||
164 | + while (*se && *se != ' ') | ||
165 | + se++; | ||
166 | + *se++ = '\0'; | ||
167 | + Flags = strtol(se, NULL, 16); | ||
168 | + | ||
169 | + switch (deptype) { | ||
170 | + default: | ||
171 | + /*@switchbreak@*/ break; | ||
172 | + case 'P': | ||
173 | + ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); | ||
174 | + rpmdepPrint((char *)fc->fn[ix], ds, stdout); | ||
175 | + (void)rpmdsFree(ds); | ||
176 | + ds = NULL; | ||
177 | + /*@switchbreak@*/ break; | ||
178 | + case 'R': | ||
179 | + ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags); | ||
180 | + rpmdepPrint((char *)fc->fn[ix], ds, stdout); | ||
181 | + (void)rpmdsFree(ds); | ||
182 | + ds = NULL; | ||
183 | + /*@switchbreak@*/ break; | ||
184 | + } | ||
185 | + } | ||
186 | + | ||
187 | + fc = rpmfcFree(fc); | ||
188 | + | ||
189 | + ec = 0; | ||
190 | + | ||
191 | +exit: | ||
192 | + optCon = rpmcliFini(optCon); | ||
193 | + return ec; | ||
194 | +} | ||
diff --git a/meta/recipes-devtools/rpm/rpm/uclibc-support.patch b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch new file mode 100644 index 0000000000..64746ce224 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | Define the x* wrappers for uclibc as well | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | |||
7 | Index: rpm-5.4.9/rpmio/rpmio.h | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.9.orig/rpmio/rpmio.h 2010-09-29 07:54:30.000000000 -0700 | ||
10 | +++ rpm-5.4.9/rpmio/rpmio.h 2012-06-12 07:29:19.610745014 -0700 | ||
11 | @@ -23,7 +23,8 @@ | ||
12 | */ | ||
13 | /*@{*/ | ||
14 | #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \ | ||
15 | - (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) | ||
16 | + (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \ | ||
17 | + !defined(__UCLIBC__) | ||
18 | #define USE_COOKIE_SEEK_POINTER 1 | ||
19 | typedef _IO_off64_t _libio_off_t; | ||
20 | typedef _libio_off_t * _libio_pos_t; | ||
21 | Index: rpm-5.4.9/system.h | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.9.orig/system.h 2012-04-26 10:46:49.000000000 -0700 | ||
24 | +++ rpm-5.4.9/system.h 2012-06-12 07:30:08.242747422 -0700 | ||
25 | @@ -410,7 +410,7 @@ | ||
26 | #endif /* defined(__LCLINT__) */ | ||
27 | |||
28 | /* Memory allocation via macro defs to get meaningful locations from mtrace() */ | ||
29 | -#if defined(__GNUC__) | ||
30 | +#if defined(__GNUC__) || defined(__UCLIBC__) | ||
31 | #define xmalloc(_size) (malloc(_size) ? : vmefail(_size)) | ||
32 | #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail(_size)) | ||
33 | #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail(_size)) | ||
34 | Index: rpm-5.4.9/lib/librpm.vers | ||
35 | =================================================================== | ||
36 | --- rpm-5.4.9.orig/lib/librpm.vers 2011-04-10 15:55:23.000000000 -0700 | ||
37 | +++ rpm-5.4.9/lib/librpm.vers 2012-06-12 07:29:19.610745014 -0700 | ||
38 | @@ -405,6 +405,10 @@ | ||
39 | specedit; | ||
40 | strict_erasures; | ||
41 | XrpmtsiInit; | ||
42 | + xmalloc; | ||
43 | + xrealloc; | ||
44 | + xcalloc; | ||
45 | + xstrdup; | ||
46 | local: | ||
47 | *; | ||
48 | }; | ||
49 | Index: rpm-5.4.9/rpmio/librpmio.vers | ||
50 | =================================================================== | ||
51 | --- rpm-5.4.9.orig/rpmio/librpmio.vers 2012-05-07 07:38:23.000000000 -0700 | ||
52 | +++ rpm-5.4.9/rpmio/librpmio.vers 2012-06-12 07:29:19.626745024 -0700 | ||
53 | @@ -994,6 +994,10 @@ | ||
54 | mongo_simple_int_command; | ||
55 | mongo_simple_str_command; | ||
56 | mongo_update; | ||
57 | + xmalloc; | ||
58 | + xrealloc; | ||
59 | + xcalloc; | ||
60 | + xstrdup; | ||
61 | local: | ||
62 | *; | ||
63 | }; | ||
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb new file mode 100644 index 0000000000..dbdab1a5e3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb | |||
@@ -0,0 +1,511 @@ | |||
1 | SUMMARY = "The RPM package management system" | ||
2 | DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \ | ||
3 | package management system capable of installing, uninstalling, \ | ||
4 | verifying, querying, and updating software packages. Each software \ | ||
5 | package consists of an archive of files along with information about \ | ||
6 | the package like its version, a description, etc." | ||
7 | |||
8 | SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages" | ||
9 | DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries." | ||
10 | |||
11 | SUMMARY_${PN}-dev = "Development files for manipulating RPM packages" | ||
12 | DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \ | ||
13 | development files will simplify the process of writing programs that \ | ||
14 | manipulate RPM packages and databases. These files are intended to \ | ||
15 | simplify the process of creating graphical package managers or any \ | ||
16 | other tools that need an intimate knowledge of RPM packages in order \ | ||
17 | to function." | ||
18 | |||
19 | SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration" | ||
20 | DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \ | ||
21 | and configuration common between RPM Package Manager." | ||
22 | |||
23 | SUMMARY_${PN}-build = "Scripts and executable programs used to build packages" | ||
24 | DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \ | ||
25 | that are used to build packages using the RPM Package Manager." | ||
26 | |||
27 | SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages" | ||
28 | DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \ | ||
29 | written in the Python programming language to use the interface \ | ||
30 | supplied by the RPM Package Manager libraries." | ||
31 | |||
32 | SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages" | ||
33 | DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \ | ||
34 | written in the Perl programming language to use the interface \ | ||
35 | supplied by the RPM Package Manager libraries." | ||
36 | |||
37 | SUMMARY_perl-module-rpm-dev = "Development components for perl bindings" | ||
38 | DESCRIPTION_perl-modules-rpm-dev = "Development items such as man pages for use with the Perl \ | ||
39 | language bindings." | ||
40 | |||
41 | HOMEPAGE = "http://rpm5.org/" | ||
42 | LICENSE = "LGPLv2.1" | ||
43 | LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" | ||
44 | |||
45 | DEPENDS = "libpcre attr acl popt ossp-uuid file bison-native" | ||
46 | PR = "r63" | ||
47 | |||
48 | # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed | ||
49 | # in order to extract the distribution SRPM into a format we can extract... | ||
50 | SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;extract=rpm-5.4.9.tar.gz \ | ||
51 | file://rpm-log-auto-rm.patch \ | ||
52 | file://rpm-db-reduce.patch \ | ||
53 | file://perfile_rpmdeps.sh \ | ||
54 | file://rpm-autogen.patch \ | ||
55 | file://rpm-libsql-fix.patch \ | ||
56 | file://header-include-fix.patch \ | ||
57 | file://rpm-platform.patch \ | ||
58 | file://rpm-showrc.patch \ | ||
59 | file://rpm-solvedb.patch \ | ||
60 | file://rpm-tools-mtree-LDFLAGS.patch \ | ||
61 | file://rpm-fileclass.patch \ | ||
62 | file://rpm-canonarch.patch \ | ||
63 | file://rpm-no-loopmsg.patch \ | ||
64 | file://rpm-scriptletexechelper.patch \ | ||
65 | file://pythondeps.sh \ | ||
66 | file://rpmdeps-oecore.patch \ | ||
67 | file://rpm-resolvedep.patch \ | ||
68 | file://rpm-respect-arch.patch \ | ||
69 | file://rpm-no-perl-urpm.patch \ | ||
70 | file://rpm-macros.patch \ | ||
71 | file://rpm-lua.patch \ | ||
72 | file://rpm-ossp-uuid.patch \ | ||
73 | file://rpm-packageorigin.patch \ | ||
74 | file://rpm-pkgconfigdeps.patch \ | ||
75 | file://uclibc-support.patch \ | ||
76 | file://rpmatch.patch \ | ||
77 | file://fstack-protector-configure-check.patch \ | ||
78 | file://dbconvert.patch \ | ||
79 | file://rpm-uuid-include.patch \ | ||
80 | file://makefile-am-exec-hook.patch \ | ||
81 | file://rpm-stub-out-git_strerror.patch \ | ||
82 | file://rpm-db_buffer_small.patch \ | ||
83 | file://rpm-py-init.patch \ | ||
84 | file://python-rpm-rpmsense.patch \ | ||
85 | file://rpm-reloc-macros.patch \ | ||
86 | file://rpm-platform2.patch \ | ||
87 | file://rpm-remove-sykcparse-decl.patch \ | ||
88 | file://debugedit-segv.patch \ | ||
89 | file://debugedit-valid-file-to-fix-segment-fault.patch \ | ||
90 | file://rpm-platform-file-fix.patch \ | ||
91 | file://rpm-lsb-compatibility.patch \ | ||
92 | file://rpm-tag-generate-endian-conversion-fix.patch \ | ||
93 | " | ||
94 | |||
95 | # Uncomment the following line to enable platform score debugging | ||
96 | # This is useful when identifying issues with Smart being unable | ||
97 | # to process certain package feeds. | ||
98 | #SRC_URI += "file://rpm-debug-platform.patch" | ||
99 | |||
100 | SRC_URI[md5sum] = "60d56ace884340c1b3fcac6a1d58e768" | ||
101 | SRC_URI[sha256sum] = "bac7cc5bd9d0e8262fdc0099349924608da8f680f5cb243751f696552239dde8" | ||
102 | |||
103 | inherit autotools gettext | ||
104 | |||
105 | acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" | ||
106 | |||
107 | # Specify the default rpm macros in terms of adjustable variables | ||
108 | rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros" | ||
109 | rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
110 | rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
111 | |||
112 | # sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux | ||
113 | |||
114 | # Note: perl and sqlite w/o db specified does not currently work. | ||
115 | # tcl, augeas, nss, gcrypt, xar and keyutils support is untested. | ||
116 | PACKAGECONFIG ??= "db bzip2 zlib beecrypt openssl libelf python" | ||
117 | |||
118 | PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2," | ||
119 | PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz," | ||
120 | PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib," | ||
121 | PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar," | ||
122 | |||
123 | WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \ | ||
124 | --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \ | ||
125 | --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
126 | --without-pythonembed" | ||
127 | PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python," | ||
128 | |||
129 | # Perl modules are not built, but they could be enabled fairly easily | ||
130 | # the perl module creation and installation would need to be patched. | ||
131 | # (currently has host perl contamination issues) | ||
132 | WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm" | ||
133 | WITHOUT_PERL = "--without-perl --without-perl-urpm" | ||
134 | PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl," | ||
135 | |||
136 | # The --with-dbsql will only tell RPM to check for support, db | ||
137 | # may or may not be built w/ the dbsql support. | ||
138 | WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated" | ||
139 | PACKAGECONFIG[db] = "${WITH_DB},--without-db,db," | ||
140 | |||
141 | PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3," | ||
142 | |||
143 | PACKAGECONFIG[beecrypt] = "--with-beecrypt,--without-beecrypt,beecrypt," | ||
144 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," | ||
145 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss," | ||
146 | PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt," | ||
147 | PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils," | ||
148 | PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils," | ||
149 | |||
150 | WITH_SELINUX = "--with-selinux --with-sepol --with-semanage" | ||
151 | WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage" | ||
152 | PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux," | ||
153 | |||
154 | WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi" | ||
155 | WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi" | ||
156 | PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat," | ||
157 | |||
158 | PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat," | ||
159 | PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl," | ||
160 | |||
161 | PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas," | ||
162 | |||
163 | EXTRA_OECONF += "--verbose \ | ||
164 | --sysconfdir=${sysconfdir} \ | ||
165 | --with-file \ | ||
166 | --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \ | ||
167 | --with-syck=internal \ | ||
168 | --without-readline \ | ||
169 | --without-libtasn1 \ | ||
170 | --without-pakchois \ | ||
171 | --without-gnutls \ | ||
172 | --with-pcre \ | ||
173 | --enable-utf8 \ | ||
174 | --with-uuid \ | ||
175 | --with-attr \ | ||
176 | --with-acl \ | ||
177 | --with-popt=external \ | ||
178 | --with-pthreads \ | ||
179 | --without-cudf \ | ||
180 | --without-ficl \ | ||
181 | --without-aterm \ | ||
182 | --without-nix \ | ||
183 | --without-bash \ | ||
184 | --without-rc \ | ||
185 | --without-js \ | ||
186 | --without-gpsee \ | ||
187 | --without-ruby \ | ||
188 | --without-squirrel \ | ||
189 | --with-build-extlibdep \ | ||
190 | --with-build-maxextlibdep \ | ||
191 | --without-valgrind \ | ||
192 | --disable-openmp \ | ||
193 | --enable-build-pic \ | ||
194 | --enable-build-versionscript \ | ||
195 | --enable-build-warnings \ | ||
196 | --enable-build-debug \ | ||
197 | --enable-maintainer-mode \ | ||
198 | --with-path-macros=${rpm_macros} \ | ||
199 | --with-path-lib=${libdir}/rpm \ | ||
200 | --with-bugreport=http://bugzilla.yoctoproject.org \ | ||
201 | --program-prefix=" | ||
202 | |||
203 | CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE" | ||
204 | |||
205 | LDFLAGS_append_libc-uclibc = "-lrt -lpthread" | ||
206 | |||
207 | PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm-dbg python-rpm-staticdev python-rpm-dev python-rpm perl-module-rpm perl-module-rpm-dev ${PN}-locale" | ||
208 | |||
209 | SOLIBS = "5.4.so" | ||
210 | |||
211 | # Based on %files section in the rpm.spec | ||
212 | |||
213 | FILES_${PN} = "${bindir}/rpm \ | ||
214 | ${bindir}/rpmconstant \ | ||
215 | ${libdir}/rpm/rpm.* \ | ||
216 | ${libdir}/rpm/tgpg \ | ||
217 | ${libdir}/rpm/macros \ | ||
218 | ${libdir}/rpm/rpmpopt \ | ||
219 | ${libdir}/rpm/rpm2cpio \ | ||
220 | ${libdir}/rpm/vcheck \ | ||
221 | ${libdir}/rpm/helpers \ | ||
222 | ${libdir}/rpm/qf \ | ||
223 | ${libdir}/rpm/cpuinfo.yaml \ | ||
224 | ${libdir}/rpm/bin/mtree \ | ||
225 | ${libdir}/rpm/bin/rpmkey \ | ||
226 | ${libdir}/rpm/bin/rpmrepo \ | ||
227 | ${libdir}/rpm/bin/rpmrepo.real \ | ||
228 | ${libdir}/rpm/bin/rpmspecdump \ | ||
229 | ${libdir}/rpm/bin/rpmspecdump.real \ | ||
230 | ${libdir}/rpm/bin/wget \ | ||
231 | ${localstatedir}/cache \ | ||
232 | ${localstatedir}/cache/rpm \ | ||
233 | ${localstatedir}/cache/wdj \ | ||
234 | ${localstatedir}/lib \ | ||
235 | ${localstatedir}/lib/rpm \ | ||
236 | ${localstatedir}/lib/wdj \ | ||
237 | ${bindir}/rpm.real \ | ||
238 | ${bindir}/rpmconstant.real \ | ||
239 | ${bindir}/rpm2cpio.real \ | ||
240 | " | ||
241 | |||
242 | FILES_${PN}-dbg += "${libdir}/rpm/.debug \ | ||
243 | ${libdir}/rpm/bin/.debug \ | ||
244 | " | ||
245 | |||
246 | FILES_${PN}-common = "${bindir}/rpm2cpio \ | ||
247 | ${bindir}/gendiff \ | ||
248 | ${sysconfdir}/rpm \ | ||
249 | ${localstatedir}/spool/repackage \ | ||
250 | " | ||
251 | |||
252 | FILES_${PN}-libs = "${libdir}/librpm-*.so \ | ||
253 | ${libdir}/librpmconstant-*.so \ | ||
254 | ${libdir}/librpmdb-*.so \ | ||
255 | ${libdir}/librpmio-*.so \ | ||
256 | ${libdir}/librpmmisc-*.so \ | ||
257 | ${libdir}/librpmbuild-*.so \ | ||
258 | " | ||
259 | |||
260 | RDEPENDS_${PN}-build += "bash" | ||
261 | |||
262 | FILES_${PN}-build = "${prefix}/src/rpm \ | ||
263 | ${bindir}/rpmbuild \ | ||
264 | ${bindir}/rpmbuild.real \ | ||
265 | ${libdir}/rpm/brp-* \ | ||
266 | ${libdir}/rpm/check-files \ | ||
267 | ${libdir}/rpm/cross-build \ | ||
268 | ${libdir}/rpm/find-debuginfo.sh \ | ||
269 | ${libdir}/rpm/find-lang.sh \ | ||
270 | ${libdir}/rpm/find-prov.pl \ | ||
271 | ${libdir}/rpm/find-provides.perl \ | ||
272 | ${libdir}/rpm/find-req.pl \ | ||
273 | ${libdir}/rpm/find-requires.perl \ | ||
274 | ${libdir}/rpm/getpo.sh \ | ||
275 | ${libdir}/rpm/http.req \ | ||
276 | ${libdir}/rpm/javadeps.sh \ | ||
277 | ${libdir}/rpm/mono-find-provides \ | ||
278 | ${libdir}/rpm/mono-find-requires \ | ||
279 | ${libdir}/rpm/executabledeps.sh \ | ||
280 | ${libdir}/rpm/libtooldeps.sh \ | ||
281 | ${libdir}/rpm/osgideps.pl \ | ||
282 | ${libdir}/rpm/perldeps.pl \ | ||
283 | ${libdir}/rpm/perl.prov \ | ||
284 | ${libdir}/rpm/perl.req \ | ||
285 | ${libdir}/rpm/php.prov \ | ||
286 | ${libdir}/rpm/php.req \ | ||
287 | ${libdir}/rpm/pkgconfigdeps.sh \ | ||
288 | ${libdir}/rpm/pythondeps.sh \ | ||
289 | ${libdir}/rpm/bin/debugedit \ | ||
290 | ${libdir}/rpm/bin/debugedit.real \ | ||
291 | ${libdir}/rpm/bin/rpmcache \ | ||
292 | ${libdir}/rpm/bin/rpmcache.real \ | ||
293 | ${libdir}/rpm/bin/rpmcmp \ | ||
294 | ${libdir}/rpm/bin/rpmcmp.real \ | ||
295 | ${libdir}/rpm/bin/rpmdeps \ | ||
296 | ${libdir}/rpm/bin/rpmdeps.real \ | ||
297 | ${libdir}/rpm/bin/rpmdeps-oecore \ | ||
298 | ${libdir}/rpm/bin/rpmdeps-oecore.real \ | ||
299 | ${libdir}/rpm/bin/rpmdigest \ | ||
300 | ${libdir}/rpm/bin/rpmdigest.real \ | ||
301 | ${libdir}/rpm/bin/abi-compliance-checker.pl \ | ||
302 | ${libdir}/rpm/bin/api-sanity-autotest.pl \ | ||
303 | ${libdir}/rpm/bin/chroot \ | ||
304 | ${libdir}/rpm/bin/cp \ | ||
305 | ${libdir}/rpm/bin/dbsql \ | ||
306 | ${libdir}/rpm/bin/find \ | ||
307 | ${libdir}/rpm/bin/install-sh \ | ||
308 | ${libdir}/rpm/bin/lua \ | ||
309 | ${libdir}/rpm/bin/luac \ | ||
310 | ${libdir}/rpm/bin/mkinstalldirs \ | ||
311 | ${libdir}/rpm/bin/rpmlua \ | ||
312 | ${libdir}/rpm/bin/rpmluac \ | ||
313 | ${libdir}/rpm/bin/sqlite3 \ | ||
314 | ${libdir}/rpm/macros.d/cmake \ | ||
315 | ${libdir}/rpm/macros.d/java \ | ||
316 | ${libdir}/rpm/macros.d/libtool \ | ||
317 | ${libdir}/rpm/macros.d/mandriva \ | ||
318 | ${libdir}/rpm/macros.d/mono \ | ||
319 | ${libdir}/rpm/macros.d/perl \ | ||
320 | ${libdir}/rpm/macros.d/php \ | ||
321 | ${libdir}/rpm/macros.d/pkgconfig \ | ||
322 | ${libdir}/rpm/macros.d/python \ | ||
323 | ${libdir}/rpm/macros.d/ruby \ | ||
324 | ${libdir}/rpm/macros.d/selinux \ | ||
325 | ${libdir}/rpm/macros.d/tcl \ | ||
326 | ${libdir}/rpm/macros.rpmbuild \ | ||
327 | ${libdir}/rpm/u_pkg.sh \ | ||
328 | ${libdir}/rpm/vpkg-provides.sh \ | ||
329 | ${libdir}/rpm/vpkg-provides2.sh \ | ||
330 | ${libdir}/rpm/perfile_rpmdeps.sh \ | ||
331 | " | ||
332 | RDEPENDS_${PN} = "base-files run-postinsts" | ||
333 | RDEPENDS_${PN}_class-native = "" | ||
334 | RDEPENDS_${PN}_class-nativesdk = "" | ||
335 | RDEPENDS_${PN}-build = "file" | ||
336 | |||
337 | RDEPENDS_python-rpm = "${PN}" | ||
338 | |||
339 | FILES_python-rpm-dbg = "${libdir}/python*/site-packages/rpm/.debug/_*" | ||
340 | FILES_python-rpm-dev = "${libdir}/python*/site-packages/rpm/*.la" | ||
341 | FILES_python-rpm-staticdev = "${libdir}/python*/site-packages/rpm/*.a" | ||
342 | FILES_python-rpm = "${libdir}/python*/site-packages/rpm" | ||
343 | |||
344 | FILES_perl-module-rpm = "${libdir}/perl/*/* \ | ||
345 | " | ||
346 | |||
347 | FILES_perl-module-rpm-dev = "${prefix}/share/man/man3/RPM* \ | ||
348 | " | ||
349 | |||
350 | RDEPENDS_${PN}-dev += "bash" | ||
351 | |||
352 | FILES_${PN}-dev = "${includedir}/rpm \ | ||
353 | ${libdir}/librpm.la \ | ||
354 | ${libdir}/librpm.so \ | ||
355 | ${libdir}/librpmconstant.la \ | ||
356 | ${libdir}/librpmconstant.so \ | ||
357 | ${libdir}/librpmdb.la \ | ||
358 | ${libdir}/librpmdb.so \ | ||
359 | ${libdir}/librpmio.la \ | ||
360 | ${libdir}/librpmio.so \ | ||
361 | ${libdir}/librpmmisc.la \ | ||
362 | ${libdir}/librpmmisc.so \ | ||
363 | ${libdir}/librpmbuild.la \ | ||
364 | ${libdir}/librpmbuild.so \ | ||
365 | ${libdir}/rpm/lib/liblua.la \ | ||
366 | ${libdir}/pkgconfig/rpm.pc \ | ||
367 | ${libdir}/rpm/rpmdb_loadcvt \ | ||
368 | " | ||
369 | |||
370 | FILES_${PN}-staticdev = " \ | ||
371 | ${libdir}/librpm.a \ | ||
372 | ${libdir}/librpmconstant.a \ | ||
373 | ${libdir}/librpmdb.a \ | ||
374 | ${libdir}/librpmio.a \ | ||
375 | ${libdir}/librpmmisc.a \ | ||
376 | ${libdir}/librpmbuild.a \ | ||
377 | ${libdir}/rpm/lib/liblua.a \ | ||
378 | " | ||
379 | |||
380 | do_configure() { | ||
381 | # Disable tests! | ||
382 | echo "all:" > ${S}/tests/Makefile.am | ||
383 | sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in | ||
384 | |||
385 | ( cd ${S}; ${S}/autogen.sh ) | ||
386 | |||
387 | # NASTY hack to make sure configure files the right pkg-config file... | ||
388 | sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \ | ||
389 | -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure | ||
390 | |||
391 | export varprefix=${localstatedir} | ||
392 | oe_runconf | ||
393 | } | ||
394 | |||
395 | do_install_append() { | ||
396 | sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros | ||
397 | sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros | ||
398 | sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
399 | sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
400 | sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros | ||
401 | sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros | ||
402 | |||
403 | # Enable Debian style arbitrary tags... | ||
404 | sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros | ||
405 | |||
406 | install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh | ||
407 | install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh | ||
408 | |||
409 | # Remove unpackaged files (based on list in rpm.spec) | ||
410 | rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm} | ||
411 | |||
412 | rm -f ${D}/${mandir}/man8/rpmcache.8* | ||
413 | rm -f ${D}/${mandir}/man8/rpmgraph.8* | ||
414 | rm -f ${D}/${mandir}/*/man8/rpmcache.8* | ||
415 | rm -f ${D}/${mandir}/*/man8/rpmgraph.8* | ||
416 | rm -rf ${D}/${mandir}/{fr,ko} | ||
417 | |||
418 | rm -f ${D}/${includedir}/popt.h | ||
419 | rm -f ${D}/${libdir}/libpopt.* | ||
420 | rm -f ${D}/${libdir}/pkgconfig/popt.pc | ||
421 | rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo | ||
422 | rm -f ${D}/${mandir}/man3/popt.3 | ||
423 | |||
424 | rm -f ${D}/${mandir}/man1/xar.1* | ||
425 | rm -f ${D}/${bindir}/xar | ||
426 | rm -rf ${D}/${includedir}/xar | ||
427 | rm -f ${D}/${libdir}/libxar* | ||
428 | |||
429 | rm -f ${D}/${bindir}/lz* | ||
430 | rm -f ${D}/${bindir}/unlzma | ||
431 | rm -f ${D}/${bindir}/unxz | ||
432 | rm -f ${D}/${bindir}/xz* | ||
433 | rm -rf ${D}/${includedir}/lzma* | ||
434 | rm -f ${D}/${mandir}/man1/lz*.1 | ||
435 | rm -f ${D}/${libdir}/pkgconfig/liblzma* | ||
436 | |||
437 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la} | ||
438 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la} | ||
439 | |||
440 | #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \ | ||
441 | # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';' | ||
442 | #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';' | ||
443 | |||
444 | # We don't want the default macro set | ||
445 | rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*} | ||
446 | |||
447 | rm -f ${D}/${libdir}/rpm/dbconvert.sh | ||
448 | |||
449 | rm -f ${D}/${libdir}/rpm/libsqldb.* | ||
450 | |||
451 | # We don't want, nor need the Mandriva multiarch items | ||
452 | rm -f ${D}/${bindir}/multiarch-dispatch | ||
453 | rm -f ${D}/${bindir}/multiarch-platform | ||
454 | rm -f ${D}/${libdir}/rpm/check-multiarch-files | ||
455 | rm -f ${D}/${libdir}/rpm/mkmultiarch | ||
456 | rm -f ${D}/${includedir}/multiarch-dispatch.h | ||
457 | |||
458 | rm -f ${D}/${libdir}/rpm/gstreamer.sh | ||
459 | rm -f ${D}/${libdir}/rpm/gem_helper.rb | ||
460 | rm -f ${D}/${libdir}/rpm/rubygems.rb | ||
461 | rm -f ${D}/${libdir}/rpm/kmod-deps.sh | ||
462 | rm -f ${D}/${libdir}/rpm/pythoneggs.py | ||
463 | rm -f ${D}/${libdir}/rpm/macros.d/kernel | ||
464 | rm -f ${D}/${libdir}/rpm/macros.d/gstreamer | ||
465 | rm -f ${D}/${libdir}/rpm/bin/mgo | ||
466 | rm -f ${D}/${libdir}/rpm/bin/dbconvert | ||
467 | rm -f ${D}/${libdir}/rpm/bin/pom2spec | ||
468 | |||
469 | rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj | ||
470 | rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl | ||
471 | |||
472 | } | ||
473 | |||
474 | add_native_wrapper() { | ||
475 | create_wrapper ${D}/${bindir}/rpm \ | ||
476 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
477 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
478 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
479 | |||
480 | create_wrapper ${D}/${bindir}/rpm2cpio \ | ||
481 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
482 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
483 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
484 | |||
485 | create_wrapper ${D}/${bindir}/rpmbuild \ | ||
486 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
487 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
488 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
489 | |||
490 | create_wrapper ${D}/${bindir}/rpmconstant \ | ||
491 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
492 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
493 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
494 | |||
495 | for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do | ||
496 | create_wrapper $rpm_binary \ | ||
497 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
498 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
499 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
500 | done | ||
501 | } | ||
502 | |||
503 | do_install_append_class-native() { | ||
504 | add_native_wrapper | ||
505 | } | ||
506 | |||
507 | do_install_append_class-nativesdk() { | ||
508 | add_native_wrapper | ||
509 | } | ||
510 | |||
511 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c new file mode 100644 index 0000000000..4e9d055f24 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c | |||
@@ -0,0 +1,418 @@ | |||
1 | /* OpenEmbedded RPM resolver utility | ||
2 | |||
3 | Written by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
4 | |||
5 | Copyright 2012 Intel Corporation | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License version 2 as | ||
9 | published by the Free Software Foundation. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License along | ||
17 | with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | |||
20 | */ | ||
21 | |||
22 | #include <ctype.h> | ||
23 | #include <stdio.h> | ||
24 | #include <stdlib.h> | ||
25 | #include <unistd.h> | ||
26 | #include <fcntl.h> | ||
27 | #include <sys/stat.h> | ||
28 | |||
29 | #include <rpmdb.h> | ||
30 | #include <rpmtypes.h> | ||
31 | #include <rpmtag.h> | ||
32 | #include <rpmts.h> | ||
33 | #include <rpmmacro.h> | ||
34 | #include <rpmcb.h> | ||
35 | #include <rpmlog.h> | ||
36 | #include <argv.h> | ||
37 | #include <mire.h> | ||
38 | |||
39 | int debugmode; | ||
40 | FILE *outf; | ||
41 | |||
42 | int getPackageStr(rpmts ts, const char *NVRA, rpmTag tag, char **value) | ||
43 | { | ||
44 | int rc = -1; | ||
45 | rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NVRA, NVRA, 0); | ||
46 | Header h; | ||
47 | if ((h = rpmmiNext(mi)) != NULL) { | ||
48 | HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); | ||
49 | he->tag = tag; | ||
50 | rc = (headerGet(h, he, 0) != 1); | ||
51 | if(rc==0) | ||
52 | *value = strdup((char *)he->p.ptr); | ||
53 | } | ||
54 | (void)rpmmiFree(mi); | ||
55 | return rc; | ||
56 | } | ||
57 | |||
58 | int loadTs(rpmts **ts, int *tsct, const char *dblistfn) | ||
59 | { | ||
60 | int count = 0; | ||
61 | int sz = 5; | ||
62 | int rc = 0; | ||
63 | int listfile = 1; | ||
64 | struct stat st_buf; | ||
65 | |||
66 | rc = stat(dblistfn, &st_buf); | ||
67 | if(rc != 0) { | ||
68 | perror("stat"); | ||
69 | return 1; | ||
70 | } | ||
71 | if(S_ISDIR(st_buf.st_mode)) | ||
72 | listfile = 0; | ||
73 | |||
74 | if(listfile) { | ||
75 | if(debugmode) | ||
76 | printf("DEBUG: reading database list file '%s'\n", dblistfn); | ||
77 | *ts = malloc(sz * sizeof(rpmts)); | ||
78 | FILE *f = fopen(dblistfn, "r" ); | ||
79 | if(f) { | ||
80 | char line[2048]; | ||
81 | while(fgets(line, sizeof(line), f)) { | ||
82 | int len = strlen(line) - 1; | ||
83 | if(len > 0) | ||
84 | // Trim trailing whitespace | ||
85 | while(len > 0 && isspace(line[len])) | ||
86 | line[len--] = '\0'; | ||
87 | |||
88 | if(len > 0) { | ||
89 | // Expand array if needed | ||
90 | if(count == sz) { | ||
91 | sz += 5; | ||
92 | *ts = (rpmts *)realloc(*ts, sz); | ||
93 | } | ||
94 | |||
95 | if(debugmode) | ||
96 | printf("DEBUG: opening database '%s'\n", line); | ||
97 | char *dbpathm = malloc(strlen(line) + 10); | ||
98 | sprintf(dbpathm, "_dbpath %s", line); | ||
99 | rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE); | ||
100 | free(dbpathm); | ||
101 | |||
102 | rpmts tsi = rpmtsCreate(); | ||
103 | (*ts)[count] = tsi; | ||
104 | rc = rpmtsOpenDB(tsi, O_RDONLY); | ||
105 | if( rc ) { | ||
106 | fprintf(stderr, "Failed to open database %s\n", line); | ||
107 | rc = -1; | ||
108 | break; | ||
109 | } | ||
110 | |||
111 | count++; | ||
112 | } | ||
113 | } | ||
114 | fclose(f); | ||
115 | *tsct = count; | ||
116 | } | ||
117 | else { | ||
118 | perror(dblistfn); | ||
119 | rc = -1; | ||
120 | } | ||
121 | } | ||
122 | else { | ||
123 | if(debugmode) | ||
124 | printf("DEBUG: opening database '%s'\n", dblistfn); | ||
125 | // Load from single database | ||
126 | *ts = malloc(sizeof(rpmts)); | ||
127 | char *dbpathm = malloc(strlen(dblistfn) + 10); | ||
128 | sprintf(dbpathm, "_dbpath %s", dblistfn); | ||
129 | rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE); | ||
130 | free(dbpathm); | ||
131 | |||
132 | rpmts tsi = rpmtsCreate(); | ||
133 | (*ts)[0] = tsi; | ||
134 | rc = rpmtsOpenDB(tsi, O_RDONLY); | ||
135 | if( rc ) { | ||
136 | fprintf(stderr, "Failed to open database %s\n", dblistfn); | ||
137 | rc = -1; | ||
138 | } | ||
139 | *tsct = 1; | ||
140 | } | ||
141 | |||
142 | return rc; | ||
143 | } | ||
144 | |||
145 | int processPackages(rpmts *ts, int tscount, const char *packagelistfn, int ignoremissing) | ||
146 | { | ||
147 | int rc = 0; | ||
148 | int count = 0; | ||
149 | int sz = 100; | ||
150 | int i = 0; | ||
151 | int missing = 0; | ||
152 | |||
153 | FILE *f = fopen(packagelistfn, "r" ); | ||
154 | if(f) { | ||
155 | char line[255]; | ||
156 | while(fgets(line, sizeof(line), f)) { | ||
157 | int len = strlen(line) - 1; | ||
158 | if(len > 0) | ||
159 | // Trim trailing whitespace | ||
160 | while(len > 0 && isspace(line[len])) | ||
161 | line[len--] = '\0'; | ||
162 | |||
163 | if(len > 0) { | ||
164 | int found = 0; | ||
165 | for(i=0; i<tscount; i++) { | ||
166 | ARGV_t keys = NULL; | ||
167 | rpmdb db = rpmtsGetRdb(ts[i]); | ||
168 | rc = rpmdbMireApply(db, RPMTAG_NAME, | ||
169 | RPMMIRE_STRCMP, line, &keys); | ||
170 | if (keys) { | ||
171 | int nkeys = argvCount(keys); | ||
172 | if( nkeys == 1 ) { | ||
173 | char *value = NULL; | ||
174 | rc = getPackageStr(ts[i], keys[0], RPMTAG_PACKAGEORIGIN, &value); | ||
175 | if(rc == 0) | ||
176 | fprintf(outf, "%s\n", value); | ||
177 | else | ||
178 | fprintf(stderr, "Failed to get package origin for %s\n", line); | ||
179 | found = 1; | ||
180 | } | ||
181 | else if( nkeys > 1 ) { | ||
182 | int keyindex = 0; | ||
183 | fprintf(stderr, "Multiple matches for %s:\n", line); | ||
184 | for( keyindex=0; keyindex<nkeys; keyindex++) { | ||
185 | char *value = NULL; | ||
186 | rc = getPackageStr(ts[i], keys[keyindex], RPMTAG_PACKAGEORIGIN, &value); | ||
187 | if(rc == 0) | ||
188 | fprintf(stderr, " %s\n", value); | ||
189 | else | ||
190 | fprintf(stderr, " (%s)\n", keys[keyindex]); | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | if(found) | ||
195 | break; | ||
196 | } | ||
197 | |||
198 | if( !found ) { | ||
199 | if( ignoremissing ) { | ||
200 | fprintf(stderr, "Unable to resolve package %s - ignoring\n", line); | ||
201 | } | ||
202 | else { | ||
203 | fprintf(stderr, "Unable to resolve package %s\n", line); | ||
204 | missing = 1; | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | count++; | ||
209 | } | ||
210 | fclose(f); | ||
211 | |||
212 | if( missing ) { | ||
213 | fprintf(stderr, "ERROR: some packages were missing\n"); | ||
214 | rc = 1; | ||
215 | } | ||
216 | } | ||
217 | else { | ||
218 | perror(packagelistfn); | ||
219 | rc = -1; | ||
220 | } | ||
221 | |||
222 | return rc; | ||
223 | } | ||
224 | |||
225 | int lookupProvider(rpmts ts, const char *req, char **provider) | ||
226 | { | ||
227 | int rc = 0; | ||
228 | rpmmi provmi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, req, 0); | ||
229 | if(provmi) { | ||
230 | Header h; | ||
231 | if ((h = rpmmiNext(provmi)) != NULL) { | ||
232 | HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); | ||
233 | he->tag = RPMTAG_NAME; | ||
234 | rc = (headerGet(h, he, 0) != 1); | ||
235 | if(rc==0) | ||
236 | *provider = strdup((char *)he->p.ptr); | ||
237 | } | ||
238 | (void)rpmmiFree(provmi); | ||
239 | } | ||
240 | else { | ||
241 | rc = -1; | ||
242 | } | ||
243 | return rc; | ||
244 | } | ||
245 | |||
246 | int printDepList(rpmts *ts, int tscount) | ||
247 | { | ||
248 | int rc = 0; | ||
249 | |||
250 | if( tscount > 1 ) | ||
251 | fprintf(stderr, ">1 database specified with dependency list, using first only\n"); | ||
252 | |||
253 | /* Get list of names */ | ||
254 | rpmdb db = rpmtsGetRdb(ts[0]); | ||
255 | ARGV_t names = NULL; | ||
256 | rc = rpmdbMireApply(db, RPMTAG_NAME, | ||
257 | RPMMIRE_STRCMP, NULL, &names); | ||
258 | int nnames = argvCount(names); | ||
259 | |||
260 | /* Get list of NVRAs */ | ||
261 | ARGV_t keys = NULL; | ||
262 | rc = rpmdbMireApply(db, RPMTAG_NVRA, | ||
263 | RPMMIRE_STRCMP, NULL, &keys); | ||
264 | if (keys) { | ||
265 | int i, j; | ||
266 | HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); | ||
267 | int nkeys = argvCount(keys); | ||
268 | for(i=0; i<nkeys; i++) { | ||
269 | rpmmi mi = rpmtsInitIterator(ts[0], RPMTAG_NVRA, keys[i], 0); | ||
270 | Header h; | ||
271 | if ((h = rpmmiNext(mi)) != NULL) { | ||
272 | /* Get name of package */ | ||
273 | he->tag = RPMTAG_NAME; | ||
274 | rc = (headerGet(h, he, 0) != 1); | ||
275 | char *name = strdup((char *)he->p.ptr); | ||
276 | /* Get its requires */ | ||
277 | he->tag = RPMTAG_REQUIRENAME; | ||
278 | rc = (headerGet(h, he, 0) != 1); | ||
279 | ARGV_t reqs = (ARGV_t)he->p.ptr; | ||
280 | /* Get its requireflags */ | ||
281 | he->tag = RPMTAG_REQUIREFLAGS; | ||
282 | rc = (headerGet(h, he, 0) != 1); | ||
283 | rpmuint32_t *reqflags = (rpmuint32_t *)he->p.ui32p; | ||
284 | for(j=0; j<he->c; j++) { | ||
285 | int k; | ||
286 | char *prov = NULL; | ||
287 | for(k=0; k<nnames; k++) { | ||
288 | if(strcmp(names[k], reqs[j]) == 0) { | ||
289 | prov = names[k]; | ||
290 | break; | ||
291 | } | ||
292 | } | ||
293 | if(prov) { | ||
294 | if((int)reqflags[j] & 0x80000) | ||
295 | fprintf(outf, "%s|%s [REC]\n", name, prov); | ||
296 | else | ||
297 | fprintf(outf, "%s|%s\n", name, prov); | ||
298 | } | ||
299 | else { | ||
300 | rc = lookupProvider(ts[0], reqs[j], &prov); | ||
301 | if(rc==0 && prov) { | ||
302 | if((int)reqflags[j] & 0x80000) | ||
303 | fprintf(outf, "%s|%s [REC]\n", name, prov); | ||
304 | else | ||
305 | fprintf(outf, "%s|%s\n", name, prov); | ||
306 | free(prov); | ||
307 | } | ||
308 | } | ||
309 | } | ||
310 | free(name); | ||
311 | } | ||
312 | (void)rpmmiFree(mi); | ||
313 | } | ||
314 | } | ||
315 | |||
316 | return rc; | ||
317 | } | ||
318 | |||
319 | void usage() | ||
320 | { | ||
321 | fprintf(stderr, "OpenEmbedded rpm resolver utility\n"); | ||
322 | fprintf(stderr, "syntax: rpmresolve [-i] [-d] [-t] <dblistfile> <packagelistfile>\n"); | ||
323 | } | ||
324 | |||
325 | int main(int argc, char **argv) | ||
326 | { | ||
327 | rpmts *ts = NULL; | ||
328 | int tscount = 0; | ||
329 | int rc = 0; | ||
330 | int i; | ||
331 | int c; | ||
332 | int ignoremissing = 0; | ||
333 | int deplistmode = 0; | ||
334 | char *outfile = NULL; | ||
335 | |||
336 | debugmode = 0; | ||
337 | outf = stdout; | ||
338 | |||
339 | opterr = 0; | ||
340 | while ((c = getopt (argc, argv, "itdo:")) != -1) { | ||
341 | switch (c) { | ||
342 | case 'i': | ||
343 | ignoremissing = 1; | ||
344 | break; | ||
345 | case 't': | ||
346 | deplistmode = 1; | ||
347 | break; | ||
348 | case 'd': | ||
349 | debugmode = 1; | ||
350 | break; | ||
351 | case 'o': | ||
352 | outfile = strdup(optarg); | ||
353 | break; | ||
354 | case '?': | ||
355 | if(isprint(optopt)) | ||
356 | fprintf(stderr, "Unknown option `-%c'.\n", optopt); | ||
357 | else | ||
358 | fprintf(stderr, "Unknown option character `\\x%x'.\n", | ||
359 | optopt); | ||
360 | usage(); | ||
361 | return 1; | ||
362 | default: | ||
363 | abort(); | ||
364 | } | ||
365 | } | ||
366 | |||
367 | if( argc - optind < 1 ) { | ||
368 | usage(); | ||
369 | return 1; | ||
370 | } | ||
371 | |||
372 | if( outfile ) { | ||
373 | if(debugmode) | ||
374 | printf("DEBUG: Using output file %s\n", outfile); | ||
375 | outf = fopen(outfile, "w"); | ||
376 | } | ||
377 | |||
378 | const char *dblistfn = argv[optind]; | ||
379 | |||
380 | rpmcliInit(argc, argv, NULL); | ||
381 | |||
382 | if(debugmode) | ||
383 | rpmSetVerbosity(RPMLOG_DEBUG); | ||
384 | |||
385 | rpmDefineMacro(NULL, "__dbi_txn create nofsync", RMIL_CMDLINE); | ||
386 | |||
387 | rc = loadTs(&ts, &tscount, dblistfn); | ||
388 | if( rc ) | ||
389 | return 1; | ||
390 | if( tscount == 0 ) { | ||
391 | fprintf(stderr, "Please specify database list file or database location\n"); | ||
392 | return 1; | ||
393 | } | ||
394 | |||
395 | if(deplistmode) { | ||
396 | rc = printDepList(ts, tscount); | ||
397 | } | ||
398 | else { | ||
399 | if( argc - optind < 2 ) { | ||
400 | fprintf(stderr, "Please specify package list file\n"); | ||
401 | } | ||
402 | else { | ||
403 | const char *pkglistfn = argv[optind+1]; | ||
404 | rc = processPackages(ts, tscount, pkglistfn, ignoremissing); | ||
405 | } | ||
406 | } | ||
407 | |||
408 | for(i=0; i<tscount; i++) | ||
409 | (void) rpmtsCloseDB(ts[i]); | ||
410 | free(ts); | ||
411 | |||
412 | if( outfile ) { | ||
413 | fclose(outf); | ||
414 | free(outfile); | ||
415 | } | ||
416 | |||
417 | return rc; | ||
418 | } | ||
diff --git a/meta/recipes-devtools/rpm/rpmresolve_1.0.bb b/meta/recipes-devtools/rpm/rpmresolve_1.0.bb new file mode 100644 index 0000000000..04a55fd480 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpmresolve_1.0.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | SUMMARY = "OpenEmbedded RPM resolver utility" | ||
2 | DESCRIPTION = "OpenEmbedded RPM resolver - performs RPM database lookups in batches to avoid \ | ||
3 | repeated invocations of rpm on the command line." | ||
4 | DEPENDS = "rpm" | ||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
7 | PR = "r2" | ||
8 | |||
9 | SRC_URI = "file://rpmresolve.c" | ||
10 | |||
11 | S = "${WORKDIR}" | ||
12 | |||
13 | do_compile() { | ||
14 | ${CC} ${CFLAGS} -ggdb -I${STAGING_INCDIR}/rpm ${LDFLAGS} rpmresolve.c -o rpmresolve -lrpmbuild -lrpm -lrpmio -lrpmdb -lpopt | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d ${D}${bindir} | ||
19 | install -m 0755 rpmresolve ${D}${bindir} | ||
20 | } | ||
21 | |||
22 | do_install_append_class-native() { | ||
23 | create_wrapper ${D}/${bindir}/rpmresolve \ | ||
24 | RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \ | ||
25 | RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \ | ||
26 | RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale | ||
27 | } | ||
28 | |||
29 | BBCLASSEXTEND = "native nativesdk" | ||