Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#135 closed defect (fixed)

Use platform/<name>/macros

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

Description

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 by dmik, 10 years ago

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

comment:2 by Yuri Dario, 9 years ago

Severity: low

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

"/@unixroot/usr/lib/rpm/macros:/@unixroot/usr/lib/rpm/macros.d/macros.*:/@unixroot/usr/lib/rpm/platform/pentium4-os/2/macros:/@unixroot/usr/lib/rpm/pc/macros:/@unixroot/etc/rpm/macros.*:/@unixroot/etc/rpm/macros:/@unixroot/etc/rpm/pentium4-os/2/macros:~/.rpmmacros"

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 by Yuri Dario, 9 years ago

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 by Yuri Dario, 9 years ago

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");
+ }
+#endif

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 by Yuri Dario, 9 years ago

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/macros.in
Sending branches/rpm-4.8.1/platform.in
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/macros.in
Sending trunk/platform.in
Sending trunk/scripts/brp-strip
Sending trunk/scripts/brp-strip-static-archive
Committed revision r582.

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

comment:6 by Yuri Dario, 9 years ago

Resolution: fixed
Status: newclosed

comment:7 by dmik, 9 years ago

Great, thanks!

comment:8 by dmik, 8 years ago

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.