diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-devtools/rpm | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/rpm')
67 files changed, 5208 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch new file mode 100644 index 0000000000..b877870411 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Upstream-Status: Inappropriate [OE-Specific] | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
5 | |||
6 | diff --git a/python/rpmmodule.c b/python/rpmmodule.c | ||
7 | index a4fe217..728c66c 100644 | ||
8 | --- a/python/rpmmodule.c | ||
9 | +++ b/python/rpmmodule.c | ||
10 | @@ -396,6 +396,10 @@ static int initModule(PyObject *m) | ||
11 | REGISTER_ENUM(RPMSENSE_STRONG); | ||
12 | REGISTER_ENUM(RPMSENSE_CONFIG); | ||
13 | |||
14 | +#if defined(RPM_VENDOR_OE) | ||
15 | + REGISTER_ENUM(RPMSENSE_MISSINGOK); | ||
16 | +#endif | ||
17 | + | ||
18 | REGISTER_ENUM(RPMTRANS_FLAG_TEST); | ||
19 | REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS); | ||
20 | REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS); | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch new file mode 100644 index 0000000000..7a646de373 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
5 | |||
6 | |||
7 | Index: rpm-4.11.2/build/pack.c | ||
8 | =================================================================== | ||
9 | --- rpm-4.11.2.orig/build/pack.c | ||
10 | +++ rpm-4.11.2/build/pack.c | ||
11 | @@ -571,9 +571,9 @@ rpmRC packageBinaries(rpmSpec spec, cons | ||
12 | headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); | ||
13 | } | ||
14 | |||
15 | - if (cheating) { | ||
16 | - (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); | ||
17 | - } | ||
18 | +// if (cheating) { | ||
19 | +// (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); | ||
20 | +// } | ||
21 | |||
22 | { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); | ||
23 | char *binRpm, *binDir; | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch new file mode 100644 index 0000000000..be0626c8b3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Upstream-Status: Inappropriate [OE-Core specific] | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
5 | |||
6 | |||
7 | diff --git a/installplatform b/installplatform | ||
8 | index 8c3eba0..fa15e91 100755 | ||
9 | --- a/installplatform | ||
10 | +++ b/installplatform | ||
11 | @@ -112,7 +112,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do | ||
12 | [ -z "$CANONARCH" ] && continue | ||
13 | |||
14 | if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then | ||
15 | - LIB=${LIB}64 | ||
16 | + LIB=${LIB} | ||
17 | fi | ||
18 | |||
19 | PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}" | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh b/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh new file mode 100755 index 0000000000..083b174f17 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/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-4.11.2/remove-db3-from-configure.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch new file mode 100644 index 0000000000..2640e54b5b --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | |||
2 | Disable configuring the db3 directory since we will be using the | ||
3 | external DB provided as part of OE-Core already, no need to have | ||
4 | duplicate database code. | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE-Core Specific] | ||
7 | |||
8 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
9 | |||
10 | Index: rpm-4.11.2/configure.ac | ||
11 | =================================================================== | ||
12 | --- rpm-4.11.2.orig/configure.ac | ||
13 | +++ rpm-4.11.2/configure.ac | ||
14 | @@ -825,9 +825,9 @@ AC_SUBST(RPMCONFIGDIR) | ||
15 | |||
16 | AC_SUBST(OBJDUMP) | ||
17 | |||
18 | -if test "$with_external_db" = no; then | ||
19 | - AC_CONFIG_SUBDIRS(db3) | ||
20 | -fi | ||
21 | +#if test "$with_external_db" = no; then | ||
22 | +# AC_CONFIG_SUBDIRS(db3) | ||
23 | +#fi | ||
24 | |||
25 | AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no]) | ||
26 | AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no]) | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch new file mode 100644 index 0000000000..f1ecab7b0e --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
5 | |||
6 | |||
7 | Index: rpm-4.11.2/build/files.c | ||
8 | =================================================================== | ||
9 | --- rpm-4.11.2.orig/build/files.c | ||
10 | +++ rpm-4.11.2/build/files.c | ||
11 | @@ -1321,12 +1321,6 @@ static rpmRC addFile(FileList fl, const | ||
12 | } | ||
13 | } | ||
14 | |||
15 | - /* Error out when a non-directory is specified as one in spec */ | ||
16 | - if (fl->cur.isDir && (statp == &statbuf) && !S_ISDIR(statp->st_mode)) { | ||
17 | - rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath); | ||
18 | - goto exit; | ||
19 | - } | ||
20 | - | ||
21 | /* Don't recurse into explicit %dir, don't double-recurse from fts */ | ||
22 | if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) { | ||
23 | return recurseDir(fl, diskPath); | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch new file mode 100644 index 0000000000..9333dea441 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch | |||
@@ -0,0 +1,194 @@ | |||
1 | Upstream-Status: Inappropriate [OE-Core] | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
5 | |||
6 | |||
7 | Index: rpm-4.11.2/lib/psm.c | ||
8 | =================================================================== | ||
9 | --- rpm-4.11.2.orig/lib/psm.c | ||
10 | +++ rpm-4.11.2/lib/psm.c | ||
11 | @@ -421,7 +421,8 @@ static rpmRC runScript(rpmpsm psm, ARGV_ | ||
12 | |||
13 | rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); | ||
14 | rc = rpmScriptRun(script, arg1, arg2, sfd, | ||
15 | - prefixes, warn_only, selinux); | ||
16 | + prefixes, warn_only, selinux, rpmtsRootDir(psm->ts) ); | ||
17 | + | ||
18 | rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); | ||
19 | |||
20 | /* Map warn-only errors to "notfound" for script stop callback */ | ||
21 | @@ -958,15 +959,49 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg | ||
22 | case PSM_DESTROY: | ||
23 | break; | ||
24 | case PSM_SCRIPT: /* Run current package scriptlets. */ | ||
25 | +#ifdef RPM_VENDOR_OE | ||
26 | + { | ||
27 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
28 | + if (scriptletWrapper && *scriptletWrapper) | ||
29 | + (void) rpmChrootOut(); | ||
30 | +#endif | ||
31 | + | ||
32 | rc = runInstScript(psm); | ||
33 | +#ifdef RPM_VENDOR_OE | ||
34 | + if (scriptletWrapper && *scriptletWrapper) | ||
35 | + (void) rpmChrootIn(); | ||
36 | + } | ||
37 | +#endif | ||
38 | break; | ||
39 | case PSM_TRIGGERS: | ||
40 | /* Run triggers in other package(s) this package sets off. */ | ||
41 | +#ifdef RPM_VENDOR_OE | ||
42 | + { | ||
43 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
44 | + if (scriptletWrapper && *scriptletWrapper) | ||
45 | + (void) rpmChrootOut(); | ||
46 | +#endif | ||
47 | rc = runTriggers(psm); | ||
48 | +#ifdef RPM_VENDOR_OE | ||
49 | + if (scriptletWrapper && *scriptletWrapper) | ||
50 | + (void) rpmChrootIn(); | ||
51 | + } | ||
52 | +#endif | ||
53 | break; | ||
54 | case PSM_IMMED_TRIGGERS: | ||
55 | /* Run triggers in this package other package(s) set off. */ | ||
56 | +#ifdef RPM_VENDOR_OE | ||
57 | + { | ||
58 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
59 | + if (scriptletWrapper && *scriptletWrapper) | ||
60 | + (void) rpmChrootOut(); | ||
61 | +#endif | ||
62 | rc = runImmedTriggers(psm); | ||
63 | +#ifdef RPM_VENDOR_OE | ||
64 | + if (scriptletWrapper && *scriptletWrapper) | ||
65 | + (void) rpmChrootIn(); | ||
66 | + } | ||
67 | +#endif | ||
68 | break; | ||
69 | |||
70 | case PSM_RPMDB_ADD: { | ||
71 | Index: rpm-4.11.2/lib/rpmscript.c | ||
72 | =================================================================== | ||
73 | --- rpm-4.11.2.orig/lib/rpmscript.c | ||
74 | +++ rpm-4.11.2/lib/rpmscript.c | ||
75 | @@ -92,7 +92,7 @@ static rpmRC runLuaScript(int selinux, A | ||
76 | static const char * const SCRIPT_PATH = "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin"; | ||
77 | |||
78 | static void doScriptExec(int selinux, ARGV_const_t argv, ARGV_const_t prefixes, | ||
79 | - FD_t scriptFd, FD_t out) | ||
80 | + FD_t scriptFd, FD_t out, char * rootDir ) | ||
81 | { | ||
82 | int pipes[2]; | ||
83 | int flag; | ||
84 | @@ -158,13 +158,12 @@ static void doScriptExec(int selinux, AR | ||
85 | setenv("RPM_INSTALL_PREFIX", *pf, 1); | ||
86 | } | ||
87 | } | ||
88 | - | ||
89 | - if (chdir("/") == 0) { | ||
90 | + if (chdir(rootDir) == 0) { | ||
91 | /* XXX Don't mtrace into children. */ | ||
92 | unsetenv("MALLOC_CHECK_"); | ||
93 | |||
94 | /* Permit libselinux to do the scriptlet exec. */ | ||
95 | - if (selinux == 1) { | ||
96 | + if (selinux == 1) { | ||
97 | xx = rpm_execcon(0, argv[0], argv, environ); | ||
98 | } | ||
99 | |||
100 | @@ -175,12 +174,12 @@ static void doScriptExec(int selinux, AR | ||
101 | _exit(127); /* exit 127 for compatibility with bash(1) */ | ||
102 | } | ||
103 | |||
104 | -static char * writeScript(const char *cmd, const char *script) | ||
105 | +static char * writeScript(const char *cmd, const char *script, char * rootDir) | ||
106 | { | ||
107 | char *fn = NULL; | ||
108 | size_t slen = strlen(script); | ||
109 | int ok = 0; | ||
110 | - FD_t fd = rpmMkTempFile("/", &fn); | ||
111 | + FD_t fd = rpmMkTempFile(rootDir, &fn); | ||
112 | |||
113 | if (Ferror(fd)) | ||
114 | goto exit; | ||
115 | @@ -204,7 +203,7 @@ exit: | ||
116 | */ | ||
117 | static rpmRC runExtScript(int selinux, ARGV_const_t prefixes, | ||
118 | const char *sname, rpmlogLvl lvl, FD_t scriptFd, | ||
119 | - ARGV_t * argvp, const char *script, int arg1, int arg2) | ||
120 | + ARGV_t * argvp, const char *script, int arg1, int arg2,char * rootDir) | ||
121 | { | ||
122 | FD_t out = NULL; | ||
123 | char * fn = NULL; | ||
124 | @@ -215,7 +214,7 @@ static rpmRC runExtScript(int selinux, A | ||
125 | rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname); | ||
126 | |||
127 | if (script) { | ||
128 | - fn = writeScript(*argvp[0], script); | ||
129 | + fn = writeScript(*argvp[0], script, rootDir); | ||
130 | if (fn == NULL) { | ||
131 | rpmlog(RPMLOG_ERR, | ||
132 | _("Couldn't create temporary file for %s: %s\n"), | ||
133 | @@ -258,7 +257,7 @@ static rpmRC runExtScript(int selinux, A | ||
134 | } else if (pid == 0) {/* Child */ | ||
135 | rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", | ||
136 | sname, *argvp[0], (unsigned)getpid()); | ||
137 | - doScriptExec(selinux, *argvp, prefixes, scriptFd, out); | ||
138 | + doScriptExec(selinux, *argvp, prefixes, scriptFd, out, rootDir); | ||
139 | } | ||
140 | |||
141 | do { | ||
142 | @@ -297,13 +296,27 @@ exit: | ||
143 | } | ||
144 | |||
145 | rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, | ||
146 | - ARGV_const_t prefixes, int warn_only, int selinux) | ||
147 | + ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir) | ||
148 | { | ||
149 | ARGV_t args = NULL; | ||
150 | rpmlogLvl lvl = warn_only ? RPMLOG_WARNING : RPMLOG_ERR; | ||
151 | rpmRC rc; | ||
152 | - | ||
153 | - if (script == NULL) return RPMRC_OK; | ||
154 | +#ifdef RPM_VENDOR_OE | ||
155 | + const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); | ||
156 | +#endif | ||
157 | + | ||
158 | + if (script == NULL) return RPMRC_OK; | ||
159 | +#ifdef RPM_VENDOR_OE | ||
160 | + if (scriptletWrapper && *scriptletWrapper) { | ||
161 | + argvAdd(&args, scriptletWrapper); | ||
162 | + | ||
163 | + if ( rootDir ) { | ||
164 | + argvAdd(&args, rootDir); | ||
165 | + } else { | ||
166 | + argvAdd(&args, "/"); | ||
167 | + } | ||
168 | + } | ||
169 | +#endif | ||
170 | |||
171 | /* construct a new argv as we can't modify the one from header */ | ||
172 | if (script->args) { | ||
173 | @@ -315,7 +328,7 @@ rpmRC rpmScriptRun(rpmScript script, int | ||
174 | if (rstreq(args[0], "<lua>")) { | ||
175 | rc = runLuaScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); | ||
176 | } else { | ||
177 | - rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); | ||
178 | + rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, rootDir); | ||
179 | } | ||
180 | argvFree(args); | ||
181 | |||
182 | Index: rpm-4.11.2/lib/rpmscript.h | ||
183 | =================================================================== | ||
184 | --- rpm-4.11.2.orig/lib/rpmscript.h | ||
185 | +++ rpm-4.11.2/lib/rpmscript.h | ||
186 | @@ -29,7 +29,7 @@ rpmScript rpmScriptFree(rpmScript script | ||
187 | |||
188 | RPM_GNUC_INTERNAL | ||
189 | rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, | ||
190 | - ARGV_const_t prefixes, int warn_only, int selinux); | ||
191 | + ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir); | ||
192 | |||
193 | RPM_GNUC_INTERNAL | ||
194 | rpmTagVal rpmScriptTag(rpmScript script); | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch new file mode 100644 index 0000000000..3da608573a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch | |||
@@ -0,0 +1,384 @@ | |||
1 | |||
2 | Upstream-Status: Pending | ||
3 | |||
4 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
5 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
6 | |||
7 | diff --git a/build/pack.c b/build/pack.c | ||
8 | index b6b2bea..5c3d8df 100644 | ||
9 | --- a/build/pack.c | ||
10 | +++ b/build/pack.c | ||
11 | @@ -273,8 +273,10 @@ static rpmTagVal depevrtags[] = { | ||
12 | RPMTAG_CONFLICTVERSION, | ||
13 | RPMTAG_ORDERVERSION, | ||
14 | RPMTAG_TRIGGERVERSION, | ||
15 | - RPMTAG_SUGGESTSVERSION, | ||
16 | - RPMTAG_ENHANCESVERSION, | ||
17 | + RPMTAG_SUGGESTVERSION, | ||
18 | + RPMTAG_ENHANCEVERSION, | ||
19 | + RPMTAG_RECOMMENDVERSION, | ||
20 | + RPMTAG_SUPPLEMENTVERSION, | ||
21 | 0 | ||
22 | }; | ||
23 | |||
24 | diff --git a/build/parsePreamble.c b/build/parsePreamble.c | ||
25 | index 5772bef..cbbbee3 100644 | ||
26 | --- a/build/parsePreamble.c | ||
27 | +++ b/build/parsePreamble.c | ||
28 | @@ -821,6 +821,10 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, | ||
29 | } | ||
30 | /* fallthrough */ | ||
31 | case RPMTAG_PREREQ: | ||
32 | + case RPMTAG_RECOMMENDFLAGS: | ||
33 | + case RPMTAG_SUGGESTFLAGS: | ||
34 | + case RPMTAG_SUPPLEMENTFLAGS: | ||
35 | + case RPMTAG_ENHANCEFLAGS: | ||
36 | case RPMTAG_CONFLICTFLAGS: | ||
37 | case RPMTAG_OBSOLETEFLAGS: | ||
38 | case RPMTAG_PROVIDEFLAGS: | ||
39 | @@ -922,6 +926,10 @@ static struct PreambleRec_s const preambleList[] = { | ||
40 | {RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")}, | ||
41 | {RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")}, | ||
42 | {RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")}, | ||
43 | + {RPMTAG_RECOMMENDFLAGS, 0, 0, LEN_AND_STR("recommends")}, | ||
44 | + {RPMTAG_SUGGESTFLAGS, 0, 0, LEN_AND_STR("suggests")}, | ||
45 | + {RPMTAG_SUPPLEMENTFLAGS, 0, 0, LEN_AND_STR("supplements")}, | ||
46 | + {RPMTAG_ENHANCEFLAGS, 0, 0, LEN_AND_STR("enhances")}, | ||
47 | {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")}, | ||
48 | {RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")}, | ||
49 | {RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")}, | ||
50 | diff --git a/build/parseReqs.c b/build/parseReqs.c | ||
51 | index ba080a1..1427111 100644 | ||
52 | --- a/build/parseReqs.c | ||
53 | +++ b/build/parseReqs.c | ||
54 | @@ -61,6 +61,18 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, | ||
55 | nametag = RPMTAG_REQUIRENAME; | ||
56 | tagflags |= RPMSENSE_ANY; | ||
57 | break; | ||
58 | + case RPMTAG_RECOMMENDFLAGS: | ||
59 | + nametag = RPMTAG_RECOMMENDNAME; | ||
60 | + break; | ||
61 | + case RPMTAG_SUGGESTFLAGS: | ||
62 | + nametag = RPMTAG_SUGGESTNAME; | ||
63 | + break; | ||
64 | + case RPMTAG_SUPPLEMENTFLAGS: | ||
65 | + nametag = RPMTAG_SUPPLEMENTNAME; | ||
66 | + break; | ||
67 | + case RPMTAG_ENHANCEFLAGS: | ||
68 | + nametag = RPMTAG_ENHANCENAME; | ||
69 | + break; | ||
70 | case RPMTAG_PROVIDEFLAGS: | ||
71 | nametag = RPMTAG_PROVIDENAME; | ||
72 | break; | ||
73 | diff --git a/build/reqprov.c b/build/reqprov.c | ||
74 | index a368f42..c270af6 100644 | ||
75 | --- a/build/reqprov.c | ||
76 | +++ b/build/reqprov.c | ||
77 | @@ -81,6 +81,30 @@ int addReqProv(Package pkg, rpmTagVal tagN, | ||
78 | extra = Flags & RPMSENSE_TRIGGER; | ||
79 | dsp = &pkg->triggers; | ||
80 | break; | ||
81 | + case RPMTAG_RECOMMENDNAME: | ||
82 | + versiontag = RPMTAG_RECOMMENDVERSION; | ||
83 | + flagtag = RPMTAG_RECOMMENDFLAGS; | ||
84 | + extra = Flags & _ALL_REQUIRES_MASK; | ||
85 | + dsp = &pkg->recommends; | ||
86 | + break; | ||
87 | + case RPMTAG_SUGGESTNAME: | ||
88 | + versiontag = RPMTAG_SUGGESTVERSION; | ||
89 | + flagtag = RPMTAG_SUGGESTFLAGS; | ||
90 | + extra = Flags & _ALL_REQUIRES_MASK; | ||
91 | + dsp = &pkg->suggests; | ||
92 | + break; | ||
93 | + case RPMTAG_SUPPLEMENTNAME: | ||
94 | + versiontag = RPMTAG_SUPPLEMENTVERSION; | ||
95 | + flagtag = RPMTAG_SUPPLEMENTFLAGS; | ||
96 | + extra = Flags & _ALL_REQUIRES_MASK; | ||
97 | + dsp = &pkg->supplements; | ||
98 | + break; | ||
99 | + case RPMTAG_ENHANCENAME: | ||
100 | + versiontag = RPMTAG_ENHANCEVERSION; | ||
101 | + flagtag = RPMTAG_ENHANCEFLAGS; | ||
102 | + extra = Flags & _ALL_REQUIRES_MASK; | ||
103 | + dsp = &pkg->enhances; | ||
104 | + break; | ||
105 | case RPMTAG_REQUIRENAME: | ||
106 | default: | ||
107 | tagN = RPMTAG_REQUIRENAME; | ||
108 | diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h | ||
109 | index a9e4c7c..0a1977f 100644 | ||
110 | --- a/build/rpmbuild_internal.h | ||
111 | +++ b/build/rpmbuild_internal.h | ||
112 | @@ -93,6 +93,10 @@ struct Package_s { | ||
113 | rpmds ds; /*!< Requires: N = EVR */ | ||
114 | rpmds requires; | ||
115 | rpmds provides; | ||
116 | + rpmds recommends; | ||
117 | + rpmds suggests; | ||
118 | + rpmds supplements; | ||
119 | + rpmds enhances; | ||
120 | rpmds conflicts; | ||
121 | rpmds obsoletes; | ||
122 | rpmds triggers; | ||
123 | diff --git a/build/spec.c b/build/spec.c | ||
124 | index 703ec78..7ae2120 100644 | ||
125 | --- a/build/spec.c | ||
126 | +++ b/build/spec.c | ||
127 | @@ -139,6 +139,11 @@ static Package freePackage(Package pkg) | ||
128 | pkg->ds = rpmdsFree(pkg->ds); | ||
129 | pkg->requires = rpmdsFree(pkg->requires); | ||
130 | pkg->provides = rpmdsFree(pkg->provides); | ||
131 | + pkg->recommends = rpmdsFree(pkg->recommends); | ||
132 | + pkg->suggests = rpmdsFree(pkg->suggests); | ||
133 | + pkg->supplements = rpmdsFree(pkg->supplements); | ||
134 | + pkg->enhances = rpmdsFree(pkg->enhances); | ||
135 | + | ||
136 | pkg->conflicts = rpmdsFree(pkg->conflicts); | ||
137 | pkg->obsoletes = rpmdsFree(pkg->obsoletes); | ||
138 | pkg->triggers = rpmdsFree(pkg->triggers); | ||
139 | diff --git a/lib/rpmds.c b/lib/rpmds.c | ||
140 | index 7a51167..1e5dda0 100644 | ||
141 | --- a/lib/rpmds.c | ||
142 | +++ b/lib/rpmds.c | ||
143 | @@ -52,6 +52,22 @@ static int dsType(rpmTagVal tag, | ||
144 | t = "Requires"; | ||
145 | evr = RPMTAG_REQUIREVERSION; | ||
146 | f = RPMTAG_REQUIREFLAGS; | ||
147 | + } else if (tag == RPMTAG_SUPPLEMENTNAME) { | ||
148 | + t = "Supplements"; | ||
149 | + evr = RPMTAG_SUPPLEMENTVERSION; | ||
150 | + f = RPMTAG_SUPPLEMENTFLAGS; | ||
151 | + } else if (tag == RPMTAG_ENHANCENAME) { | ||
152 | + t = "Enhances"; | ||
153 | + evr = RPMTAG_ENHANCEVERSION; | ||
154 | + f = RPMTAG_ENHANCEFLAGS; | ||
155 | + } else if (tag == RPMTAG_RECOMMENDNAME) { | ||
156 | + t = "Recommends"; | ||
157 | + evr = RPMTAG_RECOMMENDVERSION; | ||
158 | + f = RPMTAG_RECOMMENDFLAGS; | ||
159 | + } else if (tag == RPMTAG_SUGGESTNAME) { | ||
160 | + t = "Suggests"; | ||
161 | + evr = RPMTAG_SUGGESTVERSION; | ||
162 | + f = RPMTAG_SUGGESTFLAGS; | ||
163 | } else if (tag == RPMTAG_CONFLICTNAME) { | ||
164 | t = "Conflicts"; | ||
165 | evr = RPMTAG_CONFLICTVERSION; | ||
166 | diff --git a/lib/rpmtag.h b/lib/rpmtag.h | ||
167 | index 64b03f1..b943229 100644 | ||
168 | --- a/lib/rpmtag.h | ||
169 | +++ b/lib/rpmtag.h | ||
170 | @@ -217,14 +217,14 @@ typedef enum rpmTag_e { | ||
171 | RPMTAG_PRETRANSPROG = 1153, /* s[] */ | ||
172 | RPMTAG_POSTTRANSPROG = 1154, /* s[] */ | ||
173 | RPMTAG_DISTTAG = 1155, /* s */ | ||
174 | - RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */ | ||
175 | -#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */ | ||
176 | - RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */ | ||
177 | - RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */ | ||
178 | - RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */ | ||
179 | -#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */ | ||
180 | - RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */ | ||
181 | - RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */ | ||
182 | + RPMTAG_OLDSUGGESTSNAME = 1156, /* s[] (unimplemented) */ | ||
183 | +#define RPMTAG_OLDSUGGESTS RPMTAG_OLDSUGGESTSNAME /* s[] (unimplemented) */ | ||
184 | + RPMTAG_OLDSUGGESTSVERSION = 1157, /* s[] (unimplemented) */ | ||
185 | + RPMTAG_OLDSUGGESTSFLAGS = 1158, /* i[] (unimplemented) */ | ||
186 | + RPMTAG_OLDENHANCESNAME = 1159, /* s[] (unimplemented) */ | ||
187 | +#define RPMTAG_OLDENHANCES RPMTAG_OLDENHANCESNAME /* s[] (unimplemented) */ | ||
188 | + RPMTAG_OLDENHANCESVERSION = 1160, /* s[] (unimplemented) */ | ||
189 | + RPMTAG_OLDENHANCESFLAGS = 1161, /* i[] (unimplemented) */ | ||
190 | RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */ | ||
191 | RPMTAG_CVSID = 1163, /* s (unimplemented) */ | ||
192 | #define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */ | ||
193 | @@ -261,6 +261,7 @@ typedef enum rpmTag_e { | ||
194 | RPMTAG_BUILDOBSOLETES = 1194, /* internal (unimplemented) */ | ||
195 | RPMTAG_DBINSTANCE = 1195, /* i extension */ | ||
196 | RPMTAG_NVRA = 1196, /* s extension */ | ||
197 | + | ||
198 | /* tags 1997-4999 reserved */ | ||
199 | RPMTAG_FILENAMES = 5000, /* s[] extension */ | ||
200 | RPMTAG_FILEPROVIDE = 5001, /* s[] extension */ | ||
201 | @@ -307,6 +308,26 @@ typedef enum rpmTag_e { | ||
202 | RPMTAG_OBSOLETENEVRS = 5043, /* s[] extension */ | ||
203 | RPMTAG_CONFLICTNEVRS = 5044, /* s[] extension */ | ||
204 | RPMTAG_FILENLINKS = 5045, /* i[] extension */ | ||
205 | + RPMTAG_RECOMMENDNAME = 5046, /* s[] */ | ||
206 | +#define RPMTAG_RECOMMENDS RPMTAG_RECOMMENDNAME /* s[] */ | ||
207 | + RPMTAG_RECOMMENDVERSION = 5047, /* s[] */ | ||
208 | + RPMTAG_RECOMMENDFLAGS = 5048, /* i[] */ | ||
209 | + RPMTAG_SUGGESTNAME = 5049, /* s[] */ | ||
210 | +#define RPMTAG_SUGGESTS RPMTAG_SUGGESTNAME /* s[] */ | ||
211 | + RPMTAG_SUGGESTVERSION = 5050, /* s[] extension */ | ||
212 | + RPMTAG_SUGGESTFLAGS = 5051, /* i[] extension */ | ||
213 | + RPMTAG_SUPPLEMENTNAME = 5052, /* s[] */ | ||
214 | +#define RPMTAG_SUPPLEMENTS RPMTAG_SUPPLEMENTNAME /* s[] */ | ||
215 | + RPMTAG_SUPPLEMENTVERSION = 5053, /* s[] */ | ||
216 | + RPMTAG_SUPPLEMENTFLAGS = 5054, /* i[] */ | ||
217 | + RPMTAG_ENHANCENAME = 5055, /* s[] */ | ||
218 | +#define RPMTAG_ENHANCES RPMTAG_ENHANCENAME /* s[] */ | ||
219 | + RPMTAG_ENHANCEVERSION = 5056, /* s[] */ | ||
220 | + RPMTAG_ENHANCEFLAGS = 5057, /* i[] */ | ||
221 | + RPMTAG_RECOMMENDNEVRS = 5058, /* s[] extension */ | ||
222 | + RPMTAG_SUGGESTNEVRS = 5059, /* s[] extension */ | ||
223 | + RPMTAG_SUPPLEMENTNEVRS = 5060, /* s[] extension */ | ||
224 | + RPMTAG_ENHANCENEVRS = 5061, /* s[] extension */ | ||
225 | |||
226 | RPMTAG_FIRSTFREE_TAG /*!< internal */ | ||
227 | } rpmTag; | ||
228 | diff --git a/lib/tagexts.c b/lib/tagexts.c | ||
229 | index 29b2bae..e940310 100644 | ||
230 | --- a/lib/tagexts.c | ||
231 | +++ b/lib/tagexts.c | ||
232 | @@ -761,6 +761,26 @@ static int requirenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
233 | return depnevrsTag(h, td, hgflags, RPMTAG_REQUIRENAME); | ||
234 | } | ||
235 | |||
236 | +static int recommendnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
237 | +{ | ||
238 | + return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME); | ||
239 | +} | ||
240 | + | ||
241 | +static int suggestnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
242 | +{ | ||
243 | + return depnevrsTag(h, td, hgflags, RPMTAG_SUGGESTNAME); | ||
244 | +} | ||
245 | + | ||
246 | +static int supplementnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
247 | +{ | ||
248 | + return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME); | ||
249 | +} | ||
250 | + | ||
251 | +static int enhancenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
252 | +{ | ||
253 | + return depnevrsTag(h, td, hgflags, RPMTAG_ENHANCENAME); | ||
254 | +} | ||
255 | + | ||
256 | static int providenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) | ||
257 | { | ||
258 | return depnevrsTag(h, td, hgflags, RPMTAG_PROVIDENAME); | ||
259 | @@ -823,6 +843,10 @@ static const struct headerTagFunc_s rpmHeaderTagExtensions[] = { | ||
260 | { RPMTAG_EPOCHNUM, epochnumTag }, | ||
261 | { RPMTAG_INSTFILENAMES, instfilenamesTag }, | ||
262 | { RPMTAG_REQUIRENEVRS, requirenevrsTag }, | ||
263 | + { RPMTAG_RECOMMENDNEVRS, recommendnevrsTag}, | ||
264 | + { RPMTAG_SUGGESTNEVRS, suggestnevrsTag}, | ||
265 | + { RPMTAG_SUPPLEMENTNEVRS, supplementnevrsTag}, | ||
266 | + { RPMTAG_ENHANCENEVRS, enhancenevrsTag}, | ||
267 | { RPMTAG_PROVIDENEVRS, providenevrsTag }, | ||
268 | { RPMTAG_OBSOLETENEVRS, obsoletenevrsTag }, | ||
269 | { RPMTAG_CONFLICTNEVRS, conflictnevrsTag }, | ||
270 | diff --git a/rpmpopt.in b/rpmpopt.in | ||
271 | index 805599e..036ab4e 100644 | ||
272 | --- a/rpmpopt.in | ||
273 | +++ b/rpmpopt.in | ||
274 | @@ -67,6 +67,19 @@ rpm alias --requires --qf \ | ||
275 | --POPTdesc=$"list capabilities required by package(s)" | ||
276 | rpm alias -R --requires | ||
277 | |||
278 | +rpm alias --recommends --qf \ | ||
279 | + "[%|VERBOSE?{%{RECOMMENDFLAGS:deptype}: }:{}|%{RECOMMENDNEVRS}\n]" \ | ||
280 | + --POPTdesc=$"list capabilities recommended by package(s)" | ||
281 | +rpm alias --suggests --qf \ | ||
282 | + "[%|VERBOSE?{%{SUGGESTFLAGS:deptype}: }:{}|%{SUGGESTNEVRS}\n]" \ | ||
283 | + --POPTdesc=$"list capabilities suggested by package(s)" | ||
284 | +rpm alias --supplements --qf \ | ||
285 | + "[%|VERBOSE?{%{SUPPLEMENTFLAGS:deptype}: }:{}|%{SUPPLEMENTNEVRS}\n]" \ | ||
286 | + --POPTdesc=$"list capabilities supplemented by package(s)" | ||
287 | +rpm alias --enhances --qf \ | ||
288 | + "[%|VERBOSE?{%{ENHANCEFLAGS:deptype}: }:{}|%{ENHANCENEVRS}\n]" \ | ||
289 | + --POPTdesc=$"list capabilities enhanced by package(s)" | ||
290 | + | ||
291 | rpm alias --info --qf '\ | ||
292 | Name : %{NAME}\n\ | ||
293 | %|EPOCH?{Epoch : %{EPOCH}\n}|\ | ||
294 | diff --git a/tests/data/SPECS/deptest.spec b/tests/data/SPECS/deptest.spec | ||
295 | index cb4cbbd..7c47f6d 100644 | ||
296 | --- a/tests/data/SPECS/deptest.spec | ||
297 | +++ b/tests/data/SPECS/deptest.spec | ||
298 | @@ -10,6 +10,10 @@ BuildArch: noarch | ||
299 | %{?provs:Provides: %{provs}} | ||
300 | %{?cfls:Conflicts: %{cfls}} | ||
301 | %{?obs:Obsoletes: %{obs}} | ||
302 | +%{?recs:Recommends: %{recs}} | ||
303 | +%{?sugs:Suggests: %{sugs}} | ||
304 | +%{?sups:Supplements: %{sups}} | ||
305 | +%{?ens:Enhances: %{ens}} | ||
306 | |||
307 | %description | ||
308 | %{summary} | ||
309 | diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at | ||
310 | index 6230903..c4c954c 100644 | ||
311 | --- a/tests/rpmbuild.at | ||
312 | +++ b/tests/rpmbuild.at | ||
313 | @@ -185,3 +185,25 @@ lrwxrwxrwx /opt/globtest/linkgood | ||
314 | ], | ||
315 | []) | ||
316 | AT_CLEANUP | ||
317 | + | ||
318 | +# ------------------------------ | ||
319 | +# Check if weak and reverse requires can be built | ||
320 | +AT_SETUP([Weak and reverse requires]) | ||
321 | +AT_KEYWORDS([build]) | ||
322 | +AT_CHECK([ | ||
323 | + | ||
324 | +runroot rpmbuild -bb --quiet \ | ||
325 | + --define "pkg weakdeps" \ | ||
326 | + --define "recs foo > 1.2.3" \ | ||
327 | + --define "sugs bar >= 0.1.2" \ | ||
328 | + --define "sups baz" \ | ||
329 | + --define "ens zap = 3" \ | ||
330 | + /data/SPECS/deptest.spec | ||
331 | + | ||
332 | +runroot rpm -qp --qf "[%{supplementname}\n]" /build/RPMS/noarch/deptest-weakdeps-1.0-1.noarch.rpm | ||
333 | +], | ||
334 | +[0], | ||
335 | +[baz | ||
336 | +], | ||
337 | +[ignore]) | ||
338 | +AT_CLEANUP | ||
339 | diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at | ||
340 | index 13131e2..80cca63 100644 | ||
341 | --- a/tests/rpmgeneral.at | ||
342 | +++ b/tests/rpmgeneral.at | ||
343 | @@ -79,6 +79,11 @@ DISTTAG | ||
344 | DISTURL | ||
345 | DSAHEADER | ||
346 | E | ||
347 | +ENHANCEFLAGS | ||
348 | +ENHANCENAME | ||
349 | +ENHANCENEVRS | ||
350 | +ENHANCES | ||
351 | +ENHANCEVERSION | ||
352 | EPOCH | ||
353 | EPOCHNUM | ||
354 | EVR | ||
355 | @@ -199,6 +204,11 @@ PROVIDES | ||
356 | PROVIDEVERSION | ||
357 | PUBKEYS | ||
358 | R | ||
359 | +RECOMMENDFLAGS | ||
360 | +RECOMMENDNAME | ||
361 | +RECOMMENDNEVRS | ||
362 | +RECOMMENDS | ||
363 | +RECOMMENDVERSION | ||
364 | RECONTEXTS | ||
365 | RELEASE | ||
366 | REMOVETID | ||
367 | @@ -219,7 +229,17 @@ SOURCE | ||
368 | SOURCEPACKAGE | ||
369 | SOURCEPKGID | ||
370 | SOURCERPM | ||
371 | +SUGGESTFLAGS | ||
372 | +SUGGESTNAME | ||
373 | +SUGGESTNEVRS | ||
374 | +SUGGESTS | ||
375 | +SUGGESTVERSION | ||
376 | SUMMARY | ||
377 | +SUPPLEMENTFLAGS | ||
378 | +SUPPLEMENTNAME | ||
379 | +SUPPLEMENTNEVRS | ||
380 | +SUPPLEMENTS | ||
381 | +SUPPLEMENTVERSION | ||
382 | TRIGGERCONDS | ||
383 | TRIGGERFLAGS | ||
384 | TRIGGERINDEX | ||
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch new file mode 100644 index 0000000000..8d84cf8a11 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | |||
2 | Use pkgconfig to get the correct include paths | ||
3 | |||
4 | Upstream-Status: Pending | ||
5 | |||
6 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
7 | Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> | ||
8 | |||
9 | diff --git a/configure.ac b/configure.ac | ||
10 | index e97f727..8179f44 100644 | ||
11 | --- a/configure.ac | ||
12 | +++ b/configure.ac | ||
13 | @@ -540,10 +540,10 @@ esac], | ||
14 | |||
15 | AS_IF([test "$enable_python" = yes],[ | ||
16 | AM_PATH_PYTHON([2.6],[ | ||
17 | - WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'` | ||
18 | + WITH_PYTHON_INCLUDE=$(${PKG_CONFIG} --cflags-only-I python) | ||
19 | WITH_PYTHON_SUBPACKAGE=1 | ||
20 | save_CPPFLAGS="$CPPFLAGS" | ||
21 | - CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE" | ||
22 | + CPPFLAGS="$CPPFLAGS $WITH_PYTHON_INCLUDE" | ||
23 | AC_CHECK_HEADER([Python.h],[], | ||
24 | [AC_MSG_ERROR([missing Python.h]) | ||
25 | ]) | ||
26 | diff --git a/python/Makefile.am b/python/Makefile.am | ||
27 | index fff51ae..f37cb9d 100644 | ||
28 | --- a/python/Makefile.am | ||
29 | +++ b/python/Makefile.am | ||
30 | @@ -4,7 +4,7 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py | ||
31 | |||
32 | AM_CPPFLAGS = -I$(top_builddir)/include/ | ||
33 | AM_CPPFLAGS += -I$(top_srcdir)/python | ||
34 | -AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@ | ||
35 | +AM_CPPFLAGS += @WITH_PYTHON_INCLUDE@ | ||
36 | |||
37 | pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la | ||
38 | pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py | ||
diff --git a/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch new file mode 100644 index 0000000000..d8ecf0f7bd --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Roy.Li" <rongqing.li@windriver.com> | ||
3 | Date: Tue, 11 Nov 2014 16:28:22 +0800 | ||
4 | Subject: [PATCH] using poptParseArgvString to parse the | ||
5 | _gpg_check_password_cmd | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but | ||
10 | strace shows that gpg_name has a quote when run _gpg_check_password, | ||
11 | but not when run __gpg_sign_cmd; for example, if gpg_name is "tester" | ||
12 | |||
13 | execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", | ||
14 | "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0 | ||
15 | |||
16 | execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor", | ||
17 | "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0 | ||
18 | |||
19 | it can be fixed by removing the quote around %{gpg_name} when define | ||
20 | __gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes | ||
21 | space, it will not work. | ||
22 | |||
23 | %__gpg_check_password_cmd %{__gpg} \ | ||
24 | gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so - | ||
25 | |||
26 | The poptParseArgvString function is used to parse _gpg_sign_cmd, so using | ||
27 | poptParseArgvString to parse __gpg_check_password_cmd to fix this issue. | ||
28 | |||
29 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
30 | --- | ||
31 | rpmdb/signature.c | 2 +- | ||
32 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
33 | |||
34 | diff --git a/rpmdb/signature.c b/rpmdb/signature.c | ||
35 | index c35e0ab..016e8d1 100644 | ||
36 | --- a/rpmdb/signature.c | ||
37 | +++ b/rpmdb/signature.c | ||
38 | @@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase) | ||
39 | (void) setenv("GNUPGHOME", gpg_path, 1); | ||
40 | |||
41 | cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL); | ||
42 | - rc = argvSplit(&av, cmd, NULL); | ||
43 | + rc = poptParseArgvString(cmd, NULL, (const char ***)&av); | ||
44 | if (!rc) | ||
45 | rc = execve(av[0], (char *const *)av+1, environ); | ||
46 | |||
47 | -- | ||
48 | 1.9.1 | ||
diff --git a/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/meta/recipes-devtools/rpm/rpm/dbconvert.patch new file mode 100644 index 0000000000..78de7d99d2 --- /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.14/tools/Makefile.am | ||
7 | =================================================================== | ||
8 | --- rpm-5.4.14.orig/tools/Makefile.am | ||
9 | +++ rpm-5.4.14/tools/Makefile.am | ||
10 | @@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en | ||
11 | xiu-instantiate xiu-store | ||
12 | noinst_PROGRAMS = | ||
13 | |||
14 | -EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \ | ||
15 | +EXTRA_PROGRAMS += augtool cudftool debugedit \ | ||
16 | nix-build nix-channel nix-collect-garbage \ | ||
17 | nix-log2xml nix-prefetch-url nix-pull nix-push \ | ||
18 | xiu-echo xiu-hash \ | ||
19 | @@ -64,7 +64,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..beef5edd9d --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch | |||
@@ -0,0 +1,98 @@ | |||
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.14/tools/debugedit.c | ||
19 | =================================================================== | ||
20 | --- rpm-5.4.14.orig/tools/debugedit.c | ||
21 | +++ rpm-5.4.14/tools/debugedit.c | ||
22 | @@ -1445,21 +1445,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 | + } u1, u2; | ||
38 | + Elf_Data src = { .d_version = EV_CURRENT, .d_buf = &u1 }; | ||
39 | + Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 }; | ||
40 | |||
41 | - x.d_type = ELF_T_EHDR; | ||
42 | - x.d_size = sizeof u.ehdr; | ||
43 | - u.ehdr = dso->ehdr; | ||
44 | - u.ehdr.e_phoff = u.ehdr.e_shoff = 0; | ||
45 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
46 | + src.d_type = ELF_T_EHDR; | ||
47 | + src.d_size = sizeof u1.ehdr; | ||
48 | + dest.d_size = sizeof u2.ehdr; | ||
49 | + u1.ehdr = dso->ehdr; | ||
50 | + u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0; | ||
51 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
52 | { | ||
53 | bad: | ||
54 | fprintf (stderr, "Failed to compute header checksum: %s\n", | ||
55 | @@ -1467,29 +1470,31 @@ handle_build_id (DSO *dso, Elf_Data *bui | ||
56 | exit (1); | ||
57 | } | ||
58 | |||
59 | - x.d_type = ELF_T_PHDR; | ||
60 | - x.d_size = sizeof u.phdr; | ||
61 | + src.d_type = ELF_T_PHDR; | ||
62 | + src.d_size = sizeof u1.phdr; | ||
63 | + dest.d_size = sizeof u2.phdr; | ||
64 | for (i = 0; i < dso->ehdr.e_phnum; ++i) | ||
65 | { | ||
66 | - if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL) | ||
67 | + if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL) | ||
68 | goto bad; | ||
69 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
70 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
71 | goto bad; | ||
72 | - process (x.d_buf, x.d_size); | ||
73 | + process (dest.d_buf, dest.d_size); | ||
74 | } | ||
75 | |||
76 | - x.d_type = ELF_T_SHDR; | ||
77 | - x.d_size = sizeof u.shdr; | ||
78 | + src.d_type = ELF_T_SHDR; | ||
79 | + src.d_size = sizeof u1.shdr; | ||
80 | + dest.d_size = sizeof u2.shdr; | ||
81 | for (i = 0; i < dso->ehdr.e_shnum; ++i) | ||
82 | if (dso->scn[i] != NULL) | ||
83 | { | ||
84 | - u.shdr = dso->shdr[i]; | ||
85 | - u.shdr.sh_offset = 0; | ||
86 | - if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
87 | + u1.shdr = dso->shdr[i]; | ||
88 | + u1.shdr.sh_offset = 0; | ||
89 | + if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) | ||
90 | goto bad; | ||
91 | - process (x.d_buf, x.d_size); | ||
92 | + process (dest.d_buf, dest.d_size); | ||
93 | |||
94 | - if (u.shdr.sh_type != SHT_NOBITS) | ||
95 | + if (u1.shdr.sh_type != SHT_NOBITS) | ||
96 | { | ||
97 | Elf_Data *d = elf_rawdata (dso->scn[i], NULL); | ||
98 | 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..f7c31006b4 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch | |||
@@ -0,0 +1,65 @@ | |||
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 | Index: rpm-5.4.14/tools/debugedit.c | ||
24 | =================================================================== | ||
25 | --- rpm-5.4.14.orig/tools/debugedit.c | ||
26 | +++ rpm-5.4.14/tools/debugedit.c | ||
27 | @@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui | ||
28 | } | ||
29 | } | ||
30 | |||
31 | +/* It avoided the segment fault while file's bss offset have a large number. | ||
32 | + See https://bugzilla.redhat.com/show_bug.cgi?id=1019707 | ||
33 | + https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */ | ||
34 | +void valid_file(int fd) | ||
35 | +{ | ||
36 | + Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL); | ||
37 | + if (elf == NULL) | ||
38 | + { | ||
39 | + error (1, 0, "elf_begin: %s", elf_errmsg (-1)); | ||
40 | + return; | ||
41 | + } | ||
42 | + | ||
43 | + elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT); | ||
44 | + | ||
45 | + if (elf_update (elf, ELF_C_WRITE) < 0) | ||
46 | + error (1, 0, "elf_update: %s", elf_errmsg (-1)); | ||
47 | + | ||
48 | + elf_end (elf); | ||
49 | + | ||
50 | + return; | ||
51 | +} | ||
52 | + | ||
53 | int | ||
54 | main (int argc, char *argv[]) | ||
55 | { | ||
56 | @@ -1621,6 +1643,9 @@ main (int argc, char *argv[]) | ||
57 | exit (1); | ||
58 | } | ||
59 | |||
60 | + /* Make sure the file is valid. */ | ||
61 | + valid_file(fd); | ||
62 | + | ||
63 | dso = fdopen_dso (fd, file); | ||
64 | if (dso == NULL) | ||
65 | exit (1); | ||
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..976af486fb --- /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.14/configure.ac | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.14.orig/configure.ac | ||
12 | +++ rpm-5.4.14/configure.ac | ||
13 | @@ -201,7 +201,7 @@ dnl # GNU GCC (usually "gcc") | ||
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..5ffb187ff3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: rpm-5.4.14/rpmdb/rpmdb.h | ||
4 | =================================================================== | ||
5 | --- rpm-5.4.14.orig/rpmdb/rpmdb.h | ||
6 | +++ rpm-5.4.14/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 | Index: rpm-5.4.14/rpmdb/rpmtag.h | ||
16 | =================================================================== | ||
17 | --- rpm-5.4.14.orig/rpmdb/rpmtag.h | ||
18 | +++ rpm-5.4.14/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..8fab9eb42f --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch | |||
@@ -0,0 +1,33 @@ | |||
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 | Index: rpm-5.4.14/lua/Makefile.am | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.14.orig/lua/Makefile.am | ||
24 | +++ rpm-5.4.14/lua/Makefile.am | ||
25 | @@ -326,7 +326,7 @@ clean-local: | ||
26 | # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. | ||
27 | # XXX CVS has lua/luac sub-directories in the Attic that collide with the | ||
28 | # XXX lua/luac executable names when using cvs update. | ||
29 | -install-exec-hook: install-pkgbinPROGRAMS | ||
30 | +install-data-hook: | ||
31 | mkdir -p $(DESTDIR)$(pkgbindir) | ||
32 | $(__RM) -f $(DESTDIR)$(pkgbindir)/lua | ||
33 | $(__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..a538a60bb9 --- /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.14/python/rpmmodule.c | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.14.orig/python/rpmmodule.c | ||
14 | +++ rpm-5.4.14/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-CVE-2013-6435.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch new file mode 100644 index 0000000000..b107e8f047 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch | |||
@@ -0,0 +1,109 @@ | |||
1 | From 08105acda1da63d32fbb18596a3d6c3e0aa106d1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | ||
3 | Date: Wed, 10 Jun 2015 14:36:56 +0000 | ||
4 | Subject: [PATCH 2/2] rpm: CVE-2013-6435 | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | Reference: | ||
9 | https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-6435 | ||
10 | |||
11 | Description: | ||
12 | It was found that RPM wrote file contents to the target installation | ||
13 | directory under a temporary name, and verified its cryptographic signature | ||
14 | only after the temporary file has been written completely. Under certain | ||
15 | conditions, the system interprets the unverified temporary file contents | ||
16 | and extracts commands from it. This could allow an attacker to modify | ||
17 | signed RPM files in such a way that they would execute code chosen | ||
18 | by the attacker during package installation. | ||
19 | |||
20 | Original Patch: | ||
21 | https://bugzilla.redhat.com/attachment.cgi?id=956207 | ||
22 | |||
23 | Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | ||
24 | --- | ||
25 | lib/fsm.c | 2 +- | ||
26 | rpmio/rpmio.c | 18 ++++++++++++++---- | ||
27 | 2 files changed, 15 insertions(+), 5 deletions(-) | ||
28 | |||
29 | diff --git a/lib/fsm.c b/lib/fsm.c | ||
30 | index 1ee7e67..094eb1d 100644 | ||
31 | --- a/lib/fsm.c | ||
32 | +++ b/lib/fsm.c | ||
33 | @@ -726,7 +726,7 @@ static int expandRegular(FSM_t fsm, rpmpsm psm, rpmcpio_t archive, int nodigest) | ||
34 | { | ||
35 | FD_t wfd = NULL; | ||
36 | const struct stat * st = &fsm->sb; | ||
37 | - rpm_loff_t left = st->st_size; | ||
38 | + rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix); | ||
39 | const unsigned char * fidigest = NULL; | ||
40 | pgpHashAlgo digestalgo = 0; | ||
41 | int rc = 0; | ||
42 | diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c | ||
43 | index cd223e8..0b12e31 100644 | ||
44 | --- a/rpmio/rpmio.c | ||
45 | +++ b/rpmio/rpmio.c | ||
46 | @@ -1309,15 +1309,19 @@ int Fclose(FD_t fd) | ||
47 | * - bzopen: [1-9] is block size (modulo 100K) | ||
48 | * - bzopen: 's' is smallmode | ||
49 | * - HACK: '.' terminates, rest is type of I/O | ||
50 | + * - 'U' sets *mode to zero (no permissions) instead of 0666 | ||
51 | */ | ||
52 | static void cvtfmode (const char *m, | ||
53 | char *stdio, size_t nstdio, | ||
54 | char *other, size_t nother, | ||
55 | - const char **end, int * f) | ||
56 | + const char **end, int *f, mode_t *mode) | ||
57 | { | ||
58 | int flags = 0; | ||
59 | char c; | ||
60 | |||
61 | + if (mode) | ||
62 | + *mode = 0666; | ||
63 | + | ||
64 | switch (*m) { | ||
65 | case 'a': | ||
66 | flags |= O_WRONLY | O_CREAT | O_APPEND; | ||
67 | @@ -1357,6 +1361,10 @@ static void cvtfmode (const char *m, | ||
68 | if (--nstdio > 0) *stdio++ = c; | ||
69 | continue; | ||
70 | break; | ||
71 | + case 'U': | ||
72 | + if (mode) | ||
73 | + *mode = 0; | ||
74 | + break; | ||
75 | default: | ||
76 | if (--nother > 0) *other++ = c; | ||
77 | continue; | ||
78 | @@ -1385,7 +1393,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); | ||
79 | if (fd == NULL || fmode == NULL) | ||
80 | return NULL; | ||
81 | |||
82 | - cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL); | ||
83 | + cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL, | ||
84 | + NULL); | ||
85 | if (stdio[0] == '\0') | ||
86 | return NULL; | ||
87 | zstdio[0] = '\0'; | ||
88 | @@ -1436,7 +1445,7 @@ FD_t Fopen(const char *path, const char *fmode) | ||
89 | { | ||
90 | char stdio[20], other[20]; | ||
91 | const char *end = NULL; | ||
92 | - mode_t perms = 0666; | ||
93 | + mode_t perms; | ||
94 | int flags = 0; | ||
95 | FD_t fd; | ||
96 | |||
97 | @@ -1444,7 +1453,8 @@ FD_t Fopen(const char *path, const char *fmode) | ||
98 | return NULL; | ||
99 | |||
100 | stdio[0] = '\0'; | ||
101 | - cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags); | ||
102 | + cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags, | ||
103 | + &perms); | ||
104 | if (stdio[0] == '\0') | ||
105 | return NULL; | ||
106 | |||
107 | -- | ||
108 | 1.8.4.5 | ||
109 | |||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch new file mode 100644 index 0000000000..bf1795ca49 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 71c812edf1431a9967bd99ba6ffa6ab89eb7ec7c Mon Sep 17 00:00:00 2001 | ||
2 | From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | ||
3 | Date: Wed, 10 Jun 2015 12:56:55 +0000 | ||
4 | Subject: [PATCH 1/2] rpm: CVE-2014-8118 | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | Reference: | ||
9 | https://bugzilla.redhat.com/show_bug.cgi?id=1168715 | ||
10 | |||
11 | Description: | ||
12 | It was found that RPM could encounter an integer overflow, | ||
13 | leading to a stack-based overflow, while parsing a crafted | ||
14 | CPIO header in the payload section of an RPM file. This could | ||
15 | allow an attacker to modify signed RPM files in such a way that | ||
16 | they would execute code chosen by the attacker during package | ||
17 | installation. | ||
18 | |||
19 | Original Patch: | ||
20 | https://bugzilla.redhat.com/attachment.cgi?id=962159 | ||
21 | |||
22 | Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | ||
23 | --- | ||
24 | lib/cpio.c | 3 +++ | ||
25 | 1 file changed, 3 insertions(+) | ||
26 | |||
27 | diff --git a/lib/cpio.c b/lib/cpio.c | ||
28 | index 382eeb6..74ddd9c 100644 | ||
29 | --- a/lib/cpio.c | ||
30 | +++ b/lib/cpio.c | ||
31 | @@ -296,6 +296,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, struct stat * st) | ||
32 | st->st_rdev = makedev(major, minor); | ||
33 | |||
34 | GET_NUM_FIELD(hdr.namesize, nameSize); | ||
35 | + if (nameSize <= 0 || nameSize > 4096) { | ||
36 | + return CPIOERR_BAD_HEADER; | ||
37 | + } | ||
38 | |||
39 | *path = xmalloc(nameSize + 1); | ||
40 | read = Fread(*path, nameSize, 1, cpio->fd); | ||
41 | -- | ||
42 | 1.8.4.5 | ||
43 | |||
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..8771235d30 --- /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: Inappropriate [configuration] | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | Index: rpm-5.4.14/syck/autogen.sh | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.14.orig/syck/autogen.sh | ||
12 | +++ rpm-5.4.14/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..41ab498a0f --- /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.14/lib/rpmrc.c | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
24 | +++ rpm-5.4.14/lib/rpmrc.c | ||
25 | @@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@ | ||
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 | @@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c | ||
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 | @@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c | ||
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 | @@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c | ||
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..c869376538 --- /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.14/rpmdb/DB_CONFIG.in | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in | ||
10 | +++ rpm-5.4.14/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-db5-or-db6.patch b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch new file mode 100644 index 0000000000..edb6ea2f47 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch | |||
@@ -0,0 +1,162 @@ | |||
1 | Support both db5 and db6. | ||
2 | |||
3 | Upstream-status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | Index: rpm/configure.ac | ||
8 | =================================================================== | ||
9 | --- rpm.orig/configure.ac | ||
10 | +++ rpm/configure.ac | ||
11 | @@ -547,8 +547,6 @@ else | ||
12 | MYPATH=$PATH | ||
13 | fi | ||
14 | |||
15 | -DBXY=db60 | ||
16 | - | ||
17 | AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH) | ||
18 | AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH) | ||
19 | AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) | ||
20 | @@ -560,22 +558,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/ | ||
21 | AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH) | ||
22 | AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH) | ||
23 | AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH) | ||
24 | -AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH) | ||
25 | -AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH) | ||
26 | -AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH) | ||
27 | -AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH) | ||
28 | -AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH) | ||
29 | -AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH) | ||
30 | -AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH) | ||
31 | -AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH) | ||
32 | -AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH) | ||
33 | -AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH) | ||
34 | -AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH) | ||
35 | -AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH) | ||
36 | -AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH) | ||
37 | -AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH) | ||
38 | -AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH) | ||
39 | -AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH) | ||
40 | AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH) | ||
41 | AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH) | ||
42 | AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH) | ||
43 | @@ -1604,13 +1586,18 @@ RPM_CHECK_LIB( | ||
44 | |||
45 | dnl # Berkeley-DB & SQLite | ||
46 | DBLIBSRCS="" | ||
47 | +DBXY=db | ||
48 | + | ||
49 | # XXX won't handle --includedir override | ||
50 | -CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}" | ||
51 | +CPPFLAGS_save="${CPPFLAGS}" | ||
52 | +CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-6.0" | ||
53 | +with_db_save="${with_db}" | ||
54 | RPM_CHECK_LIB( | ||
55 | [Berkeley-DB], [db], | ||
56 | [db-6.0], [db_create], [db.h], | ||
57 | - [yes,external], [db3], | ||
58 | + [yes,external], [db6], | ||
59 | [ DBLIBSRCS="$DBLIBSRCS db3.c" | ||
60 | + DBXY=db60 | ||
61 | AM_CONDITIONAL(WITH_DB, [ true ]) | ||
62 | AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) | ||
63 | if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then | ||
64 | @@ -1619,10 +1606,32 @@ RPM_CHECK_LIB( | ||
65 | WITH_DB_SUBDIR="" | ||
66 | fi | ||
67 | ], | ||
68 | - [ AM_CONDITIONAL(WITH_DB, [ false ]) | ||
69 | - AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ]) | ||
70 | + [ # Reset a few variables to fresh | ||
71 | + with_db="${with_db_save}" | ||
72 | + CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-5.3" | ||
73 | + RPM_CHECK_LIB( | ||
74 | + [Berkeley-DB], [db], | ||
75 | + [db-5.3], [db_create], [db.h], | ||
76 | + [yes,external], [db53], | ||
77 | + [ DBLIBSRCS="$DBLIBSRCS db3.c" | ||
78 | + DBXY=db53 | ||
79 | + AM_CONDITIONAL(WITH_DB, [ true ]) | ||
80 | + AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) | ||
81 | + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then | ||
82 | + AC_DEFINE(HAVE_DB_H, 1, [Have <db.h> header]) | ||
83 | + else | ||
84 | + WITH_DB_SUBDIR="" | ||
85 | + fi | ||
86 | + ], | ||
87 | + [ AM_CONDITIONAL(WITH_DB, [ false ]) | ||
88 | + AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ]) | ||
89 | + ]) | ||
90 | ]) | ||
91 | |||
92 | +if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then | ||
93 | + CPPFLAGS="${CPPFLAGS_save}" | ||
94 | +fi | ||
95 | + | ||
96 | dnl # Sqlite external | ||
97 | RPM_CHECK_LIB( | ||
98 | [SQLite], [sqlite], | ||
99 | @@ -1633,10 +1642,11 @@ RPM_CHECK_LIB( | ||
100 | |||
101 | dnl # Sqlite 3.7.0.1 from db-5.1.19 | ||
102 | dnl XXX error: `db3' is already registered with AC_CONFIG_SUBDIRS. | ||
103 | +if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then | ||
104 | RPM_CHECK_LIB( | ||
105 | [Berkeley-DB (+SQLite3)], [dbsql], | ||
106 | [db_sql-6.0], [sqlite3_open], [dbsql.h], | ||
107 | - [yes,external], [db3/sql], | ||
108 | + [yes,external], [db6/sql], | ||
109 | [ | ||
110 | AM_CONDITIONAL(WITH_DBSQL, [ true ]) | ||
111 | AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library]) | ||
112 | @@ -1650,12 +1660,50 @@ RPM_CHECK_LIB( | ||
113 | ], [ | ||
114 | AM_CONDITIONAL(WITH_DBSQL, [ false ]) | ||
115 | ]) | ||
116 | +elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then | ||
117 | +RPM_CHECK_LIB( | ||
118 | + [Berkeley-DB (+SQLite3)], [dbsql], | ||
119 | + [db_sql-5.3], [sqlite3_open], [dbsql.h], | ||
120 | + [yes,external], [db53/sql], | ||
121 | + [ | ||
122 | + AM_CONDITIONAL(WITH_DBSQL, [ true ]) | ||
123 | + AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library]) | ||
124 | + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then | ||
125 | + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated" | ||
126 | + WITH_DB_LIBS="${WITH_DBSQL_LIBS}" | ||
127 | + DBLIBSRCS="$DBLIBSRCS sqlite.c" | ||
128 | + else | ||
129 | + WITH_DBSQL_SUBDIR="" | ||
130 | + fi | ||
131 | + ], [ | ||
132 | + AM_CONDITIONAL(WITH_DBSQL, [ false ]) | ||
133 | + ]) | ||
134 | +else | ||
135 | +AM_CONDITIONAL(WITH_DBSQL, [ false ]) | ||
136 | +fi | ||
137 | |||
138 | DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` | ||
139 | |||
140 | AC_SUBST(DBLIBSRCS) | ||
141 | AC_SUBST(DBLIBOBJS) | ||
142 | |||
143 | +AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH) | ||
144 | +AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH) | ||
145 | +AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH) | ||
146 | +AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH) | ||
147 | +AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH) | ||
148 | +AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH) | ||
149 | +AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH) | ||
150 | +AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH) | ||
151 | +AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH) | ||
152 | +AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH) | ||
153 | +AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH) | ||
154 | +AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH) | ||
155 | +AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH) | ||
156 | +AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH) | ||
157 | +AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH) | ||
158 | +AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH) | ||
159 | + | ||
160 | AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support])) | ||
161 | AC_ARG_WITH(db-mutex, AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG])) | ||
162 | |||
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..16b8e30a1d --- /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.14/rpmdb/rpmdb.c | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.14.orig/rpmdb/rpmdb.c | ||
24 | +++ rpm-5.4.14/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.14/rpmdb/db3.c | ||
66 | =================================================================== | ||
67 | --- rpm-5.4.14.orig/rpmdb/db3.c | ||
68 | +++ rpm-5.4.14/rpmdb/db3.c | ||
69 | @@ -1509,7 +1509,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..2eb6e0f26b --- /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.14/lib/rpmrc.c | ||
4 | =================================================================== | ||
5 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
6 | +++ rpm-5.4.14/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_OE) /* Skip the explicit-platform */ | ||
42 | #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ | ||
43 | /* do not use vendor and GNU attribution */ | ||
44 | @@ -519,6 +528,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 | #endif | ||
52 | @@ -688,9 +698,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-disable-Wno-override-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch new file mode 100644 index 0000000000..8b5f8d66c8 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 70d881873b443c9bad502db9665595455d4f0ac9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Tue, 8 Jul 2014 07:41:10 +0800 | ||
4 | Subject: [PATCH] configure.ac: disable -Wno-override-init | ||
5 | |||
6 | Fixed rpm-native.do_configure error on CentOS 5.x: | ||
7 | |||
8 | cc1: error: unrecognized command line option "-Wno-override-init" | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
13 | --- | ||
14 | configure.ac | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/configure.ac b/configure.ac | ||
18 | index adeffe0..6746b4c 100644 | ||
19 | --- a/configure.ac | ||
20 | +++ b/configure.ac | ||
21 | @@ -163,7 +163,7 @@ AC_ARG_ENABLE(build-warnings, | ||
22 | # XXX gcc-4.2 on Mac OS X hasn't | ||
23 | # CFLAGS="$CFLAGS -Wno-unused-but-set-variable" | ||
24 | # XXX rpmio/set.c needs this | ||
25 | - CFLAGS="$CFLAGS -Wno-override-init" | ||
26 | +# CFLAGS="$CFLAGS -Wno-override-init" | ||
27 | elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then | ||
28 | dnl # Sun Studio (usually "cc") | ||
29 | CFLAGS="$CFLAGS -v" | ||
30 | -- | ||
31 | 1.8.2.1 | ||
32 | |||
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..b1db6fff72 --- /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 | Index: rpm-5.4.14/lib/rpmfc.c | ||
15 | =================================================================== | ||
16 | --- rpm-5.4.14.orig/lib/rpmfc.c | ||
17 | +++ rpm-5.4.14/lib/rpmfc.c | ||
18 | @@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec, | ||
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 | @@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec, | ||
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-fix-logio-cp.patch b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch new file mode 100644 index 0000000000..fa1ff43d6c --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Occasionally the cp -p fails with a non-zero return code. This will cause | ||
2 | the system abort the build. | ||
3 | |||
4 | Upstream-status: Pending | ||
5 | |||
6 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
7 | |||
8 | Index: rpm/rpmdb/Makefile.am | ||
9 | =================================================================== | ||
10 | --- rpm.orig/rpmdb/Makefile.am | ||
11 | +++ rpm/rpmdb/Makefile.am | ||
12 | @@ -234,11 +234,14 @@ lcov-report: | ||
13 | #lcov-upload: lcov | ||
14 | # rsync -rvz -e ssh --delete lcov/* ??? | ||
15 | |||
16 | +$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template | ||
17 | + @if test ".$(builddir)" != ".$(srcdir)"; then \ | ||
18 | + cp -fp $(srcdir)/logio_recover_template \ | ||
19 | + $(builddir)/logio_recover_template ; \ | ||
20 | + fi | ||
21 | + | ||
22 | logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template | ||
23 | -$(logio_BUILT): logio.awk logio.src logio_recover_template | ||
24 | - @test -e $(builddir)/logio_recover_template || \ | ||
25 | - cp -p $(srcdir)/logio_recover_template \ | ||
26 | - $(builddir)/logio_recover_template | ||
27 | +$(logio_BUILT): logio.awk logio.src $(builddir)/logio_recover_template | ||
28 | @rm -f $(logio_BUILT) | ||
29 | @$(AWK) -f $(srcdir)/logio.awk \ | ||
30 | -v header_file=logio_auto.h \ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch new file mode 100644 index 0000000000..5deb2323ef --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | We need to sanity check that the nlink size and our linksLeft counter | ||
2 | do match. If an rpm is badly constructed with identical inode values | ||
3 | for multiple hardlinked files, such an rpm will otherwise access memory | ||
4 | out of array bounds and cause memory corruption and crashes. | ||
5 | |||
6 | The fix is to add in the sanity check and exit if bad circumstances | ||
7 | are found. We need to fix the caller to check the return code too. | ||
8 | |||
9 | RP 2014/6/10 | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Index: rpm-5.4.14/lib/fsm.c | ||
14 | =================================================================== | ||
15 | --- rpm-5.4.14.orig/lib/fsm.c | ||
16 | +++ rpm-5.4.14/lib/fsm.c | ||
17 | @@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /* | ||
18 | } | ||
19 | |||
20 | if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft; | ||
21 | + if (fsm->li->linksLeft > st->st_nlink) { | ||
22 | + rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink); | ||
23 | + return -1; | ||
24 | + } | ||
25 | + | ||
26 | fsm->li->filex[fsm->li->linksLeft] = fsm->ix; | ||
27 | /*@-observertrans -dependenttrans@*/ | ||
28 | fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix; | ||
29 | @@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY | ||
30 | fsm->postpone = iosmFileActionSkipped(fsm->action); | ||
31 | if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { | ||
32 | /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */ | ||
33 | - if (S_ISREG(st->st_mode) && st->st_nlink > 1) | ||
34 | + if (S_ISREG(st->st_mode) && st->st_nlink > 1) { | ||
35 | fsm->postpone = saveHardLink(fsm); | ||
36 | + if (fsm->postpone < 0) { | ||
37 | + rc = RPMRC_FAIL; | ||
38 | + break; | ||
39 | + } | ||
40 | + } | ||
41 | /*@=evalorder@*/ | ||
42 | } | ||
43 | if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1; | ||
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..042e412ede --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch | |||
@@ -0,0 +1,22 @@ | |||
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 | Index: rpm-5.4.14/lib/Makefile.am | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.14.orig/lib/Makefile.am | ||
12 | +++ rpm-5.4.14/lib/Makefile.am | ||
13 | @@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm | ||
14 | #libsql_la_SOURCES = libsql.c | ||
15 | #libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON) | ||
16 | |||
17 | +# pkglib libraries needs to have usrlib libraries already installed! | ||
18 | +install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES | ||
19 | + | ||
20 | install-data-hook: | ||
21 | if !ENABLE_BUILD_LAFILES | ||
22 | -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..3153f7a386 --- /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 | Index: rpm-5.4.14/rpmdb/DB_CONFIG.in | ||
5 | =================================================================== | ||
6 | --- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in | ||
7 | +++ rpm-5.4.14/rpmdb/DB_CONFIG.in | ||
8 | @@ -4,6 +4,7 @@ set_data_dir . | ||
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..790a662170 --- /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.14/lib/depends.c | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.14.orig/lib/depends.c | ||
15 | +++ rpm-5.4.14/lib/depends.c | ||
16 | @@ -595,7 +595,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..a9930d6705 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch | |||
@@ -0,0 +1,33 @@ | |||
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 | Index: rpm-5.4.14/configure.ac | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/configure.ac | ||
10 | +++ rpm-5.4.14/configure.ac | ||
11 | @@ -121,6 +121,9 @@ AC_PROG_YACC | ||
12 | |||
13 | AC_PATH_PROG(AS, as, as) | ||
14 | |||
15 | +CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)} | ||
16 | +AC_SUBST(CC_FOR_BUILD) | ||
17 | + | ||
18 | dnl # GCC specifics | ||
19 | AC_PROG_GCC_TRADITIONAL | ||
20 | AC_ARG_ENABLE(build-pic, | ||
21 | Index: rpm-5.4.14/lua/Makefile.am | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.14.orig/lua/Makefile.am | ||
24 | +++ rpm-5.4.14/lua/Makefile.am | ||
25 | @@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la | ||
26 | |||
27 | # --- bin2c doesn't need anything but a compiler | ||
28 | bin2c$(EXEEXT): bin2c.c | ||
29 | - $(CC) -o $@ $< | ||
30 | + $(CC_FOR_BUILD) -o $@ $< | ||
31 | |||
32 | liblua_la_SOURCES = | ||
33 | 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..c7ab2d2bb7 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch | |||
@@ -0,0 +1,64 @@ | |||
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 | Index: rpm-5.4.14/macros/macros.in | ||
11 | =================================================================== | ||
12 | --- rpm-5.4.14.orig/macros/macros.in | ||
13 | +++ rpm-5.4.14/macros/macros.in | ||
14 | @@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests Foo:Bar | ||
15 | |||
16 | #============================================================================== | ||
17 | # ---- rpmbuild macros. | ||
18 | -#%%{load:%{_usrlibrpm}/macros.rpmbuild} | ||
19 | +%{load:%{_usrlibrpm}/macros.rpmbuild} | ||
20 | |||
21 | #------------------------------------------------------------------------ | ||
22 | # cmake(...) configuration | ||
23 | @@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests Foo:Bar | ||
24 | |||
25 | #------------------------------------------------------------------------ | ||
26 | # perl(...) configuration | ||
27 | -#%%{load:%{_usrlibrpm}/macros.d/perl} | ||
28 | +%{load:%{_usrlibrpm}/macros.d/perl} | ||
29 | |||
30 | #------------------------------------------------------------------------ | ||
31 | # python(...) configuration. | ||
32 | -#%%{load:%{_usrlibrpm}/macros.d/python} | ||
33 | +%{load:%{_usrlibrpm}/macros.d/python} | ||
34 | |||
35 | #------------------------------------------------------------------------ | ||
36 | # php(...) configuration. | ||
37 | -#%%{load:%{_usrlibrpm}/macros.d/php} | ||
38 | +%{load:%{_usrlibrpm}/macros.d/php} | ||
39 | |||
40 | #------------------------------------------------------------------------ | ||
41 | # java(...) configuration. | ||
42 | @@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests Foo:Bar | ||
43 | |||
44 | #------------------------------------------------------------------------ | ||
45 | # libtool(...) configuration. | ||
46 | -#%%{load:%{_usrlibrpm}/macros.d/libtool} | ||
47 | +%{load:%{_usrlibrpm}/macros.d/libtool} | ||
48 | |||
49 | #------------------------------------------------------------------------ | ||
50 | # pkgconfig(...) configuration. | ||
51 | -#%%{load:%{_usrlibrpm}/macros.d/pkgconfig} | ||
52 | +%{load:%{_usrlibrpm}/macros.d/pkgconfig} | ||
53 | |||
54 | #------------------------------------------------------------------------ | ||
55 | # mono(...) configuration. | ||
56 | @@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests Foo:Bar | ||
57 | |||
58 | #------------------------------------------------------------------------ | ||
59 | # tcl(...) configuration. | ||
60 | -#%%{load:%{_usrlibrpm}/macros.d/tcl} | ||
61 | +%{load:%{_usrlibrpm}/macros.d/tcl} | ||
62 | |||
63 | #------------------------------------------------------------------------ | ||
64 | # typelib(...) configuration. | ||
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..ab6ed2c3a4 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | |||
@@ -0,0 +1,19 @@ | |||
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 | Index: rpm-5.4.14/lib/order.c | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/lib/order.c | ||
10 | +++ rpm-5.4.14/lib/order.c | ||
11 | @@ -2175,7 +2175,7 @@ rescan: | ||
12 | const char * dp; | ||
13 | rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) | ||
14 | ? RPMLOG_WARNING : RPMLOG_ERR; | ||
15 | -#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */ | ||
16 | +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */ | ||
17 | // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable | ||
18 | msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}"); | ||
19 | #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..58182296cf --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch | |||
@@ -0,0 +1,47 @@ | |||
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 | Index: rpm-5.4.14/configure.ac | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.14.orig/configure.ac | ||
15 | +++ rpm-5.4.14/configure.ac | ||
16 | @@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR) | ||
17 | AC_SUBST(WITH_PERL_SUBPACKAGE) | ||
18 | AC_SUBST(WITH_PERL_LIBS) | ||
19 | |||
20 | -dnl # optional Perl-URPM language bindings | ||
21 | +dnl # disable Perl-URPM language bindings | ||
22 | WITH_PERL_URPM_SUBDIR="" | ||
23 | WITH_PERL_URPM_SUBPACKAGE=0 | ||
24 | WITH_PERL_URPM_LIBS="" | ||
25 | -if test ".$WITH_PTHREADS" = .yes; then | ||
26 | - WITH_PERL_URPM_LIBS="$LIBS" | ||
27 | -fi | ||
28 | -AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [ | ||
29 | - if test ".$withval" != .no; then | ||
30 | - PERL_URPM_INSTALLDIRS="" | ||
31 | - if test "$withval" == "vendor"; then | ||
32 | - PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," | ||
33 | - fi | ||
34 | - if test "$withval" == "site"; then | ||
35 | - PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site'," | ||
36 | - fi | ||
37 | - AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)]) | ||
38 | - AC_SUBST(PERL_URPM_INSTALLDIRS) | ||
39 | - WITH_PERL_URPM_SUBDIR=perl-URPM | ||
40 | - WITH_PERL_URPM_SUBPACKAGE=1 | ||
41 | - AC_CONFIG_FILES([perl-URPM/Makefile.PL]) | ||
42 | - AC_CONFIG_FILES([perl-URPM/Makefile]) | ||
43 | - fi | ||
44 | -]) | ||
45 | AC_SUBST(WITH_PERL_URPM_SUBDIR) | ||
46 | AC_SUBST(WITH_PERL_URPM_SUBPACKAGE) | ||
47 | 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..691aba9ea3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch | |||
@@ -0,0 +1,23 @@ | |||
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 | Index: rpm-5.4.14/configure.ac | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.14.orig/configure.ac | ||
14 | +++ rpm-5.4.14/configure.ac | ||
15 | @@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs. | ||
16 | esac | ||
17 | RPM_CHECK_LIB( | ||
18 | [OSSP uuid], [uuid], | ||
19 | - [ossp-uuid uuid], [uuid_import], [uuid.h], | ||
20 | + [ossp-uuid], [uuid_import], [uuid.h], | ||
21 | [no,external:none], [], | ||
22 | [ dnl # enable OSSP uuid native API support for embedded Lua | ||
23 | 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..c15e12405d --- /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.14/rpmdb/hdrfmt.c | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.14.orig/rpmdb/hdrfmt.c | ||
12 | +++ rpm-5.4.14/rpmdb/hdrfmt.c | ||
13 | @@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h | ||
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-payload-use-hashed-inode.patch b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch new file mode 100644 index 0000000000..9cd02a0f92 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch | |||
@@ -0,0 +1,146 @@ | |||
1 | If we run builds on a filesystem with 64 bit inodes like XFS, we need to | ||
2 | map the inode numbers to something 32 bit since the cpio header only allows | ||
3 | for 32 bit inode values. If we don't do this: | ||
4 | |||
5 | #define SET_NUM_FIELD(phys, val, space) \ | ||
6 | sprintf(space, "%8.8lx", (unsigned long) (val)); \ | ||
7 | memcpy(phys, space, 8) | ||
8 | |||
9 | from cpio.c will print larger that 8 character values and then truncate the | ||
10 | LSBs. This generates cpio files where hardlinked files may have the same | ||
11 | inode number. The resulting rpms are then corrupted. | ||
12 | |||
13 | There is a separate patch for the crash the identical inode numbers causes | ||
14 | when extracting the rpm. | ||
15 | |||
16 | Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15 | ||
17 | |||
18 | RP 2014/6/10 | ||
19 | |||
20 | Upstream-Status: Pending | ||
21 | |||
22 | Index: rpm-5.4.14/build/files.c | ||
23 | =================================================================== | ||
24 | --- rpm-5.4.14.orig/build/files.c | ||
25 | +++ rpm-5.4.14/build/files.c | ||
26 | @@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header | ||
27 | return dalgo; | ||
28 | } | ||
29 | |||
30 | +static int isHardLink(FileListRec flp, FileListRec tlp) | ||
31 | +{ | ||
32 | + return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) && | ||
33 | + ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) && | ||
34 | + (flp->fl_ino == tlp->fl_ino) && | ||
35 | + (flp->fl_dev == tlp->fl_dev)); | ||
36 | +} | ||
37 | + | ||
38 | +static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid) | ||
39 | +{ | ||
40 | + FileListRec ilp; | ||
41 | + for (ilp = fl->fileList; ilp < flp; ilp++) { | ||
42 | + if (isHardLink(flp, ilp)) { | ||
43 | + *fileid = ilp - fl->fileList; | ||
44 | + return 1; | ||
45 | + } | ||
46 | + } | ||
47 | + return 0; | ||
48 | +} | ||
49 | + | ||
50 | /** | ||
51 | * Add file entries to header. | ||
52 | * @todo Should directories have %doc/%config attributes? (#14531) | ||
53 | @@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf)); /* XXX valg | ||
54 | |||
55 | for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) { | ||
56 | const char *s; | ||
57 | + ino_t fileid = flp - fl->fileList; | ||
58 | |||
59 | /* Merge duplicate entries. */ | ||
60 | while (i < (fl->fileListRecsUsed - 1) && | ||
61 | @@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf)); /* XXX valg | ||
62 | /* Leave room for both dirname and basename NUL's */ | ||
63 | dpathlen += (strlen(flp->diskURL) + 2); | ||
64 | |||
65 | + /* Excludes and dupes have been filtered out by now. */ | ||
66 | + if (S_ISREG(flp->fl_mode)) { | ||
67 | + if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) { | ||
68 | + fl->totalFileSize += flp->fl_size; | ||
69 | + } | ||
70 | + } | ||
71 | + | ||
72 | /* | ||
73 | * Make the header, the OLDFILENAMES will get converted to a | ||
74 | * compressed file list write before we write the actual package to | ||
75 | @@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf)); /* XXX valg | ||
76 | |||
77 | /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */ | ||
78 | { ino_t _ino = flp->fl_ino; | ||
79 | + /* don't use hash here, as hash collisions which happen on large packages | ||
80 | + cause bus errors in rpmbuild | ||
81 | ui32 = hashFunctionString(0, &_ino, sizeof(_ino)); | ||
82 | + */ | ||
83 | + ui32 = fileid + 1; | ||
84 | } | ||
85 | he->tag = RPMTAG_FILEINODES; | ||
86 | he->t = RPM_UINT32_TYPE; | ||
87 | @@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) { | ||
88 | IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID; | ||
89 | if (isSrc) | ||
90 | fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS; | ||
91 | - | ||
92 | - if (S_ISREG(flp->fl_mode)) { | ||
93 | - int bingo = 1; | ||
94 | - /* Hard links need be tallied only once. */ | ||
95 | - if (flp->fl_nlink > 1) { | ||
96 | - FileListRec jlp = flp + 1; | ||
97 | - int j = i + 1; | ||
98 | - for (; (unsigned)j < fi->fc; j++, jlp++) { | ||
99 | - /* follow outer loop logic */ | ||
100 | - while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) && | ||
101 | - !strcmp(jlp->fileURL, jlp[1].fileURL)) | ||
102 | - jlp++; | ||
103 | - if (jlp->flags & RPMFILE_EXCLUDE) { | ||
104 | - j--; | ||
105 | - /*@innercontinue@*/ continue; | ||
106 | - } | ||
107 | - if (jlp->flags & RPMFILE_GHOST) | ||
108 | - /*@innercontinue@*/ continue; | ||
109 | - if (!S_ISREG(jlp->fl_mode)) | ||
110 | - /*@innercontinue@*/ continue; | ||
111 | - if (flp->fl_nlink != jlp->fl_nlink) | ||
112 | - /*@innercontinue@*/ continue; | ||
113 | - if (flp->fl_ino != jlp->fl_ino) | ||
114 | - /*@innercontinue@*/ continue; | ||
115 | - if (flp->fl_dev != jlp->fl_dev) | ||
116 | - /*@innercontinue@*/ continue; | ||
117 | - bingo = 0; /* don't tally hardlink yet. */ | ||
118 | - /*@innerbreak@*/ break; | ||
119 | - } | ||
120 | - } | ||
121 | - if (bingo) | ||
122 | - fl->totalFileSize += flp->fl_size; | ||
123 | - } | ||
124 | } | ||
125 | |||
126 | ui32 = fl->totalFileSize; | ||
127 | Index: rpm-5.4.14/lib/fsm.c | ||
128 | =================================================================== | ||
129 | --- rpm-5.4.14.orig/lib/fsm.c | ||
130 | +++ rpm-5.4.14/lib/fsm.c | ||
131 | @@ -904,6 +904,7 @@ int fsmMapAttrs(IOSM_t fsm) | ||
132 | |||
133 | if (fi && i >= 0 && i < (int) fi->fc) { | ||
134 | mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms); | ||
135 | + ino_t finalInode = (fi->finodes ? (ino_t)fi->finodes[i] : 0); | ||
136 | mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms); | ||
137 | dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0); | ||
138 | rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0); | ||
139 | @@ -943,6 +944,7 @@ int fsmMapAttrs(IOSM_t fsm) | ||
140 | if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) | ||
141 | && st->st_nlink == 0) | ||
142 | st->st_nlink = 1; | ||
143 | + st->st_ino = finalInode; | ||
144 | st->st_rdev = finalRdev; | ||
145 | st->st_mtime = finalMtime; | ||
146 | } | ||
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..5d182ad9fe --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch | |||
@@ -0,0 +1,37 @@ | |||
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 | Index: rpm-5.4.14/scripts/pkgconfigdeps.sh | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.14.orig/scripts/pkgconfigdeps.sh | ||
15 | +++ rpm-5.4.14/scripts/pkgconfigdeps.sh | ||
16 | @@ -18,8 +18,8 @@ case $1 in | ||
17 | *.pc) | ||
18 | # Query the dependencies of the package. | ||
19 | DIR=`dirname ${filename}` | ||
20 | - PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" | ||
21 | - export PKG_CONFIG_PATH | ||
22 | + PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" | ||
23 | + export PKG_CONFIG_LIBDIR | ||
24 | $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do | ||
25 | [ -n "$n" ] || continue | ||
26 | # We have a dependency. Make a note that we need the pkgconfig | ||
27 | @@ -42,8 +42,8 @@ case $1 in | ||
28 | [ -n "$oneshot" ] && echo "$oneshot"; oneshot="" | ||
29 | # Query the dependencies of the package. | ||
30 | DIR=`dirname ${filename}` | ||
31 | - PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" | ||
32 | - export PKG_CONFIG_PATH | ||
33 | + PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" | ||
34 | + export PKG_CONFIG_LIBDIR | ||
35 | $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do | ||
36 | [ -n "$n" ] || continue | ||
37 | 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..f26a6e79da --- /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 | Index: rpm-5.4.14/lib/rpmrc.c | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
10 | +++ rpm-5.4.14/lib/rpmrc.c | ||
11 | @@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl | ||
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 * pl | ||
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..11fd039036 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch | |||
@@ -0,0 +1,137 @@ | |||
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 | Index: rpm-5.4.14/lib/depends.c | ||
10 | =================================================================== | ||
11 | --- rpm-5.4.14.orig/lib/depends.c | ||
12 | +++ rpm-5.4.14/lib/depends.c | ||
13 | @@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp | ||
14 | he->p.ptr = _free(he->p.ptr); | ||
15 | } | ||
16 | |||
17 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
18 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
19 | /* | ||
20 | * If we're capable of installing multiple colors | ||
21 | * but at least one of the packages are white (0), we | ||
22 | @@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
27 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
28 | /* Is "compat" compatible w/ arch? */ | ||
29 | int _isCompatibleArch(const char * arch, const char * compat) | ||
30 | { | ||
31 | @@ -663,7 +663,7 @@ assert(he->p.str != NULL); | ||
32 | |||
33 | if (arch == NULL || (parch = rpmteA(p)) == NULL) | ||
34 | continue; | ||
35 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
36 | +#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) | ||
37 | /* XXX hackery for alias matching. */ | ||
38 | if (!_isCompatibleArch(arch, parch)) | ||
39 | continue; | ||
40 | @@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade | ||
41 | return rc; | ||
42 | } | ||
43 | |||
44 | +#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) | ||
45 | +#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo" | ||
46 | +#else | ||
47 | +#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo" | ||
48 | +#endif | ||
49 | + | ||
50 | /*@only@*/ /*@null@*/ /*@unchecked@*/ | ||
51 | static char *sysinfo_path = NULL; | ||
52 | |||
53 | @@ -1311,7 +1317,7 @@ retry: | ||
54 | sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL); | ||
55 | if (!(sysinfo_path != NULL && *sysinfo_path == '/')) { | ||
56 | sysinfo_path = _free(sysinfo_path); | ||
57 | - sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo"); | ||
58 | + sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | Index: rpm-5.4.14/lib/rpmds.c | ||
63 | =================================================================== | ||
64 | --- rpm-5.4.14.orig/lib/rpmds.c | ||
65 | +++ rpm-5.4.14/lib/rpmds.c | ||
66 | @@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha | ||
67 | /*@-observertrans @*/ | ||
68 | _sysinfo_path = _free(_sysinfo_path); | ||
69 | /*@=observertrans @*/ | ||
70 | - _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO); | ||
71 | + _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); | ||
72 | } | ||
73 | } | ||
74 | /*@=modobserver@*/ | ||
75 | Index: rpm-5.4.14/lib/rpmrc.c | ||
76 | =================================================================== | ||
77 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
78 | +++ rpm-5.4.14/lib/rpmrc.c | ||
79 | @@ -38,7 +38,13 @@ | ||
80 | static const char * configTarget = NULL; | ||
81 | |||
82 | /*@observer@*/ /*@unchecked@*/ | ||
83 | -static const char * platform = SYSCONFIGDIR "/platform"; | ||
84 | +#if defined(RPM_VENDOR_WINDRIVER) | ||
85 | +#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform" | ||
86 | +#else | ||
87 | +#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform" | ||
88 | +#endif | ||
89 | + | ||
90 | +static const char * _platform = NULL; | ||
91 | |||
92 | /*@only@*/ /*@relnull@*/ /*@unchecked@*/ | ||
93 | void * platpat = NULL; | ||
94 | @@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con | ||
95 | int rc; | ||
96 | |||
97 | while (!gotDefaults) { | ||
98 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
99 | - const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL); | ||
100 | -#else | ||
101 | - const char * _platform = platform; | ||
102 | -#endif | ||
103 | + if (_platform == NULL) { | ||
104 | + _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL); | ||
105 | + /* XXX may need to validate path existence somewhen. */ | ||
106 | + if (!(_platform != NULL && *_platform == '/')) { | ||
107 | + _platform = _free(_platform); | ||
108 | + _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL); | ||
109 | + } | ||
110 | + } | ||
111 | CVOG_t cvog = NULL; | ||
112 | #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ | ||
113 | const char *cp; | ||
114 | -#endif | ||
115 | -#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ | ||
116 | /* utsname fields on some platforms (like HP-UX) are very small | ||
117 | (just about 8 characters). This is too small for OpenPKG, so cheat! */ | ||
118 | rc = uname(&un_real); | ||
119 | @@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con | ||
120 | if (cp != NULL && cp != _platform) | ||
121 | cp = _free(cp); | ||
122 | #endif | ||
123 | -#if defined(RPM_VENDOR_WINDRIVER) | ||
124 | _platform = _free(_platform); | ||
125 | -#endif | ||
126 | |||
127 | if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) { | ||
128 | gotDefaults = 1; | ||
129 | @@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons | ||
130 | |||
131 | #ifdef PREMACROFILES | ||
132 | if (rpmReadRC(PREMACROFILES)) return -1; | ||
133 | +#else | ||
134 | + if (rpmReadRC(NULL)) return -1; | ||
135 | #endif | ||
136 | |||
137 | /* 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..fed54e5f11 --- /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.14/lib/rpmrc.c | ||
17 | =================================================================== | ||
18 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
19 | +++ rpm-5.4.14/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.14/macros/macros.in | ||
61 | =================================================================== | ||
62 | --- rpm-5.4.14.orig/macros/macros.in | ||
63 | +++ rpm-5.4.14/macros/macros.in | ||
64 | @@ -900,9 +900,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 | @@ -945,9 +945,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.14/python/rpmmodule.c | ||
92 | =================================================================== | ||
93 | --- rpm-5.4.14.orig/python/rpmmodule.c | ||
94 | +++ rpm-5.4.14/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..07d407d36a --- /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 | Index: rpm-5.4.14/python/rpmmodule.c | ||
15 | =================================================================== | ||
16 | --- rpm-5.4.14.orig/python/rpmmodule.c | ||
17 | +++ rpm-5.4.14/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-realpath.patch b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch new file mode 100644 index 0000000000..58863774f6 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | chroot: realpath is required before expanding _dbpath | ||
2 | |||
3 | _usr turned out to be a relative path to support dyanmic config, but it's | ||
4 | being used somewhere as a indicator to locate substrings, so we must get | ||
5 | the real path of it in advance. | ||
6 | |||
7 | Upstream-Status: Inapproriate (OpenEmbedded specific) | ||
8 | |||
9 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
10 | |||
11 | diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c | ||
12 | --- a/rpmio/rpmrpc.c | ||
13 | +++ b/rpmio/rpmrpc.c | ||
14 | @@ -257,7 +257,9 @@ int Open(const char * path, int flags, m | ||
15 | /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */ | ||
16 | if (fdno < 0 && errno == ENOENT) { | ||
17 | const char *dbpath = rpmExpand("%{?_dbpath}/", NULL); | ||
18 | - const char * fn = strstr(path + 1, dbpath); | ||
19 | + char resolved_dbpath[PATH_MAX]; | ||
20 | + realpath(dbpath, resolved_dbpath); | ||
21 | + const char * fn = strstr(path + 1, resolved_dbpath); | ||
22 | if (fn) | ||
23 | fdno = open(fn, flags, mode); | ||
24 | dbpath = _free(dbpath); | ||
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..0a5f5a4d72 --- /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.14/macros/macros.in | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.14.orig/macros/macros.in | ||
14 | +++ rpm-5.4.14/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..769016b564 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Index: rpm-5.4.14/syck/lib/syck.h | ||
2 | =================================================================== | ||
3 | --- rpm-5.4.14.orig/syck/lib/syck.h | ||
4 | +++ rpm-5.4.14/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..56a243d5f7 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch | |||
@@ -0,0 +1,40 @@ | |||
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 | Index: rpm-5.4.14/lib/rpmts.c | ||
11 | =================================================================== | ||
12 | --- rpm-5.4.14.orig/lib/rpmts.c | ||
13 | +++ rpm-5.4.14/lib/rpmts.c | ||
14 | @@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __ | ||
15 | if (sdb == NULL) | ||
16 | continue; | ||
17 | |||
18 | - /* Look for a matching Provides: in suggested universe. */ | ||
19 | - rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME); | ||
20 | + rpmtag = RPMTAG_PROVIDENAME; | ||
21 | + do { | ||
22 | mi = rpmmiInit(sdb, rpmtag, keyp, keylen); | ||
23 | while ((h = rpmmiNext(mi)) != NULL) { | ||
24 | size_t hnamelen; | ||
25 | @@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __ | ||
26 | bhnamelen = hnamelen; | ||
27 | } | ||
28 | mi = rpmmiFree(mi); | ||
29 | + | ||
30 | + if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) { | ||
31 | + rpmtag = RPMTAG_FILEPATHS; | ||
32 | + continue; | ||
33 | + } | ||
34 | + | ||
35 | + break; | ||
36 | + } while (1); | ||
37 | + | ||
38 | } | ||
39 | |||
40 | /* Is there a suggested resolution? */ | ||
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch new file mode 100644 index 0000000000..fcbc25df0e --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | rpmpgp.c: Add missing if defs around crypto implementations | ||
2 | |||
3 | Without these, the system will error trying to find the correct crypto | ||
4 | library to use. | ||
5 | |||
6 | Upstream-status: Pending | ||
7 | |||
8 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
9 | |||
10 | Index: rpm/rpmio/rpmpgp.c | ||
11 | =================================================================== | ||
12 | --- rpm.orig/rpmio/rpmpgp.c | ||
13 | +++ rpm/rpmio/rpmpgp.c | ||
14 | @@ -1339,16 +1339,26 @@ int pgpExportPubkey(pgpDig dig) | ||
15 | { | ||
16 | int rc = 0; /* assume failure */ | ||
17 | |||
18 | +#if defined(WITH_BEECRYPT) | ||
19 | if (pgpImplVecs == &rpmbcImplVecs) | ||
20 | rc = rpmbcExportPubkey(dig); | ||
21 | +#endif | ||
22 | +#if defined(WITH_SSL) | ||
23 | if (pgpImplVecs == &rpmsslImplVecs) | ||
24 | rc = rpmsslExportPubkey(dig); | ||
25 | +#endif | ||
26 | +#if defined(WITH_NSS) | ||
27 | if (pgpImplVecs == &rpmnssImplVecs) | ||
28 | rc = rpmnssExportPubkey(dig); | ||
29 | +#endif | ||
30 | +#if defined(WITH_GCRYPT) | ||
31 | if (pgpImplVecs == &rpmgcImplVecs) | ||
32 | rc = rpmgcExportPubkey(dig); | ||
33 | +#endif | ||
34 | +#if defined(WITH_TOMCRYPT) | ||
35 | if (pgpImplVecs == &rpmltcImplVecs) | ||
36 | rc = rpmltcExportPubkey(dig); | ||
37 | +#endif | ||
38 | return rc; | ||
39 | } | ||
40 | |||
41 | @@ -1356,16 +1366,26 @@ int pgpExportSignature(pgpDig dig, DIGES | ||
42 | { | ||
43 | int rc = 0; /* assume failure */ | ||
44 | |||
45 | +#if defined(WITH_BEECRYPT) | ||
46 | if (pgpImplVecs == &rpmbcImplVecs) | ||
47 | rc = rpmbcExportSignature(dig, ctx); | ||
48 | +#endif | ||
49 | +#if defined(WITH_SSL) | ||
50 | if (pgpImplVecs == &rpmsslImplVecs) | ||
51 | rc = rpmsslExportSignature(dig, ctx); | ||
52 | +#endif | ||
53 | +#if defined(WITH_NSS) | ||
54 | if (pgpImplVecs == &rpmnssImplVecs) | ||
55 | rc = rpmnssExportSignature(dig, ctx); | ||
56 | +#endif | ||
57 | +#if defined(WITH_GCRYPT) | ||
58 | if (pgpImplVecs == &rpmgcImplVecs) | ||
59 | rc = rpmgcExportSignature(dig, ctx); | ||
60 | +#endif | ||
61 | +#if defined(WITH_TOMCRYPT) | ||
62 | if (pgpImplVecs == &rpmltcImplVecs) | ||
63 | rc = rpmltcExportSignature(dig, ctx); | ||
64 | +#endif | ||
65 | return rc; | ||
66 | } | ||
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..f825372e82 --- /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.14/lib/psm.c | ||
16 | =================================================================== | ||
17 | --- rpm-5.4.14.orig/lib/psm.c | ||
18 | +++ rpm-5.4.14/lib/psm.c | ||
19 | @@ -806,6 +806,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 | @@ -872,14 +876,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 | @@ -930,7 +949,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 | @@ -1065,12 +1089,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 | @@ -2985,6 +3019,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 | @@ -2992,11 +3033,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 | @@ -3006,7 +3060,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..ec38b95f2e --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch | |||
@@ -0,0 +1,26 @@ | |||
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 | Index: rpm-5.4.14/lib/rpmrc.c | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/lib/rpmrc.c | ||
10 | +++ rpm-5.4.14/lib/rpmrc.c | ||
11 | @@ -1228,11 +1228,15 @@ int rpmShowRC(FILE * fp) | ||
12 | if (DNEVR != NULL) | ||
13 | fprintf(fp, " %s\n", DNEVR+2); | ||
14 | } | ||
15 | +#if 0 | ||
16 | (void)rpmdsFree(ds); | ||
17 | ds = NULL; | ||
18 | +#endif | ||
19 | fprintf(fp, "\n"); | ||
20 | } | ||
21 | +#if 0 | ||
22 | PRCO = rpmdsFreePRCO(PRCO); | ||
23 | +#endif | ||
24 | } | ||
25 | |||
26 | if (rpmIsVerbose()) { | ||
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..683275cb18 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch | |||
@@ -0,0 +1,50 @@ | |||
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 | Index: rpm-5.4.14/rpmdb/tagname.c | ||
17 | =================================================================== | ||
18 | --- rpm-5.4.14.orig/rpmdb/tagname.c | ||
19 | +++ rpm-5.4.14/rpmdb/tagname.c | ||
20 | @@ -3,6 +3,19 @@ | ||
21 | */ | ||
22 | |||
23 | #include "system.h" | ||
24 | +#include <endian.h> | ||
25 | + | ||
26 | +/* Don't redefine this macro if it already exists */ | ||
27 | +#ifndef le32toh | ||
28 | +#ifdef __USE_BSD | ||
29 | +#include <byteswap.h> | ||
30 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
31 | +#define le32toh(x) (x) | ||
32 | +#else | ||
33 | +#define le32toh(x) __bswap_32(x) | ||
34 | +#endif | ||
35 | +#endif /* __USE_BSD */ | ||
36 | +#endif /* le32toh */ | ||
37 | |||
38 | #include <rpmio_internal.h> /* XXX DIGEST_CTX, xtolower, xstrcasecmp */ | ||
39 | #include <rpmmacro.h> | ||
40 | @@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s | ||
41 | xx = rpmDigestUpdate(ctx, s, nb); | ||
42 | xx = rpmDigestFinal(ctx, &digest, &digestlen, 0); | ||
43 | if (digest && digestlen > 4) { | ||
44 | + /* The tag is stored in a uniform byte order for cross-endian compatibility. | ||
45 | + Swap to the host uses. */ | ||
46 | memcpy(&tag, digest + (digestlen - 4), 4); | ||
47 | + tag = le32toh(tag); | ||
48 | tag = (rpmTag) (tag & 0x3fffffff); | ||
49 | tag = (rpmTag) (tag | 0x40000000); | ||
50 | } | ||
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..cb85bebfc0 --- /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-native 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.14/tools/Makefile.am | ||
13 | =================================================================== | ||
14 | --- rpm-5.4.14.orig/tools/Makefile.am | ||
15 | +++ rpm-5.4.14/tools/Makefile.am | ||
16 | @@ -186,7 +186,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..713f84ee27 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch | |||
@@ -0,0 +1,40 @@ | |||
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 | Index: rpm-5.4.14/lua/local/luuid.c | ||
16 | =================================================================== | ||
17 | --- rpm-5.4.14.orig/lua/local/luuid.c | ||
18 | +++ rpm-5.4.14/lua/local/luuid.c | ||
19 | @@ -21,7 +21,7 @@ | ||
20 | |||
21 | #ifdef LUA_USE_UUID | ||
22 | |||
23 | -#include "uuid.h" | ||
24 | +#include <ossp/uuid.h> | ||
25 | |||
26 | /* Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>]) */ | ||
27 | static int luuid_generate(lua_State *L) | ||
28 | Index: rpm-5.4.14/rpmio/rpmuuid.c | ||
29 | =================================================================== | ||
30 | --- rpm-5.4.14.orig/rpmio/rpmuuid.c | ||
31 | +++ rpm-5.4.14/rpmio/rpmuuid.c | ||
32 | @@ -16,7 +16,7 @@ | ||
33 | #include "rpmlog.h" | ||
34 | #include "rpmuuid.h" | ||
35 | #ifdef WITH_UUID | ||
36 | -#include "uuid.h" | ||
37 | +#include <ossp/uuid.h> | ||
38 | #endif | ||
39 | #include "debug.h" | ||
40 | |||
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..20d13aa08c --- /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.14/configure.ac | ||
12 | =================================================================== | ||
13 | --- rpm-5.4.14.orig/configure.ac | ||
14 | +++ rpm-5.4.14/configure.ac | ||
15 | @@ -943,7 +943,7 @@ AC_CHECK_FUNCS([dnl | ||
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 __secure_getenv dnl | ||
20 | + posix_fadvise posix_fallocate putenv realpath regcomp rpmatch secure_getenv __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.14/system.h | ||
25 | =================================================================== | ||
26 | --- rpm-5.4.14.orig/system.h | ||
27 | +++ rpm-5.4.14/system.h | ||
28 | @@ -353,6 +353,14 @@ extern int _tolower(int) __THROW /*@*/; | ||
29 | #include <libgen.h> | ||
30 | #endif | ||
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..9bdd1d4908 --- /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.14/tools/Makefile.am | ||
20 | =================================================================== | ||
21 | --- rpm-5.4.14.orig/tools/Makefile.am | ||
22 | +++ rpm-5.4.14/tools/Makefile.am | ||
23 | @@ -62,7 +62,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 | @@ -172,6 +172,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.14/tools/rpmdeps-oecore.c | ||
44 | =================================================================== | ||
45 | --- /dev/null | ||
46 | +++ rpm-5.4.14/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/rpmqv_cc_b_gone.patch b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch new file mode 100644 index 0000000000..f08bd688f1 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | rpm: compile rpmqv.c instead of rpmqv.cc | ||
2 | |||
3 | Some versions of gcc, 4.4.5 for example, will put a reference to __gxx_personality_v0 | ||
4 | into rpm.o and rpmbuild.o. This means we must link with g++, and the Makefile we | ||
5 | generate does not. | ||
6 | |||
7 | So, go back to using rpmqv.c (which is currently identical to rpmqv.cc). | ||
8 | |||
9 | Upstream-Status: Inappropriate [other] | ||
10 | |||
11 | When linking with g++ is really necessary, the upstream package will do that. | ||
12 | |||
13 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
14 | |||
15 | --- a/Makefile.am | ||
16 | +++ b/Makefile.am | ||
17 | @@ -127,13 +127,13 @@ rpm_SOURCES = build.c | ||
18 | rpm_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
19 | rpm_LDADD = rpm.o $(myLDADD) | ||
20 | rpm.o: $(top_srcdir)/rpmqv.c | ||
21 | - $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.cc | ||
22 | + $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.c | ||
23 | |||
24 | rpmbuild_SOURCES = build.c | ||
25 | rpmbuild_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
26 | rpmbuild_LDADD = rpmbuild.o $(myLDADD) | ||
27 | rpmbuild.o: $(top_srcdir)/rpmqv.c | ||
28 | - $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.cc | ||
29 | + $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.c | ||
30 | |||
31 | .PHONY: splint | ||
32 | splint: | ||
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..8870adb9e7 --- /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.14/rpmio/rpmio.h | ||
8 | =================================================================== | ||
9 | --- rpm-5.4.14.orig/rpmio/rpmio.h | ||
10 | +++ rpm-5.4.14/rpmio/rpmio.h | ||
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.14/system.h | ||
22 | =================================================================== | ||
23 | --- rpm-5.4.14.orig/system.h | ||
24 | +++ rpm-5.4.14/system.h | ||
25 | @@ -481,7 +481,7 @@ extern void muntrace (void) | ||
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.14/lib/librpm.vers | ||
35 | =================================================================== | ||
36 | --- rpm-5.4.14.orig/lib/librpm.vers | ||
37 | +++ rpm-5.4.14/lib/librpm.vers | ||
38 | @@ -405,6 +405,10 @@ LIBRPM_0 | ||
39 | specedit; | ||
40 | strict_erasures; | ||
41 | XrpmtsiInit; | ||
42 | + xmalloc; | ||
43 | + xrealloc; | ||
44 | + xcalloc; | ||
45 | + xstrdup; | ||
46 | local: | ||
47 | *; | ||
48 | }; | ||
49 | Index: rpm-5.4.14/rpmio/librpmio.vers | ||
50 | =================================================================== | ||
51 | --- rpm-5.4.14.orig/rpmio/librpmio.vers | ||
52 | +++ rpm-5.4.14/rpmio/librpmio.vers | ||
53 | @@ -1056,6 +1056,10 @@ LIBRPMIO_0 | ||
54 | mongo_write_concern_set_mode; | ||
55 | mongo_write_concern_set_w; | ||
56 | mongo_write_concern_set_wtimeout; | ||
57 | + xmalloc; | ||
58 | + xrealloc; | ||
59 | + xcalloc; | ||
60 | + xstrdup; | ||
61 | local: | ||
62 | *; | ||
63 | }; | ||
diff --git a/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch new file mode 100644 index 0000000000..5a70f14f29 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 9e7b72ee0c994609975981e135fc18d0387aefb6 Mon Sep 17 00:00:00 2001 | ||
2 | From: jbj <jbj> | ||
3 | Date: Wed, 14 May 2014 21:19:41 +0000 | ||
4 | Subject: [PATCH] - verify: fix: broken logic for %ghost avoidance (Mark | ||
5 | Hatle). | ||
6 | |||
7 | Upstream-status: backport | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | --- | ||
11 | CHANGES | 1 + | ||
12 | lib/verify.c | 3 +-- | ||
13 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | Index: rpm-5.4.14/CHANGES | ||
16 | =================================================================== | ||
17 | --- rpm-5.4.14.orig/CHANGES | ||
18 | +++ rpm-5.4.14/CHANGES | ||
19 | @@ -1,3 +1,5 @@ | ||
20 | + - jbj: verify: fix: broken logic for %ghost avoidance (Mark Hatle). | ||
21 | + | ||
22 | 5.4.13 -> 5.4.14: | ||
23 | - mooney: use __sun instead of __sun__ in #define (lp#1243472). | ||
24 | - mooney: rpmconstant: ensure linkage w Oracle Studio 12.3 (lp#1243469). | ||
25 | Index: rpm-5.4.14/lib/verify.c | ||
26 | =================================================================== | ||
27 | --- rpm-5.4.14.orig/lib/verify.c | ||
28 | +++ rpm-5.4.14/lib/verify.c | ||
29 | @@ -588,8 +588,7 @@ uint32_t fc = rpmfiFC(fi); | ||
30 | continue; | ||
31 | |||
32 | /* If not verifying %ghost, skip ghost files. */ | ||
33 | - /* XXX the broken!!! logic disables %ghost queries always. */ | ||
34 | - if (!(FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST))) | ||
35 | + if (!FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST)) | ||
36 | continue; | ||
37 | |||
38 | /* Gather per-file data into a carrier. */ | ||
diff --git a/meta/recipes-devtools/rpm/rpm_4.11.2.bb b/meta/recipes-devtools/rpm/rpm_4.11.2.bb new file mode 100644 index 0000000000..7c67b696a3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm_4.11.2.bb | |||
@@ -0,0 +1,135 @@ | |||
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}-dev = "Development files for manipulating RPM packages" | ||
9 | DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \ | ||
10 | development files will simplify the process of writing programs that \ | ||
11 | manipulate RPM packages and databases. These files are intended to \ | ||
12 | simplify the process of creating graphical package managers or any \ | ||
13 | other tools that need an intimate knowledge of RPM packages in order \ | ||
14 | to function." | ||
15 | |||
16 | SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages" | ||
17 | DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \ | ||
18 | written in the Python programming language to use the interface \ | ||
19 | supplied by the RPM Package Manager libraries." | ||
20 | |||
21 | HOMEPAGE = "http://www.rpm.org" | ||
22 | LICENSE = "GPL-2.0+" | ||
23 | LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
24 | |||
25 | DEPENDS = "db libxml2 xz findutils file popt nss bzip2 elfutils patch attr zlib acl gzip make binutils python" | ||
26 | |||
27 | SRC_URI += "http://rpm.org/releases/rpm-4.11.x/${BP}.tar.bz2 \ | ||
28 | file://use-pkgconfig-for-python.patch \ | ||
29 | file://remove-db3-from-configure.patch \ | ||
30 | file://add_RPMSENSE_MISSINGOK_to_rpmmodule.patch \ | ||
31 | file://support-suggests-tag.patch \ | ||
32 | file://remove-dir-check.patch \ | ||
33 | file://disable_shortcircuited.patch \ | ||
34 | file://fix_libdir.patch \ | ||
35 | file://rpm-scriptetexechelp.patch \ | ||
36 | file://pythondeps.sh \ | ||
37 | file://rpm-CVE-2014-8118.patch \ | ||
38 | file://rpm-CVE-2013-6435.patch \ | ||
39 | " | ||
40 | |||
41 | SRC_URI[md5sum] = "876ac9948a88367054f8ddb5c0e87173" | ||
42 | SRC_URI[sha256sum] = "403f8de632b33846ce5746f429c21a60f40dff9dcb56f1b4118f37a0652a48d4" | ||
43 | |||
44 | inherit autotools-brokensep | ||
45 | inherit pythonnative | ||
46 | inherit pkgconfig | ||
47 | inherit gettext | ||
48 | |||
49 | EXTRA_OECONF += "--host=${HOST_SYS} \ | ||
50 | --program-prefix= \ | ||
51 | --prefix=${prefix} \ | ||
52 | --exec-prefix=${prefix} \ | ||
53 | --bindir=${prefix}/bin \ | ||
54 | --sbindir=${prefix}/sbin \ | ||
55 | --sysconfdir=${sysconfdir} \ | ||
56 | --datadir=${prefix}/share \ | ||
57 | --includedir=${prefix}/include \ | ||
58 | --libdir=${prefix}/lib \ | ||
59 | --libexecdir=${prefix}/libexec \ | ||
60 | --localstatedir=${localstatedir} \ | ||
61 | --sharedstatedir=${prefix}/com \ | ||
62 | --mandir=${mandir} \ | ||
63 | --infodir=${infodir} \ | ||
64 | --disable-dependency-tracking \ | ||
65 | --with-acl \ | ||
66 | --without-lua \ | ||
67 | --without-cap \ | ||
68 | --enable-shared \ | ||
69 | --enable-python \ | ||
70 | --with-external-db \ | ||
71 | " | ||
72 | |||
73 | CPPFLAGS_append = " `pkg-config --cflags nss`" | ||
74 | LDFLAGS_append = " -Wl,-Bsymbolic-functions -ffunction-sections" | ||
75 | CCFLAGS_append = " -fPIC " | ||
76 | CXXFLAGS_append = " -fPIC " | ||
77 | CFLAGS_append = " -fPIC -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE " | ||
78 | |||
79 | do_configure_prepend() { | ||
80 | rm -rf sqlite | ||
81 | rm -f m4/libtool.m4 | ||
82 | rm -f m4/lt*.m4 | ||
83 | rm -rf db3/configure* | ||
84 | } | ||
85 | |||
86 | do_install_append() { | ||
87 | mv ${D}/${base_bindir}/rpm ${D}/${bindir}/ | ||
88 | rmdir ${D}/${base_bindir} | ||
89 | rm -f ${D}${prefix}/lib/*.la | ||
90 | rm -f ${D}${prefix}/lib/rpm-plugins/*.la | ||
91 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la} | ||
92 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la} | ||
93 | rm -fr ${D}/var | ||
94 | install -d ${D}${prefix}/lib/rpm/bin | ||
95 | ln -s ../debugedit ${D}${prefix}/lib/rpm/bin/debugedit | ||
96 | ln -s ../rpmdeps ${D}${prefix}/lib/rpm/bin/rpmdeps-oecore | ||
97 | install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh | ||
98 | } | ||
99 | |||
100 | pkg_postinst_${PN}() { | ||
101 | |||
102 | [ "x\$D" == "x" ] && ldconfig | ||
103 | test -f ${localstatedir}/lib/rpm/Packages || rpm --initdb | ||
104 | rm -f ${localstatedir}/lib/rpm/Filemd5s \ | ||
105 | ${localstatedir}/lib/rpm/Filedigests \ | ||
106 | ${localstatedir}/lib/rpm/Requireversion \ | ||
107 | ${localstatedir}/lib/rpm/Provideversion | ||
108 | |||
109 | } | ||
110 | |||
111 | pkg_postrm_${PN}() { | ||
112 | [ "x\$D" == "x" ] && ldconfig | ||
113 | |||
114 | } | ||
115 | |||
116 | PACKAGES += "python-${PN}" | ||
117 | PROVIDES += "python-rpm" | ||
118 | |||
119 | FILES_${PN} += "${libdir}/rpm \ | ||
120 | ${libdir}/rpm-plugins/exec.so \ | ||
121 | " | ||
122 | RDEPENDS_${PN} = "base-files run-postinsts" | ||
123 | RDEPENDS_${PN}_class-native = "base-files run-postinsts" | ||
124 | |||
125 | FILES_${PN}-dbg += "${libdir}/rpm/.debug/* \ | ||
126 | ${libdir}/rpm-plugins/.debug/* \ | ||
127 | ${libdir}/python2.7/site-packages/rpm/.debug/* \ | ||
128 | " | ||
129 | |||
130 | FILES_${PN}-dev += "${libdir}/python2.7/site-packages/rpm/*.la" | ||
131 | |||
132 | FILES_python-${PN} = "${libdir}/python2.7/site-packages/rpm/*" | ||
133 | RDEPENDS_python-${PN} = "${PN} python" | ||
134 | |||
135 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb new file mode 100644 index 0000000000..a85e28fa1f --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb | |||
@@ -0,0 +1,529 @@ | |||
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 byacc-native" | ||
46 | |||
47 | S = "${WORKDIR}/rpm" | ||
48 | |||
49 | # Apply various fixups that are unique to the CVS environment | ||
50 | do_fixup_unpack () { | ||
51 | ln -sf ../syck ${S}/syck || : | ||
52 | ln -sf ../lua ${S}/lua || : | ||
53 | ln ${S}/rpmqv.c ${S}/rpmqv.cc || : | ||
54 | } | ||
55 | |||
56 | addtask fixup_unpack after do_unpack before do_patch | ||
57 | |||
58 | # This recipe is really designed for development... to Try out the latest | ||
59 | # community work in progress. | ||
60 | DEFAULT_PREFERENCE = "-1" | ||
61 | |||
62 | # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed | ||
63 | # in order to extract the distribution SRPM into a format we can extract... | ||
64 | SRC_URI = "cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=rpm \ | ||
65 | cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=syck \ | ||
66 | cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=lua \ | ||
67 | file://rpm-log-auto-rm.patch \ | ||
68 | file://rpm-db-reduce.patch \ | ||
69 | file://perfile_rpmdeps.sh \ | ||
70 | file://rpm-autogen.patch \ | ||
71 | file://rpm-libsql-fix.patch \ | ||
72 | file://header-include-fix.patch \ | ||
73 | file://rpm-platform.patch \ | ||
74 | file://rpm-showrc.patch \ | ||
75 | file://rpm-tools-mtree-LDFLAGS.patch \ | ||
76 | file://rpm-fileclass.patch \ | ||
77 | file://rpm-canonarch.patch \ | ||
78 | file://rpm-no-loopmsg.patch \ | ||
79 | file://rpm-scriptletexechelper.patch \ | ||
80 | file://pythondeps.sh \ | ||
81 | file://rpmdeps-oecore.patch \ | ||
82 | file://rpm-resolvedep.patch \ | ||
83 | file://rpm-no-perl-urpm.patch \ | ||
84 | file://rpm-macros.patch \ | ||
85 | file://rpm-lua.patch \ | ||
86 | file://rpm-ossp-uuid.patch \ | ||
87 | file://rpm-packageorigin.patch \ | ||
88 | file://rpm-pkgconfigdeps.patch \ | ||
89 | file://uclibc-support.patch \ | ||
90 | file://rpmatch.patch \ | ||
91 | file://fstack-protector-configure-check.patch \ | ||
92 | file://dbconvert.patch \ | ||
93 | file://rpm-uuid-include.patch \ | ||
94 | file://makefile-am-exec-hook.patch \ | ||
95 | file://rpm-db_buffer_small.patch \ | ||
96 | file://rpm-py-init.patch \ | ||
97 | file://python-rpm-rpmsense.patch \ | ||
98 | file://rpm-reloc-macros.patch \ | ||
99 | file://rpm-platform2.patch \ | ||
100 | file://rpm-remove-sykcparse-decl.patch \ | ||
101 | file://debugedit-segv.patch \ | ||
102 | file://debugedit-valid-file-to-fix-segment-fault.patch \ | ||
103 | file://rpm-platform-file-fix.patch \ | ||
104 | file://rpm-lsb-compatibility.patch \ | ||
105 | file://rpm-tag-generate-endian-conversion-fix.patch \ | ||
106 | file://rpm-hardlink-segfault-fix.patch \ | ||
107 | file://rpm-payload-use-hashed-inode.patch \ | ||
108 | file://rpm-fix-logio-cp.patch \ | ||
109 | file://rpm-db5-or-db6.patch \ | ||
110 | file://rpm-rpmpgp-fix.patch \ | ||
111 | file://rpm-disable-Wno-override-init.patch \ | ||
112 | file://rpm-realpath.patch \ | ||
113 | " | ||
114 | |||
115 | # Uncomment the following line to enable platform score debugging | ||
116 | # This is useful when identifying issues with Smart being unable | ||
117 | # to process certain package feeds. | ||
118 | #SRC_URI += "file://rpm-debug-platform.patch" | ||
119 | |||
120 | inherit autotools gettext | ||
121 | |||
122 | acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" | ||
123 | |||
124 | # Specify the default rpm macros in terms of adjustable variables | ||
125 | rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros" | ||
126 | rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
127 | rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
128 | |||
129 | # sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux | ||
130 | |||
131 | # Note: perl and sqlite w/o db specified does not currently work. | ||
132 | # tcl, augeas, nss, gcrypt, xar and keyutils support is untested. | ||
133 | PACKAGECONFIG ??= "db bzip2 zlib beecrypt openssl libelf python" | ||
134 | |||
135 | PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2," | ||
136 | PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz," | ||
137 | PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib," | ||
138 | PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar," | ||
139 | |||
140 | WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \ | ||
141 | --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \ | ||
142 | --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
143 | --without-pythonembed" | ||
144 | PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python," | ||
145 | |||
146 | # Perl modules are not built, but they could be enabled fairly easily | ||
147 | # the perl module creation and installation would need to be patched. | ||
148 | # (currently has host perl contamination issues) | ||
149 | WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm" | ||
150 | WITHOUT_PERL = "--without-perl --without-perl-urpm" | ||
151 | PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl," | ||
152 | |||
153 | # The --with-dbsql will only tell RPM to check for support, db | ||
154 | # may or may not be built w/ the dbsql support. | ||
155 | WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated" | ||
156 | PACKAGECONFIG[db] = "${WITH_DB},--without-db,db," | ||
157 | |||
158 | PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3," | ||
159 | |||
160 | PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--without-beecrypt,beecrypt," | ||
161 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," | ||
162 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss," | ||
163 | PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt," | ||
164 | PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils," | ||
165 | PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils," | ||
166 | |||
167 | WITH_SELINUX = "--with-selinux --with-sepol --with-semanage" | ||
168 | WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage" | ||
169 | PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux," | ||
170 | |||
171 | WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi" | ||
172 | WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi" | ||
173 | PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat," | ||
174 | |||
175 | PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat," | ||
176 | PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl," | ||
177 | |||
178 | PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas," | ||
179 | |||
180 | EXTRA_OECONF += "--verbose \ | ||
181 | --sysconfdir=${sysconfdir} \ | ||
182 | --with-file \ | ||
183 | --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \ | ||
184 | --with-syck=internal \ | ||
185 | --without-readline \ | ||
186 | --without-libtasn1 \ | ||
187 | --without-pakchois \ | ||
188 | --without-gnutls \ | ||
189 | --with-pcre \ | ||
190 | --enable-utf8 \ | ||
191 | --with-uuid \ | ||
192 | --with-attr \ | ||
193 | --with-acl \ | ||
194 | --with-popt=external \ | ||
195 | --with-pthreads \ | ||
196 | --without-cudf \ | ||
197 | --without-ficl \ | ||
198 | --without-aterm \ | ||
199 | --without-nix \ | ||
200 | --without-bash \ | ||
201 | --without-rc \ | ||
202 | --without-js \ | ||
203 | --without-gpsee \ | ||
204 | --without-ruby \ | ||
205 | --without-squirrel \ | ||
206 | --with-build-extlibdep \ | ||
207 | --with-build-maxextlibdep \ | ||
208 | --without-valgrind \ | ||
209 | --disable-openmp \ | ||
210 | --enable-build-pic \ | ||
211 | --enable-build-versionscript \ | ||
212 | --enable-build-warnings \ | ||
213 | --enable-build-debug \ | ||
214 | --enable-maintainer-mode \ | ||
215 | --with-path-macros=${rpm_macros} \ | ||
216 | --with-path-lib=${libdir}/rpm \ | ||
217 | --with-bugreport=http://bugzilla.yoctoproject.org \ | ||
218 | --program-prefix= \ | ||
219 | YACC=byacc" | ||
220 | |||
221 | CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE" | ||
222 | |||
223 | LDFLAGS_append_libc-uclibc = "-lrt -lpthread" | ||
224 | |||
225 | 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" | ||
226 | |||
227 | SOLIBS = "5.4.so" | ||
228 | |||
229 | # Based on %files section in the rpm.spec | ||
230 | |||
231 | FILES_${PN} = "${bindir}/rpm \ | ||
232 | ${bindir}/rpmconstant \ | ||
233 | ${libdir}/rpm/rpm.* \ | ||
234 | ${libdir}/rpm/tgpg \ | ||
235 | ${libdir}/rpm/macros \ | ||
236 | ${libdir}/rpm/rpmpopt \ | ||
237 | ${libdir}/rpm/rpm2cpio \ | ||
238 | ${libdir}/rpm/vcheck \ | ||
239 | ${libdir}/rpm/helpers \ | ||
240 | ${libdir}/rpm/qf \ | ||
241 | ${libdir}/rpm/cpuinfo.yaml \ | ||
242 | ${libdir}/rpm/bin/mtree \ | ||
243 | ${libdir}/rpm/bin/rpmkey \ | ||
244 | ${libdir}/rpm/bin/rpmrepo \ | ||
245 | ${libdir}/rpm/bin/rpmrepo.real \ | ||
246 | ${libdir}/rpm/bin/rpmspecdump \ | ||
247 | ${libdir}/rpm/bin/rpmspecdump.real \ | ||
248 | ${libdir}/rpm/bin/wget \ | ||
249 | ${localstatedir}/cache \ | ||
250 | ${localstatedir}/cache/rpm \ | ||
251 | ${localstatedir}/cache/wdj \ | ||
252 | ${localstatedir}/lib \ | ||
253 | ${localstatedir}/lib/rpm \ | ||
254 | ${localstatedir}/lib/wdj \ | ||
255 | ${bindir}/rpm.real \ | ||
256 | ${bindir}/rpmconstant.real \ | ||
257 | ${bindir}/rpm2cpio.real \ | ||
258 | " | ||
259 | |||
260 | FILES_${PN}-dbg += "${libdir}/rpm/.debug \ | ||
261 | ${libdir}/rpm/bin/.debug \ | ||
262 | " | ||
263 | |||
264 | FILES_${PN}-common = "${bindir}/rpm2cpio \ | ||
265 | ${bindir}/gendiff \ | ||
266 | ${sysconfdir}/rpm \ | ||
267 | ${localstatedir}/spool/repackage \ | ||
268 | " | ||
269 | |||
270 | FILES_${PN}-libs = "${libdir}/librpm-*.so \ | ||
271 | ${libdir}/librpmconstant-*.so \ | ||
272 | ${libdir}/librpmdb-*.so \ | ||
273 | ${libdir}/librpmio-*.so \ | ||
274 | ${libdir}/librpmmisc-*.so \ | ||
275 | ${libdir}/librpmbuild-*.so \ | ||
276 | " | ||
277 | |||
278 | FILES_${PN}-build = "${prefix}/src/rpm \ | ||
279 | ${bindir}/rpmbuild \ | ||
280 | ${bindir}/rpmbuild.real \ | ||
281 | ${libdir}/rpm/brp-* \ | ||
282 | ${libdir}/rpm/check-files \ | ||
283 | ${libdir}/rpm/cross-build \ | ||
284 | ${libdir}/rpm/find-debuginfo.sh \ | ||
285 | ${libdir}/rpm/find-lang.sh \ | ||
286 | ${libdir}/rpm/find-prov.pl \ | ||
287 | ${libdir}/rpm/find-provides.perl \ | ||
288 | ${libdir}/rpm/find-req.pl \ | ||
289 | ${libdir}/rpm/find-requires.perl \ | ||
290 | ${libdir}/rpm/getpo.sh \ | ||
291 | ${libdir}/rpm/http.req \ | ||
292 | ${libdir}/rpm/javadeps.sh \ | ||
293 | ${libdir}/rpm/mono-find-provides \ | ||
294 | ${libdir}/rpm/mono-find-requires \ | ||
295 | ${libdir}/rpm/executabledeps.sh \ | ||
296 | ${libdir}/rpm/libtooldeps.sh \ | ||
297 | ${libdir}/rpm/osgideps.pl \ | ||
298 | ${libdir}/rpm/perldeps.pl \ | ||
299 | ${libdir}/rpm/perl.prov \ | ||
300 | ${libdir}/rpm/perl.req \ | ||
301 | ${libdir}/rpm/php.prov \ | ||
302 | ${libdir}/rpm/php.req \ | ||
303 | ${libdir}/rpm/pkgconfigdeps.sh \ | ||
304 | ${libdir}/rpm/pythondeps.sh \ | ||
305 | ${libdir}/rpm/bin/debugedit \ | ||
306 | ${libdir}/rpm/bin/debugedit.real \ | ||
307 | ${libdir}/rpm/bin/rpmcache \ | ||
308 | ${libdir}/rpm/bin/rpmcache.real \ | ||
309 | ${libdir}/rpm/bin/rpmcmp \ | ||
310 | ${libdir}/rpm/bin/rpmcmp.real \ | ||
311 | ${libdir}/rpm/bin/rpmdeps \ | ||
312 | ${libdir}/rpm/bin/rpmdeps.real \ | ||
313 | ${libdir}/rpm/bin/rpmdeps-oecore \ | ||
314 | ${libdir}/rpm/bin/rpmdeps-oecore.real \ | ||
315 | ${libdir}/rpm/bin/rpmdigest \ | ||
316 | ${libdir}/rpm/bin/rpmdigest.real \ | ||
317 | ${libdir}/rpm/bin/abi-compliance-checker.pl \ | ||
318 | ${libdir}/rpm/bin/api-sanity-autotest.pl \ | ||
319 | ${libdir}/rpm/bin/chroot \ | ||
320 | ${libdir}/rpm/bin/cp \ | ||
321 | ${libdir}/rpm/bin/dbsql \ | ||
322 | ${libdir}/rpm/bin/find \ | ||
323 | ${libdir}/rpm/bin/install-sh \ | ||
324 | ${libdir}/rpm/bin/lua \ | ||
325 | ${libdir}/rpm/bin/luac \ | ||
326 | ${libdir}/rpm/bin/mkinstalldirs \ | ||
327 | ${libdir}/rpm/bin/rpmlua \ | ||
328 | ${libdir}/rpm/bin/rpmluac \ | ||
329 | ${libdir}/rpm/bin/sqlite3 \ | ||
330 | ${libdir}/rpm/macros.d/cmake \ | ||
331 | ${libdir}/rpm/macros.d/java \ | ||
332 | ${libdir}/rpm/macros.d/libtool \ | ||
333 | ${libdir}/rpm/macros.d/mandriva \ | ||
334 | ${libdir}/rpm/macros.d/mono \ | ||
335 | ${libdir}/rpm/macros.d/perl \ | ||
336 | ${libdir}/rpm/macros.d/php \ | ||
337 | ${libdir}/rpm/macros.d/pkgconfig \ | ||
338 | ${libdir}/rpm/macros.d/python \ | ||
339 | ${libdir}/rpm/macros.d/ruby \ | ||
340 | ${libdir}/rpm/macros.d/selinux \ | ||
341 | ${libdir}/rpm/macros.d/tcl \ | ||
342 | ${libdir}/rpm/macros.rpmbuild \ | ||
343 | ${libdir}/rpm/u_pkg.sh \ | ||
344 | ${libdir}/rpm/vpkg-provides.sh \ | ||
345 | ${libdir}/rpm/vpkg-provides2.sh \ | ||
346 | ${libdir}/rpm/perfile_rpmdeps.sh \ | ||
347 | " | ||
348 | RDEPENDS_${PN} = "base-files run-postinsts" | ||
349 | RDEPENDS_${PN}_class-native = "" | ||
350 | RDEPENDS_${PN}_class-nativesdk = "" | ||
351 | RDEPENDS_${PN}-build = "file bash perl" | ||
352 | |||
353 | RDEPENDS_python-rpm = "${PN}" | ||
354 | |||
355 | FILES_python-rpm-dbg = "${libdir}/python*/site-packages/rpm/.debug/_*" | ||
356 | FILES_python-rpm-dev = "${libdir}/python*/site-packages/rpm/*.la" | ||
357 | FILES_python-rpm-staticdev = "${libdir}/python*/site-packages/rpm/*.a" | ||
358 | FILES_python-rpm = "${libdir}/python*/site-packages/rpm" | ||
359 | |||
360 | FILES_perl-module-rpm = "${libdir}/perl/*/* \ | ||
361 | " | ||
362 | |||
363 | FILES_perl-module-rpm-dev = "${prefix}/share/man/man3/RPM* \ | ||
364 | " | ||
365 | |||
366 | RDEPENDS_${PN}-dev += "bash" | ||
367 | |||
368 | FILES_${PN}-dev = "${includedir}/rpm \ | ||
369 | ${libdir}/librpm.la \ | ||
370 | ${libdir}/librpm.so \ | ||
371 | ${libdir}/librpmconstant.la \ | ||
372 | ${libdir}/librpmconstant.so \ | ||
373 | ${libdir}/librpmdb.la \ | ||
374 | ${libdir}/librpmdb.so \ | ||
375 | ${libdir}/librpmio.la \ | ||
376 | ${libdir}/librpmio.so \ | ||
377 | ${libdir}/librpmmisc.la \ | ||
378 | ${libdir}/librpmmisc.so \ | ||
379 | ${libdir}/librpmbuild.la \ | ||
380 | ${libdir}/librpmbuild.so \ | ||
381 | ${libdir}/rpm/lib/liblua.la \ | ||
382 | ${libdir}/pkgconfig/rpm.pc \ | ||
383 | ${libdir}/rpm/rpmdb_loadcvt \ | ||
384 | " | ||
385 | |||
386 | FILES_${PN}-staticdev = " \ | ||
387 | ${libdir}/librpm.a \ | ||
388 | ${libdir}/librpmconstant.a \ | ||
389 | ${libdir}/librpmdb.a \ | ||
390 | ${libdir}/librpmio.a \ | ||
391 | ${libdir}/librpmmisc.a \ | ||
392 | ${libdir}/librpmbuild.a \ | ||
393 | ${libdir}/rpm/lib/liblua.a \ | ||
394 | " | ||
395 | |||
396 | do_configure() { | ||
397 | # Disable tests! | ||
398 | echo "all:" > ${S}/tests/Makefile.am | ||
399 | sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in | ||
400 | |||
401 | ( cd ${S}; ${S}/autogen.sh ) | ||
402 | |||
403 | # NASTY hack to make sure configure files the right pkg-config file... | ||
404 | sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \ | ||
405 | -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure | ||
406 | |||
407 | ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || : | ||
408 | |||
409 | export varprefix=${localstatedir} | ||
410 | oe_runconf | ||
411 | } | ||
412 | |||
413 | do_install_append() { | ||
414 | sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros | ||
415 | sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros | ||
416 | sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
417 | sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
418 | sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros | ||
419 | sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros | ||
420 | |||
421 | # Enable Debian style arbitrary tags... | ||
422 | sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros | ||
423 | |||
424 | install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh | ||
425 | install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh | ||
426 | |||
427 | # Remove unpackaged files (based on list in rpm.spec) | ||
428 | rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm} | ||
429 | |||
430 | rm -f ${D}/${mandir}/man8/rpmcache.8* | ||
431 | rm -f ${D}/${mandir}/man8/rpmgraph.8* | ||
432 | rm -f ${D}/${mandir}/*/man8/rpmcache.8* | ||
433 | rm -f ${D}/${mandir}/*/man8/rpmgraph.8* | ||
434 | rm -rf ${D}/${mandir}/{fr,ko} | ||
435 | |||
436 | rm -f ${D}/${includedir}/popt.h | ||
437 | rm -f ${D}/${libdir}/libpopt.* | ||
438 | rm -f ${D}/${libdir}/pkgconfig/popt.pc | ||
439 | rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo | ||
440 | rm -f ${D}/${mandir}/man3/popt.3 | ||
441 | |||
442 | rm -f ${D}/${mandir}/man1/xar.1* | ||
443 | rm -f ${D}/${bindir}/xar | ||
444 | rm -rf ${D}/${includedir}/xar | ||
445 | rm -f ${D}/${libdir}/libxar* | ||
446 | |||
447 | rm -f ${D}/${bindir}/lz* | ||
448 | rm -f ${D}/${bindir}/unlzma | ||
449 | rm -f ${D}/${bindir}/unxz | ||
450 | rm -f ${D}/${bindir}/xz* | ||
451 | rm -rf ${D}/${includedir}/lzma* | ||
452 | rm -f ${D}/${mandir}/man1/lz*.1 | ||
453 | rm -f ${D}/${libdir}/pkgconfig/liblzma* | ||
454 | |||
455 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la} | ||
456 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la} | ||
457 | |||
458 | #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \ | ||
459 | # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';' | ||
460 | #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';' | ||
461 | |||
462 | # We don't want the default macro set | ||
463 | rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*} | ||
464 | |||
465 | rm -f ${D}/${libdir}/rpm/dbconvert.sh | ||
466 | |||
467 | rm -f ${D}/${libdir}/rpm/libsqldb.* | ||
468 | |||
469 | # We don't want, nor need the Mandriva multiarch items | ||
470 | rm -f ${D}/${bindir}/multiarch-dispatch | ||
471 | rm -f ${D}/${bindir}/multiarch-platform | ||
472 | rm -f ${D}/${libdir}/rpm/check-multiarch-files | ||
473 | rm -f ${D}/${libdir}/rpm/mkmultiarch | ||
474 | rm -f ${D}/${includedir}/multiarch-dispatch.h | ||
475 | |||
476 | rm -f ${D}/${libdir}/rpm/gstreamer.sh | ||
477 | rm -f ${D}/${libdir}/rpm/gem_helper.rb | ||
478 | rm -f ${D}/${libdir}/rpm/rubygems.rb | ||
479 | rm -f ${D}/${libdir}/rpm/kmod-deps.sh | ||
480 | rm -f ${D}/${libdir}/rpm/pythoneggs.py | ||
481 | rm -f ${D}/${libdir}/rpm/macros.d/kernel | ||
482 | rm -f ${D}/${libdir}/rpm/macros.d/gstreamer | ||
483 | rm -f ${D}/${libdir}/rpm/bin/mgo | ||
484 | rm -f ${D}/${libdir}/rpm/bin/dbconvert | ||
485 | rm -f ${D}/${libdir}/rpm/bin/pom2spec | ||
486 | |||
487 | rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj | ||
488 | rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl | ||
489 | |||
490 | } | ||
491 | |||
492 | add_native_wrapper() { | ||
493 | create_wrapper ${D}/${bindir}/rpm \ | ||
494 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
495 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
496 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
497 | |||
498 | create_wrapper ${D}/${bindir}/rpm2cpio \ | ||
499 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
500 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
501 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
502 | |||
503 | create_wrapper ${D}/${bindir}/rpmbuild \ | ||
504 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
505 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
506 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
507 | |||
508 | create_wrapper ${D}/${bindir}/rpmconstant \ | ||
509 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
510 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
511 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
512 | |||
513 | for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do | ||
514 | create_wrapper $rpm_binary \ | ||
515 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
516 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
517 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
518 | done | ||
519 | } | ||
520 | |||
521 | do_install_append_class-native() { | ||
522 | add_native_wrapper | ||
523 | } | ||
524 | |||
525 | do_install_append_class-nativesdk() { | ||
526 | add_native_wrapper | ||
527 | } | ||
528 | |||
529 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb new file mode 100644 index 0000000000..d99a300285 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb | |||
@@ -0,0 +1,518 @@ | |||
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 byacc-native" | ||
46 | |||
47 | # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed | ||
48 | # in order to extract the distribution SRPM into a format we can extract... | ||
49 | SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;extract=rpm-5.4.14.tar.gz \ | ||
50 | file://rpm-log-auto-rm.patch \ | ||
51 | file://rpm-db-reduce.patch \ | ||
52 | file://perfile_rpmdeps.sh \ | ||
53 | file://rpm-autogen.patch \ | ||
54 | file://rpm-libsql-fix.patch \ | ||
55 | file://header-include-fix.patch \ | ||
56 | file://rpm-platform.patch \ | ||
57 | file://rpm-showrc.patch \ | ||
58 | file://rpm-tools-mtree-LDFLAGS.patch \ | ||
59 | file://rpm-fileclass.patch \ | ||
60 | file://rpm-canonarch.patch \ | ||
61 | file://rpm-no-loopmsg.patch \ | ||
62 | file://rpm-scriptletexechelper.patch \ | ||
63 | file://pythondeps.sh \ | ||
64 | file://rpmdeps-oecore.patch \ | ||
65 | file://rpm-resolvedep.patch \ | ||
66 | file://rpm-no-perl-urpm.patch \ | ||
67 | file://rpm-macros.patch \ | ||
68 | file://rpm-lua.patch \ | ||
69 | file://rpm-ossp-uuid.patch \ | ||
70 | file://rpm-packageorigin.patch \ | ||
71 | file://rpm-pkgconfigdeps.patch \ | ||
72 | file://uclibc-support.patch \ | ||
73 | file://rpmatch.patch \ | ||
74 | file://fstack-protector-configure-check.patch \ | ||
75 | file://dbconvert.patch \ | ||
76 | file://rpm-uuid-include.patch \ | ||
77 | file://makefile-am-exec-hook.patch \ | ||
78 | file://rpm-db_buffer_small.patch \ | ||
79 | file://rpm-py-init.patch \ | ||
80 | file://python-rpm-rpmsense.patch \ | ||
81 | file://rpm-reloc-macros.patch \ | ||
82 | file://rpm-platform2.patch \ | ||
83 | file://rpm-remove-sykcparse-decl.patch \ | ||
84 | file://debugedit-segv.patch \ | ||
85 | file://debugedit-valid-file-to-fix-segment-fault.patch \ | ||
86 | file://rpm-platform-file-fix.patch \ | ||
87 | file://rpm-lsb-compatibility.patch \ | ||
88 | file://rpm-tag-generate-endian-conversion-fix.patch \ | ||
89 | file://verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch \ | ||
90 | file://rpm-hardlink-segfault-fix.patch \ | ||
91 | file://rpm-payload-use-hashed-inode.patch \ | ||
92 | file://rpm-fix-logio-cp.patch \ | ||
93 | file://rpm-db5-or-db6.patch \ | ||
94 | file://rpm-disable-Wno-override-init.patch \ | ||
95 | file://rpmqv_cc_b_gone.patch \ | ||
96 | file://rpm-realpath.patch \ | ||
97 | file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \ | ||
98 | " | ||
99 | |||
100 | # Uncomment the following line to enable platform score debugging | ||
101 | # This is useful when identifying issues with Smart being unable | ||
102 | # to process certain package feeds. | ||
103 | #SRC_URI += "file://rpm-debug-platform.patch" | ||
104 | |||
105 | SRC_URI[md5sum] = "25093d399a0b5d1342d24900a91b347d" | ||
106 | SRC_URI[sha256sum] = "676e3ab41f72e3b504e04109cfb565a300742f56a7da084f202013b30eeae467" | ||
107 | |||
108 | inherit autotools gettext | ||
109 | |||
110 | acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" | ||
111 | |||
112 | # Specify the default rpm macros in terms of adjustable variables | ||
113 | rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros" | ||
114 | rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
115 | rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros" | ||
116 | |||
117 | # sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux | ||
118 | |||
119 | # Note: perl and sqlite w/o db specified does not currently work. | ||
120 | # tcl, augeas, nss, gcrypt, xar and keyutils support is untested. | ||
121 | PACKAGECONFIG ??= "db bzip2 zlib beecrypt openssl libelf python" | ||
122 | |||
123 | PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2," | ||
124 | PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz," | ||
125 | PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib," | ||
126 | PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar," | ||
127 | |||
128 | WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \ | ||
129 | --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \ | ||
130 | --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
131 | --without-pythonembed" | ||
132 | PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python," | ||
133 | |||
134 | # Perl modules are not built, but they could be enabled fairly easily | ||
135 | # the perl module creation and installation would need to be patched. | ||
136 | # (currently has host perl contamination issues) | ||
137 | WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm" | ||
138 | WITHOUT_PERL = "--without-perl --without-perl-urpm" | ||
139 | PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl," | ||
140 | |||
141 | # The --with-dbsql will only tell RPM to check for support, db | ||
142 | # may or may not be built w/ the dbsql support. | ||
143 | WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated" | ||
144 | PACKAGECONFIG[db] = "${WITH_DB},--without-db,db," | ||
145 | |||
146 | PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3," | ||
147 | |||
148 | PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--without-beecrypt,beecrypt," | ||
149 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," | ||
150 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss," | ||
151 | PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt," | ||
152 | PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils," | ||
153 | PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils," | ||
154 | |||
155 | WITH_SELINUX = "--with-selinux --with-sepol --with-semanage" | ||
156 | WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage" | ||
157 | PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux," | ||
158 | |||
159 | WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi" | ||
160 | WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi" | ||
161 | PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat," | ||
162 | |||
163 | PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat," | ||
164 | PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl," | ||
165 | |||
166 | PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas," | ||
167 | |||
168 | EXTRA_OECONF += "--verbose \ | ||
169 | --sysconfdir=${sysconfdir} \ | ||
170 | --with-file \ | ||
171 | --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \ | ||
172 | --with-syck=internal \ | ||
173 | --without-readline \ | ||
174 | --without-libtasn1 \ | ||
175 | --without-pakchois \ | ||
176 | --without-gnutls \ | ||
177 | --with-pcre \ | ||
178 | --enable-utf8 \ | ||
179 | --with-uuid \ | ||
180 | --with-attr \ | ||
181 | --with-acl \ | ||
182 | --with-popt=external \ | ||
183 | --with-pthreads \ | ||
184 | --without-cudf \ | ||
185 | --without-ficl \ | ||
186 | --without-aterm \ | ||
187 | --without-nix \ | ||
188 | --without-bash \ | ||
189 | --without-rc \ | ||
190 | --without-js \ | ||
191 | --without-gpsee \ | ||
192 | --without-ruby \ | ||
193 | --without-squirrel \ | ||
194 | --with-build-extlibdep \ | ||
195 | --with-build-maxextlibdep \ | ||
196 | --without-valgrind \ | ||
197 | --disable-openmp \ | ||
198 | --enable-build-pic \ | ||
199 | --enable-build-versionscript \ | ||
200 | --enable-build-warnings \ | ||
201 | --enable-build-debug \ | ||
202 | --enable-maintainer-mode \ | ||
203 | --with-path-macros=${rpm_macros} \ | ||
204 | --with-path-lib=${libdir}/rpm \ | ||
205 | --with-bugreport=http://bugzilla.yoctoproject.org \ | ||
206 | --program-prefix= \ | ||
207 | YACC=byacc" | ||
208 | |||
209 | CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE" | ||
210 | |||
211 | LDFLAGS_append_libc-uclibc = "-lrt -lpthread" | ||
212 | |||
213 | 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" | ||
214 | |||
215 | SOLIBS = "5.4.so" | ||
216 | |||
217 | # Based on %files section in the rpm.spec | ||
218 | |||
219 | FILES_${PN} = "${bindir}/rpm \ | ||
220 | ${bindir}/rpmconstant \ | ||
221 | ${libdir}/rpm/rpm.* \ | ||
222 | ${libdir}/rpm/tgpg \ | ||
223 | ${libdir}/rpm/macros \ | ||
224 | ${libdir}/rpm/rpmpopt \ | ||
225 | ${libdir}/rpm/rpm2cpio \ | ||
226 | ${libdir}/rpm/vcheck \ | ||
227 | ${libdir}/rpm/helpers \ | ||
228 | ${libdir}/rpm/qf \ | ||
229 | ${libdir}/rpm/cpuinfo.yaml \ | ||
230 | ${libdir}/rpm/bin/mtree \ | ||
231 | ${libdir}/rpm/bin/rpmkey \ | ||
232 | ${libdir}/rpm/bin/rpmrepo \ | ||
233 | ${libdir}/rpm/bin/rpmrepo.real \ | ||
234 | ${libdir}/rpm/bin/rpmspecdump \ | ||
235 | ${libdir}/rpm/bin/rpmspecdump.real \ | ||
236 | ${libdir}/rpm/bin/wget \ | ||
237 | ${localstatedir}/cache \ | ||
238 | ${localstatedir}/cache/rpm \ | ||
239 | ${localstatedir}/cache/wdj \ | ||
240 | ${localstatedir}/lib \ | ||
241 | ${localstatedir}/lib/rpm \ | ||
242 | ${localstatedir}/lib/wdj \ | ||
243 | ${bindir}/rpm.real \ | ||
244 | ${bindir}/rpmconstant.real \ | ||
245 | ${bindir}/rpm2cpio.real \ | ||
246 | " | ||
247 | |||
248 | FILES_${PN}-dbg += "${libdir}/rpm/.debug \ | ||
249 | ${libdir}/rpm/bin/.debug \ | ||
250 | " | ||
251 | |||
252 | FILES_${PN}-common = "${bindir}/rpm2cpio \ | ||
253 | ${bindir}/gendiff \ | ||
254 | ${sysconfdir}/rpm \ | ||
255 | ${localstatedir}/spool/repackage \ | ||
256 | " | ||
257 | |||
258 | FILES_${PN}-libs = "${libdir}/librpm-*.so \ | ||
259 | ${libdir}/librpmconstant-*.so \ | ||
260 | ${libdir}/librpmdb-*.so \ | ||
261 | ${libdir}/librpmio-*.so \ | ||
262 | ${libdir}/librpmmisc-*.so \ | ||
263 | ${libdir}/librpmbuild-*.so \ | ||
264 | " | ||
265 | |||
266 | FILES_${PN}-build = "${prefix}/src/rpm \ | ||
267 | ${bindir}/rpmbuild \ | ||
268 | ${bindir}/rpmbuild.real \ | ||
269 | ${libdir}/rpm/brp-* \ | ||
270 | ${libdir}/rpm/check-files \ | ||
271 | ${libdir}/rpm/cross-build \ | ||
272 | ${libdir}/rpm/find-debuginfo.sh \ | ||
273 | ${libdir}/rpm/find-lang.sh \ | ||
274 | ${libdir}/rpm/find-prov.pl \ | ||
275 | ${libdir}/rpm/find-provides.perl \ | ||
276 | ${libdir}/rpm/find-req.pl \ | ||
277 | ${libdir}/rpm/find-requires.perl \ | ||
278 | ${libdir}/rpm/getpo.sh \ | ||
279 | ${libdir}/rpm/http.req \ | ||
280 | ${libdir}/rpm/javadeps.sh \ | ||
281 | ${libdir}/rpm/mono-find-provides \ | ||
282 | ${libdir}/rpm/mono-find-requires \ | ||
283 | ${libdir}/rpm/executabledeps.sh \ | ||
284 | ${libdir}/rpm/libtooldeps.sh \ | ||
285 | ${libdir}/rpm/osgideps.pl \ | ||
286 | ${libdir}/rpm/perldeps.pl \ | ||
287 | ${libdir}/rpm/perl.prov \ | ||
288 | ${libdir}/rpm/perl.req \ | ||
289 | ${libdir}/rpm/php.prov \ | ||
290 | ${libdir}/rpm/php.req \ | ||
291 | ${libdir}/rpm/pkgconfigdeps.sh \ | ||
292 | ${libdir}/rpm/pythondeps.sh \ | ||
293 | ${libdir}/rpm/bin/debugedit \ | ||
294 | ${libdir}/rpm/bin/debugedit.real \ | ||
295 | ${libdir}/rpm/bin/rpmcache \ | ||
296 | ${libdir}/rpm/bin/rpmcache.real \ | ||
297 | ${libdir}/rpm/bin/rpmcmp \ | ||
298 | ${libdir}/rpm/bin/rpmcmp.real \ | ||
299 | ${libdir}/rpm/bin/rpmdeps \ | ||
300 | ${libdir}/rpm/bin/rpmdeps.real \ | ||
301 | ${libdir}/rpm/bin/rpmdeps-oecore \ | ||
302 | ${libdir}/rpm/bin/rpmdeps-oecore.real \ | ||
303 | ${libdir}/rpm/bin/rpmdigest \ | ||
304 | ${libdir}/rpm/bin/rpmdigest.real \ | ||
305 | ${libdir}/rpm/bin/abi-compliance-checker.pl \ | ||
306 | ${libdir}/rpm/bin/api-sanity-autotest.pl \ | ||
307 | ${libdir}/rpm/bin/chroot \ | ||
308 | ${libdir}/rpm/bin/cp \ | ||
309 | ${libdir}/rpm/bin/dbsql \ | ||
310 | ${libdir}/rpm/bin/find \ | ||
311 | ${libdir}/rpm/bin/install-sh \ | ||
312 | ${libdir}/rpm/bin/lua \ | ||
313 | ${libdir}/rpm/bin/luac \ | ||
314 | ${libdir}/rpm/bin/mkinstalldirs \ | ||
315 | ${libdir}/rpm/bin/rpmlua \ | ||
316 | ${libdir}/rpm/bin/rpmluac \ | ||
317 | ${libdir}/rpm/bin/sqlite3 \ | ||
318 | ${libdir}/rpm/macros.d/cmake \ | ||
319 | ${libdir}/rpm/macros.d/java \ | ||
320 | ${libdir}/rpm/macros.d/libtool \ | ||
321 | ${libdir}/rpm/macros.d/mandriva \ | ||
322 | ${libdir}/rpm/macros.d/mono \ | ||
323 | ${libdir}/rpm/macros.d/perl \ | ||
324 | ${libdir}/rpm/macros.d/php \ | ||
325 | ${libdir}/rpm/macros.d/pkgconfig \ | ||
326 | ${libdir}/rpm/macros.d/python \ | ||
327 | ${libdir}/rpm/macros.d/ruby \ | ||
328 | ${libdir}/rpm/macros.d/selinux \ | ||
329 | ${libdir}/rpm/macros.d/tcl \ | ||
330 | ${libdir}/rpm/macros.rpmbuild \ | ||
331 | ${libdir}/rpm/u_pkg.sh \ | ||
332 | ${libdir}/rpm/vpkg-provides.sh \ | ||
333 | ${libdir}/rpm/vpkg-provides2.sh \ | ||
334 | ${libdir}/rpm/perfile_rpmdeps.sh \ | ||
335 | " | ||
336 | RDEPENDS_${PN} = "base-files run-postinsts" | ||
337 | RDEPENDS_${PN}_class-native = "" | ||
338 | RDEPENDS_${PN}_class-nativesdk = "" | ||
339 | RDEPENDS_${PN}-build = "file bash perl" | ||
340 | |||
341 | RDEPENDS_python-rpm = "${PN}" | ||
342 | |||
343 | FILES_python-rpm-dbg = "${libdir}/python*/site-packages/rpm/.debug/_*" | ||
344 | FILES_python-rpm-dev = "${libdir}/python*/site-packages/rpm/*.la" | ||
345 | FILES_python-rpm-staticdev = "${libdir}/python*/site-packages/rpm/*.a" | ||
346 | FILES_python-rpm = "${libdir}/python*/site-packages/rpm" | ||
347 | PROVIDES += "python-rpm" | ||
348 | |||
349 | FILES_perl-module-rpm = "${libdir}/perl/*/* \ | ||
350 | " | ||
351 | |||
352 | FILES_perl-module-rpm-dev = "${prefix}/share/man/man3/RPM* \ | ||
353 | " | ||
354 | |||
355 | RDEPENDS_${PN}-dev += "bash" | ||
356 | |||
357 | FILES_${PN}-dev = "${includedir}/rpm \ | ||
358 | ${libdir}/librpm.la \ | ||
359 | ${libdir}/librpm.so \ | ||
360 | ${libdir}/librpmconstant.la \ | ||
361 | ${libdir}/librpmconstant.so \ | ||
362 | ${libdir}/librpmdb.la \ | ||
363 | ${libdir}/librpmdb.so \ | ||
364 | ${libdir}/librpmio.la \ | ||
365 | ${libdir}/librpmio.so \ | ||
366 | ${libdir}/librpmmisc.la \ | ||
367 | ${libdir}/librpmmisc.so \ | ||
368 | ${libdir}/librpmbuild.la \ | ||
369 | ${libdir}/librpmbuild.so \ | ||
370 | ${libdir}/rpm/lib/liblua.la \ | ||
371 | ${libdir}/pkgconfig/rpm.pc \ | ||
372 | ${libdir}/rpm/rpmdb_loadcvt \ | ||
373 | " | ||
374 | |||
375 | FILES_${PN}-staticdev = " \ | ||
376 | ${libdir}/librpm.a \ | ||
377 | ${libdir}/librpmconstant.a \ | ||
378 | ${libdir}/librpmdb.a \ | ||
379 | ${libdir}/librpmio.a \ | ||
380 | ${libdir}/librpmmisc.a \ | ||
381 | ${libdir}/librpmbuild.a \ | ||
382 | ${libdir}/rpm/lib/liblua.a \ | ||
383 | " | ||
384 | |||
385 | do_configure() { | ||
386 | # Disable tests! | ||
387 | echo "all:" > ${S}/tests/Makefile.am | ||
388 | sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in | ||
389 | |||
390 | ( cd ${S}; ${S}/autogen.sh ) | ||
391 | |||
392 | # NASTY hack to make sure configure files the right pkg-config file... | ||
393 | sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \ | ||
394 | -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure | ||
395 | |||
396 | ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || : | ||
397 | |||
398 | export varprefix=${localstatedir} | ||
399 | oe_runconf | ||
400 | } | ||
401 | |||
402 | do_install_append() { | ||
403 | sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros | ||
404 | sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros | ||
405 | sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
406 | sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | ||
407 | sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros | ||
408 | sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros | ||
409 | |||
410 | # Enable Debian style arbitrary tags... | ||
411 | sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros | ||
412 | |||
413 | install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh | ||
414 | install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh | ||
415 | |||
416 | # Remove unpackaged files (based on list in rpm.spec) | ||
417 | rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm} | ||
418 | |||
419 | rm -f ${D}/${mandir}/man8/rpmcache.8* | ||
420 | rm -f ${D}/${mandir}/man8/rpmgraph.8* | ||
421 | rm -f ${D}/${mandir}/*/man8/rpmcache.8* | ||
422 | rm -f ${D}/${mandir}/*/man8/rpmgraph.8* | ||
423 | rm -rf ${D}/${mandir}/{fr,ko} | ||
424 | |||
425 | rm -f ${D}/${includedir}/popt.h | ||
426 | rm -f ${D}/${libdir}/libpopt.* | ||
427 | rm -f ${D}/${libdir}/pkgconfig/popt.pc | ||
428 | rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo | ||
429 | rm -f ${D}/${mandir}/man3/popt.3 | ||
430 | |||
431 | rm -f ${D}/${mandir}/man1/xar.1* | ||
432 | rm -f ${D}/${bindir}/xar | ||
433 | rm -rf ${D}/${includedir}/xar | ||
434 | rm -f ${D}/${libdir}/libxar* | ||
435 | |||
436 | rm -f ${D}/${bindir}/lz* | ||
437 | rm -f ${D}/${bindir}/unlzma | ||
438 | rm -f ${D}/${bindir}/unxz | ||
439 | rm -f ${D}/${bindir}/xz* | ||
440 | rm -rf ${D}/${includedir}/lzma* | ||
441 | rm -f ${D}/${mandir}/man1/lz*.1 | ||
442 | rm -f ${D}/${libdir}/pkgconfig/liblzma* | ||
443 | |||
444 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la} | ||
445 | rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la} | ||
446 | |||
447 | #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \ | ||
448 | # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';' | ||
449 | #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';' | ||
450 | |||
451 | # We don't want the default macro set | ||
452 | rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*} | ||
453 | |||
454 | rm -f ${D}/${libdir}/rpm/dbconvert.sh | ||
455 | |||
456 | rm -f ${D}/${libdir}/rpm/libsqldb.* | ||
457 | |||
458 | # We don't want, nor need the Mandriva multiarch items | ||
459 | rm -f ${D}/${bindir}/multiarch-dispatch | ||
460 | rm -f ${D}/${bindir}/multiarch-platform | ||
461 | rm -f ${D}/${libdir}/rpm/check-multiarch-files | ||
462 | rm -f ${D}/${libdir}/rpm/mkmultiarch | ||
463 | rm -f ${D}/${includedir}/multiarch-dispatch.h | ||
464 | |||
465 | rm -f ${D}/${libdir}/rpm/gstreamer.sh | ||
466 | rm -f ${D}/${libdir}/rpm/gem_helper.rb | ||
467 | rm -f ${D}/${libdir}/rpm/rubygems.rb | ||
468 | rm -f ${D}/${libdir}/rpm/kmod-deps.sh | ||
469 | rm -f ${D}/${libdir}/rpm/pythoneggs.py | ||
470 | rm -f ${D}/${libdir}/rpm/macros.d/kernel | ||
471 | rm -f ${D}/${libdir}/rpm/macros.d/gstreamer | ||
472 | rm -f ${D}/${libdir}/rpm/bin/mgo | ||
473 | rm -f ${D}/${libdir}/rpm/bin/dbconvert | ||
474 | rm -f ${D}/${libdir}/rpm/bin/pom2spec | ||
475 | |||
476 | rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj | ||
477 | rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl | ||
478 | |||
479 | } | ||
480 | |||
481 | add_native_wrapper() { | ||
482 | create_wrapper ${D}/${bindir}/rpm \ | ||
483 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
484 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
485 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
486 | |||
487 | create_wrapper ${D}/${bindir}/rpm2cpio \ | ||
488 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
489 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
490 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
491 | |||
492 | create_wrapper ${D}/${bindir}/rpmbuild \ | ||
493 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
494 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
495 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
496 | |||
497 | create_wrapper ${D}/${bindir}/rpmconstant \ | ||
498 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
499 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
500 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
501 | |||
502 | for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do | ||
503 | create_wrapper $rpm_binary \ | ||
504 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
505 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
506 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
507 | done | ||
508 | } | ||
509 | |||
510 | do_install_append_class-native() { | ||
511 | add_native_wrapper | ||
512 | } | ||
513 | |||
514 | do_install_append_class-nativesdk() { | ||
515 | add_native_wrapper | ||
516 | } | ||
517 | |||
518 | 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..7f4caf9886 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c | |||
@@ -0,0 +1,424 @@ | |||
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 | if (rc = (headerGet(h, he, 0) != 1)) { | ||
279 | if (debugmode) { | ||
280 | printf("DEBUG: %s requires null\n", name); | ||
281 | } | ||
282 | rc = 0; | ||
283 | continue; | ||
284 | } | ||
285 | ARGV_t reqs = (ARGV_t)he->p.ptr; | ||
286 | /* Get its requireflags */ | ||
287 | he->tag = RPMTAG_REQUIREFLAGS; | ||
288 | rc = (headerGet(h, he, 0) != 1); | ||
289 | rpmuint32_t *reqflags = (rpmuint32_t *)he->p.ui32p; | ||
290 | for(j=0; j<he->c; j++) { | ||
291 | int k; | ||
292 | char *prov = NULL; | ||
293 | for(k=0; k<nnames; k++) { | ||
294 | if(strcmp(names[k], reqs[j]) == 0) { | ||
295 | prov = names[k]; | ||
296 | break; | ||
297 | } | ||
298 | } | ||
299 | if(prov) { | ||
300 | if((int)reqflags[j] & 0x80000) | ||
301 | fprintf(outf, "%s|%s [REC]\n", name, prov); | ||
302 | else | ||
303 | fprintf(outf, "%s|%s\n", name, prov); | ||
304 | } | ||
305 | else { | ||
306 | rc = lookupProvider(ts[0], reqs[j], &prov); | ||
307 | if(rc==0 && prov) { | ||
308 | if((int)reqflags[j] & 0x80000) | ||
309 | fprintf(outf, "%s|%s [REC]\n", name, prov); | ||
310 | else | ||
311 | fprintf(outf, "%s|%s\n", name, prov); | ||
312 | free(prov); | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | free(name); | ||
317 | } | ||
318 | (void)rpmmiFree(mi); | ||
319 | } | ||
320 | } | ||
321 | |||
322 | return rc; | ||
323 | } | ||
324 | |||
325 | void usage() | ||
326 | { | ||
327 | fprintf(stderr, "OpenEmbedded rpm resolver utility\n"); | ||
328 | fprintf(stderr, "syntax: rpmresolve [-i] [-d] [-t] <dblistfile> <packagelistfile>\n"); | ||
329 | } | ||
330 | |||
331 | int main(int argc, char **argv) | ||
332 | { | ||
333 | rpmts *ts = NULL; | ||
334 | int tscount = 0; | ||
335 | int rc = 0; | ||
336 | int i; | ||
337 | int c; | ||
338 | int ignoremissing = 0; | ||
339 | int deplistmode = 0; | ||
340 | char *outfile = NULL; | ||
341 | |||
342 | debugmode = 0; | ||
343 | outf = stdout; | ||
344 | |||
345 | opterr = 0; | ||
346 | while ((c = getopt (argc, argv, "itdo:")) != -1) { | ||
347 | switch (c) { | ||
348 | case 'i': | ||
349 | ignoremissing = 1; | ||
350 | break; | ||
351 | case 't': | ||
352 | deplistmode = 1; | ||
353 | break; | ||
354 | case 'd': | ||
355 | debugmode = 1; | ||
356 | break; | ||
357 | case 'o': | ||
358 | outfile = strdup(optarg); | ||
359 | break; | ||
360 | case '?': | ||
361 | if(isprint(optopt)) | ||
362 | fprintf(stderr, "Unknown option `-%c'.\n", optopt); | ||
363 | else | ||
364 | fprintf(stderr, "Unknown option character `\\x%x'.\n", | ||
365 | optopt); | ||
366 | usage(); | ||
367 | return 1; | ||
368 | default: | ||
369 | abort(); | ||
370 | } | ||
371 | } | ||
372 | |||
373 | if( argc - optind < 1 ) { | ||
374 | usage(); | ||
375 | return 1; | ||
376 | } | ||
377 | |||
378 | if( outfile ) { | ||
379 | if(debugmode) | ||
380 | printf("DEBUG: Using output file %s\n", outfile); | ||
381 | outf = fopen(outfile, "w"); | ||
382 | } | ||
383 | |||
384 | const char *dblistfn = argv[optind]; | ||
385 | |||
386 | rpmcliInit(argc, argv, NULL); | ||
387 | |||
388 | if(debugmode) | ||
389 | rpmSetVerbosity(RPMLOG_DEBUG); | ||
390 | |||
391 | rpmDefineMacro(NULL, "__dbi_txn create nofsync", RMIL_CMDLINE); | ||
392 | |||
393 | rc = loadTs(&ts, &tscount, dblistfn); | ||
394 | if( rc ) | ||
395 | return 1; | ||
396 | if( tscount == 0 ) { | ||
397 | fprintf(stderr, "Please specify database list file or database location\n"); | ||
398 | return 1; | ||
399 | } | ||
400 | |||
401 | if(deplistmode) { | ||
402 | rc = printDepList(ts, tscount); | ||
403 | } | ||
404 | else { | ||
405 | if( argc - optind < 2 ) { | ||
406 | fprintf(stderr, "Please specify package list file\n"); | ||
407 | } | ||
408 | else { | ||
409 | const char *pkglistfn = argv[optind+1]; | ||
410 | rc = processPackages(ts, tscount, pkglistfn, ignoremissing); | ||
411 | } | ||
412 | } | ||
413 | |||
414 | for(i=0; i<tscount; i++) | ||
415 | (void) rpmtsCloseDB(ts[i]); | ||
416 | free(ts); | ||
417 | |||
418 | if( outfile ) { | ||
419 | fclose(outf); | ||
420 | free(outfile); | ||
421 | } | ||
422 | |||
423 | return rc; | ||
424 | } | ||
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" | ||