summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2016-12-30 18:38:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-14 14:42:16 +0000
commit27d56eeebd8197e359aae0a7ccac74cb55ff794d (patch)
treeb3cade20da193ee39424a6e410ddfcdd62bc38c8 /meta/recipes-devtools/rpm
parent381c8e634c22321f9c27fae5b6f35e4204840719 (diff)
downloadpoky-27d56eeebd8197e359aae0a7ccac74cb55ff794d.tar.gz
rpm: add a 4.x recipe
The dnf stack is written and tested against rpm 4.x. So if we want to use dnf for packaging, we should also use rpm 4 - there's simply too much work involved in making rpm 5 work with it due to significant API differences, and supporting that going forward. (From OE-Core rev: 2358e786ec8d1199d90e181eb5d8d00816f669b4) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch40
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch33
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch61
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch38
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch30
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch74
-rw-r--r--meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch37
-rw-r--r--meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch31
-rw-r--r--meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch72
-rw-r--r--meta/recipes-devtools/rpm/rpm_git.bb108
10 files changed, 524 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
new file mode 100644
index 0000000000..ac6dcaf101
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
@@ -0,0 +1,40 @@
1From e3eff024826550aec4a6a5baef7210a29faf299d Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 9 Mar 2017 18:54:02 +0200
4Subject: [PATCH] Add a color setting for mips64_n32 binaries
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 build/rpmfc.c | 1 +
10 rpmrc.in | 2 ++
11 2 files changed, 3 insertions(+)
12
13diff --git a/build/rpmfc.c b/build/rpmfc.c
14index d38a10916..c8e2f876a 100644
15--- a/build/rpmfc.c
16+++ b/build/rpmfc.c
17@@ -622,6 +622,7 @@ exit:
18 static const struct rpmfcTokens_s rpmfcTokens[] = {
19 { "directory", RPMFC_INCLUDE },
20
21+ { "N32 MIPS64", RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
22 { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
23 { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
24
25diff --git a/rpmrc.in b/rpmrc.in
26index abc08fc31..f5bc820d8 100644
27--- a/rpmrc.in
28+++ b/rpmrc.in
29@@ -133,6 +133,8 @@ archcolor: mipsr6el 1
30 archcolor: mips64r6 2
31 archcolor: mips64r6el 2
32
33+archcolor: mips64_n32 4
34+
35 archcolor: m68k 1
36
37 archcolor: m68kmint 1
38--
392.11.0
40
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
new file mode 100644
index 0000000000..80e2f0fad7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
@@ -0,0 +1,33 @@
1From 87cfc0db1ed6fe381a5ed5f0016d8c3344a31a11 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 9 Jan 2017 18:52:11 +0200
4Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in
5 a short-circuited way.
6
7Upstream permits short-circuiting only for local testing; Yocto on the other
8hand produces rpms that way by design.
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 build/pack.c | 4 ----
14 1 file changed, 4 deletions(-)
15
16diff --git a/build/pack.c b/build/pack.c
17index 1261cdbba..bb2d6f4f6 100644
18--- a/build/pack.c
19+++ b/build/pack.c
20@@ -595,10 +595,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
21 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
22 }
23
24- if (cheating) {
25- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
26- }
27-
28 { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
29 char *binRpm, *binDir;
30 binRpm = headerFormat(pkg->header, binFormat, &errorString);
31--
322.11.0
33
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
new file mode 100644
index 0000000000..d99ddeb9ea
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
@@ -0,0 +1,61 @@
1From d82691b8d58201dd03e30585daacd8ffd1556ae2 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 27 Feb 2017 09:43:30 +0200
4Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for
5 default configuration and macros.
6
7Upstream-Status: Inappropriate [oe-core specific]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9
10---
11 configure.ac | 2 +-
12 macros.in | 2 +-
13 rpm.am | 4 ++--
14 3 files changed, 4 insertions(+), 4 deletions(-)
15
16diff --git a/configure.ac b/configure.ac
17index 4f3be8770..92ffd3d68 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -875,7 +875,7 @@ else
21 usrprefix=$prefix
22 fi
23
24-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
25+RPMCONFIGDIR="`echo ${libdir}/rpm`"
26 AC_SUBST(RPMCONFIGDIR)
27
28 AC_SUBST(OBJDUMP)
29diff --git a/macros.in b/macros.in
30index c6d5a6b03..84ae25275 100644
31--- a/macros.in
32+++ b/macros.in
33@@ -877,7 +877,7 @@ package or when debugging this package.\
34 %_sharedstatedir %{_prefix}/com
35 %_localstatedir %{_prefix}/var
36 %_lib lib
37-%_libdir %{_exec_prefix}/%{_lib}
38+%_libdir @libdir@
39 %_includedir %{_prefix}/include
40 %_infodir %{_datadir}/info
41 %_mandir %{_datadir}/man
42diff --git a/rpm.am b/rpm.am
43index 1f43ad8a0..6854ff6ba 100644
44--- a/rpm.am
45+++ b/rpm.am
46@@ -1,10 +1,10 @@
47 # Internal binaries
48 ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm
49-rpmlibexecdir = $(prefix)/lib/rpm
50+rpmlibexecdir = $(libdir)/rpm
51
52 # Host independent config files
53 ## HACK: it probably should be $(datadir)/rpm
54-rpmconfigdir = $(prefix)/lib/rpm
55+rpmconfigdir = $(libdir)/rpm
56
57 # Libtool version (current-revision-age) for all our libraries
58 rpm_version_info = 7:0:0
59--
602.11.0
61
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
new file mode 100644
index 0000000000..96eb418952
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
@@ -0,0 +1,38 @@
1From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 10 Jan 2017 14:11:30 +0200
4Subject: [PATCH] Do not read config files from $HOME
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 lib/rpmrc.c | 6 ++----
10 1 file changed, 2 insertions(+), 4 deletions(-)
11
12diff --git a/lib/rpmrc.c b/lib/rpmrc.c
13index 4ed991321..19fe80f98 100644
14--- a/lib/rpmrc.c
15+++ b/lib/rpmrc.c
16@@ -458,8 +458,7 @@ static void setDefaults(void)
17 if (!defrcfiles) {
18 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
19 confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
20- SYSCONFDIR "/rpmrc", ":",
21- "~/.rpmrc", NULL);
22+ SYSCONFDIR "/rpmrc", ":");
23 }
24
25 #ifndef MACROFILES
26@@ -471,8 +470,7 @@ static void setDefaults(void)
27 confdir, "/" RPMCANONVENDOR "/macros", ":",
28 SYSCONFDIR "/rpm/macros.*", ":",
29 SYSCONFDIR "/rpm/macros", ":",
30- SYSCONFDIR "/rpm/%{_target}/macros", ":",
31- "~/.rpmmacros", NULL);
32+ SYSCONFDIR "/rpm/%{_target}/macros", ":");
33 }
34 #else
35 macrofiles = MACROFILES;
36--
372.11.0
38
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
new file mode 100644
index 0000000000..a38675f89c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
@@ -0,0 +1,30 @@
1From ffb5301a8594140ad7a58bc0f2053be8ca2b2946 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 20 Jan 2017 13:32:06 +0200
4Subject: [PATCH 1/2] Do not reset the PATH environment variable before running
5 scriptlets.
6
7We add lots of native stuff into it and scriptlets rely on that.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 lib/rpmscript.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/lib/rpmscript.c b/lib/rpmscript.c
16index 92f949fa2..7c1aa75a8 100644
17--- a/lib/rpmscript.c
18+++ b/lib/rpmscript.c
19@@ -201,7 +201,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
20 if (ipath && ipath[5] != '%')
21 path = ipath;
22
23- xx = setenv("PATH", path, 1);
24+ //xx = setenv("PATH", path, 1);
25 free(ipath);
26 }
27
28--
292.11.0
30
diff --git a/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch b/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
new file mode 100644
index 0000000000..95c70136bd
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
@@ -0,0 +1,74 @@
1From 211c2d11200e6657132c52e7ac68f8c118231262 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 27 Feb 2017 14:43:21 +0200
4Subject: [PATCH] Fix build with musl C library.
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 configure.ac | 3 ++-
13 misc/Makefile.am | 3 +--
14 misc/rpmxprogname.c | 3 +--
15 3 files changed, 4 insertions(+), 5 deletions(-)
16
17diff --git a/configure.ac b/configure.ac
18index 92ffd3d68..9c58467c1 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -229,6 +229,7 @@ AC_SEARCH_LIBS(dlopen, [dl])
22 # Check for libelf library. Prefer external, otherwise none.
23 WITH_LIBELF_LIB=
24 AC_CHECK_HEADER([libelf.h])
25+AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes])
26 AC_CHECK_HEADERS([gelf.h], [
27 AC_CHECK_LIB(elf, gelf_getvernaux, [
28 AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
29@@ -237,7 +238,7 @@ AC_CHECK_HEADERS([gelf.h], [
30 ])
31 ])
32 AC_SUBST(WITH_LIBELF_LIB)
33-AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
34+AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes])
35
36 AC_CHECK_HEADERS([dwarf.h], [
37 WITH_LIBDWARF=yes
38diff --git a/misc/Makefile.am b/misc/Makefile.am
39index 8bf0093d9..b9db3d31a 100644
40--- a/misc/Makefile.am
41+++ b/misc/Makefile.am
42@@ -5,10 +5,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/misc
43
44 EXTRA_DIST = \
45 fnmatch.c fnmatch.h \
46- rpmxprogname.c rpmxprogname.h \
47 stpcpy.c stpncpy.c
48
49 noinst_LTLIBRARIES = libmisc.la
50
51-libmisc_la_SOURCES = fts.c fts.h
52+libmisc_la_SOURCES = fts.c fts.h rpmxprogname.c rpmxprogname.h
53 libmisc_la_LIBADD = @LTLIBOBJS@
54diff --git a/misc/rpmxprogname.c b/misc/rpmxprogname.c
55index f89600613..e94625ea8 100644
56--- a/misc/rpmxprogname.c
57+++ b/misc/rpmxprogname.c
58@@ -13,7 +13,7 @@ char *_rpmxgetprogname(void)
59 {
60 const char *empty = "";
61
62- if (_rpmxprognam != NULL) /* never return NULL string */
63+ if (_rpmxprogname != NULL) /* never return NULL string */
64 return _rpmxprogname;
65 else
66 return empty;
67@@ -30,4 +30,3 @@ void _rpmxsetprogname(const char *pn)
68 }
69 }
70
71-#endif /* _RPMXPROGNAME_H */
72--
732.11.0
74
diff --git a/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
new file mode 100644
index 0000000000..2be3cb5af3
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
@@ -0,0 +1,37 @@
1From a6f269f879221f2777169c5f7291322afe6b661b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 17 Jan 2017 14:07:17 +0200
4Subject: [PATCH] When cross-installing, execute package scriptlets without
5 chrooting into destination rootfs
6
7This is triggered only when RPM_NO_CHROOT_FOR_SCRIPTS environment variable is defined.
8Otherwise they will trigger an explosion of failures, obviously.
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 lib/rpmscript.c | 8 +++++++-
14 1 file changed, 7 insertions(+), 1 deletion(-)
15
16diff --git a/lib/rpmscript.c b/lib/rpmscript.c
17index 98d3f420d..b95b5d606 100644
18--- a/lib/rpmscript.c
19+++ b/lib/rpmscript.c
20@@ -467,7 +467,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
21
22 if (rc != RPMRC_FAIL) {
23 if (script_type & RPMSCRIPTLET_EXEC) {
24- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
25+ if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) {
26+ rpmChrootOut();
27+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
28+ rpmChrootIn();
29+ } else {
30+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
31+ }
32 } else {
33 rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
34 }
35--
362.11.0
37
diff --git a/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch b/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch
new file mode 100644
index 0000000000..9648cac7c9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch
@@ -0,0 +1,31 @@
1From d42ece6fa15b98d7f9221b90b85b78631df2c0a0 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 14 Feb 2017 13:51:19 +0200
4Subject: [PATCH] When nice value cannot be reset, issue a notice instead of a
5 warning
6
7Otherwise build logs on the autobuilder get very clutter, as it
8doesn't allow the nice value to be reset for some reason.
9
10Upstream-Status: Inappropriate [oe specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 lib/rpmscript.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/lib/rpmscript.c b/lib/rpmscript.c
17index 5e1e99906..3975aead8 100644
18--- a/lib/rpmscript.c
19+++ b/lib/rpmscript.c
20@@ -347,7 +347,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
21 int ret;
22 ret = setpriority(PRIO_PROCESS, 0, 0);
23 if (ret == -1) {
24- rpmlog(RPMLOG_WARNING, _("Unable to reset nice value: %s"),
25+ rpmlog(RPMLOG_NOTICE, _("Unable to reset nice value: %s\n"),
26 strerror(errno));
27 }
28
29--
302.11.0
31
diff --git a/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
new file mode 100644
index 0000000000..b3dbc319b6
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
@@ -0,0 +1,72 @@
1From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 20 Jan 2017 13:33:05 +0200
4Subject: [PATCH 2/2] Add support for prefixing /etc from RPM_ETCCONFIGDIR
5 environment variable
6
7This is needed so that rpm can pick up target-specific configuration
8from target rootfs instead of its own native sysroot.
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 lib/rpmrc.c | 19 ++++++++++++++-----
14 1 file changed, 14 insertions(+), 5 deletions(-)
15
16diff --git a/lib/rpmrc.c b/lib/rpmrc.c
17index 19fe80f98..6b27b3941 100644
18--- a/lib/rpmrc.c
19+++ b/lib/rpmrc.c
20@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const char * name,
21 static void setDefaults(void)
22 {
23 const char *confdir = rpmConfigDir();
24+ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
25+ if (etcconfdir == NULL)
26+ etcconfdir = "";
27+
28 if (!defrcfiles) {
29 defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
30 confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
31- SYSCONFDIR "/rpmrc", ":");
32+ etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL);
33 }
34
35 #ifndef MACROFILES
36@@ -468,9 +472,9 @@ static void setDefaults(void)
37 confdir, "/platform/%{_target}/macros", ":",
38 confdir, "/fileattrs/*.attr", ":",
39 confdir, "/" RPMCANONVENDOR "/macros", ":",
40- SYSCONFDIR "/rpm/macros.*", ":",
41- SYSCONFDIR "/rpm/macros", ":",
42- SYSCONFDIR "/rpm/%{_target}/macros", ":");
43+ etcconfdir, SYSCONFDIR "/rpm/macros.*", ":",
44+ etcconfdir, SYSCONFDIR "/rpm/macros", ":",
45+ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL);
46 }
47 #else
48 macrofiles = MACROFILES;
49@@ -989,7 +993,11 @@ static void read_auxv(void)
50 */
51 static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
52 {
53- const char * const platform_path = SYSCONFDIR "/rpm/platform";
54+ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
55+ if (etcconfdir == NULL)
56+ etcconfdir = "";
57+
58+ const char * const platform_path = rstrscat(NULL, etcconfdir, SYSCONFDIR "/rpm/platform", NULL);
59 static struct utsname un;
60 char * chptr;
61 canonEntry canon;
62@@ -1286,6 +1294,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
63
64 if (arch) *arch = un.machine;
65 if (os) *os = un.sysname;
66+ free(platform_path);
67 }
68
69 static
70--
712.11.0
72
diff --git a/meta/recipes-devtools/rpm/rpm_git.bb b/meta/recipes-devtools/rpm/rpm_git.bb
new file mode 100644
index 0000000000..22a4e71a80
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_git.bb
@@ -0,0 +1,108 @@
1SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
10development files will simplify the process of writing programs that \
11manipulate RPM packages and databases. These files are intended to \
12simplify the process of creating graphical package managers or any \
13other tools that need an intimate knowledge of RPM packages in order \
14to function."
15
16SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
18written in the Python programming language to use the interface \
19supplied by the RPM Package Manager libraries."
20
21HOMEPAGE = "http://www.rpm.org"
22
23# libraries are also LGPL - how to express this?
24LICENSE = "GPL-2.0"
25LIC_FILES_CHKSUM = "file://COPYING;md5=f5259151d26ff18e78023450a5ac8d96"
26
27SRC_URI = "git://github.com/rpm-software-management/rpm \
28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
29 file://0001-Do-not-read-config-files-from-HOME.patch \
30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
31 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
32 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
33 file://0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch \
34 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
35 file://0001-Fix-build-with-musl-C-library.patch \
36 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
37 "
38
39PV = "4.13.90+git${SRCPV}"
40PE = "1"
41SRCREV = "a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be"
42
43S = "${WORKDIR}/git"
44
45DEPENDS = "nss libarchive db file popt xz dbus elfutils python"
46DEPENDS_append_class-native = " file-replacement-native"
47
48inherit autotools gettext pkgconfig pythonnative
49
50# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
51EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
52
53EXTRA_OECONF_append = " --without-lua --enable-python"
54EXTRA_OECONF_append_libc-musl = " --disable-nls"
55
56# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
57#
58# --localstatedir prevents rpm from writing its database to native sysroot when building images
59#
60# Also disable plugins, so that rpm doesn't attempt to inhibit shutdown via session dbus
61EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
62
63BBCLASSEXTEND = "native"
64
65# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
66# libmagic also has sysroot path contamination, so override it
67do_install_append_class-native() {
68 create_wrapper ${D}/${bindir}/rpmbuild \
69 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
70 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
71 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
72 RPM_NO_CHROOT_FOR_SCRIPTS=1
73
74 create_wrapper ${D}/${bindir}/rpmsign \
75 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
76 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
77 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
78 RPM_NO_CHROOT_FOR_SCRIPTS=1
79
80 create_wrapper ${D}/${bindir}/rpmkeys \
81 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
82 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
83 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
84 RPM_NO_CHROOT_FOR_SCRIPTS=1
85
86 create_wrapper ${D}/${bindir}/rpm \
87 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
88 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
89 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
90 RPM_NO_CHROOT_FOR_SCRIPTS=1
91}
92
93
94# Rpm's make install creates var/tmp which clashes with base-files packaging
95do_install_append_class-target() {
96 rm -rf ${D}/var
97}
98
99FILES_${PN} += "${libdir}/rpm-plugins/*.so \
100 "
101
102FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
103 "
104
105PACKAGES += "python-rpm"
106PROVIDES += "python-rpm"
107FILES_python-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
108