Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#135 closed defect (fixed)

Use platform/<name>/macros

Reported by: dmik Owned by:
Priority: major Milestone:
Component: rpm Version:
Severity: low Keywords:


It turns out that our current build of rpm doesn't use the /usr/lib/rpm/platform/<name>/macros files (but installs them). It isit is intended that one of them (matching the requested platform) is loaded after processing the main /usr/lib/rpm/macros file to override platform-specific definitions.

Instead of using these files, some platform-specific values as I see are put right into /usr/lib/rpm/rpmrc (like the ones dealing with per-platform optimization options).

We should either make these files work or completely drop them from the distribution.

Change History (8)

comment:1 Changed 5 years ago by dmik

My opinion is that we should use these files rather than drop them as it looks much more clean.

comment:2 Changed 5 years ago by Yuri Dario

Severity: low

The problem is the macro expansion. {target} is defined as 'pentium4-os/2' so macrofiles expansion in rpmrc.c became:


The files are installed to dir like D:\usr\lib\rpm\platform\pentium4-os2-emx, so there isn't a possible match.

While 'os/2' can be changed to 'os2', I need to figure how 'emx' is getting in the installed path.

comment:3 Changed 5 years ago by Yuri Dario

I fixed the OS/2 vs os2-emx thing, but this breaks the whole installation system. Existing packages are for 'OS/2' operating system, new ones for 'os2-emx', thus rpm/yum refuses to upgrade. It seems we need to rebuild everything or find some hacking...

comment:4 Changed 5 years ago by Yuri Dario

The following patch fixes system name (as done in other *nix distros):

Index: lib/rpmrc.c
--- lib/rpmrc.c (revision 558)
+++ lib/rpmrc.c (working copy)
@@ -975,6 +979,13 @@

strcpy(un.machine, power_pc() ? "ppc" : "rs6000");
sprintf(un.sysname,"aix%s.%s", un.version, un.release);


+ @FIXME FIXME TODO YD this breaks upgrades...
hardcoded in macrofiles listing (ticket#135)
+#if 0
+ else if(rstreq(un.sysname, "OS/2")) {
+ strcpy(un.sysname, "os2-emx");
+ }

else if(rstreq(un.sysname, "Darwin")) {

#ifdef ppc

strcpy(un.machine, "ppc");

this code is disabled until we move to a newer distro.

comment:5 Changed 5 years ago by Yuri Dario

The solution is to hardcode 'os2-emx' in file listing, so _target_cpu-os2-emx is used in place of _target macro.

rpm: allow use of platform specific macros file. fixes ticket#135.
Sending branches/rpm-4.8.1/lib/rpmrc.c
Sending branches/rpm-4.8.1/
Sending branches/rpm-4.8.1/
Sending branches/rpm-4.8.1/scripts/brp-strip
Sending branches/rpm-4.8.1/scripts/brp-strip-static-archive
Sending trunk/lib/rpmrc.c
Sending trunk/
Sending trunk/
Sending trunk/scripts/brp-strip
Sending trunk/scripts/brp-strip-static-archive
Committed revision r582.

Last edited 5 years ago by Yuri Dario (previous) (diff)

comment:6 Changed 5 years ago by Yuri Dario

Resolution: fixed
Status: newclosed

comment:7 Changed 5 years ago by dmik

Great, thanks!

comment:8 Changed 3 years ago by dmik

Note that we should not forget to rollback this hard-coded change once we move to a new distro.

Note: See TracTickets for help on using tickets.