Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] rpmbuild defining opt install path
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2012-06-27 13:12:00

On Jun 26, 2012, at 2:40 PM, Lloyd Brown wrote:

> Is there an easy way with the .spec file and the rpmbuild command, for
> me to override the path the OpenMPI RPM installs into, in /opt?
> Basically, I'm already doing something like this:

I think all you need to do is override the RPM-builtin names, like _prefix (and possibly some others). For example, I did this in RHEL 6.2:

rpmbuild --rebuild --define '_prefix /tmp/bogus' \

Which resulted in:

+ ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/tmp/bogus --exec-prefix=/tmp/bogus --bindir=/tmp/bogus/bin --sbindir=/tmp/bogus/sbin --sysconfdir=/tmp/bogus/etc --datadir=/tmp/bogus/share --includedir=/tmp/bogus/include --libdir=/tmp/bogus/lib64 --libexecdir=/tmp/bogus/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info

For some reason, this didn't override localstatedir, sharedstatedir, mandir, and infodir (gotta love RPM! :-) ), so I did:

rpmbuild --rebuild --define '_prefix /tmp/bogus' --define '_localstatedir /tmp/bogus/var' --define '_sharedstatedir /tmp/bogus/var/lib' --define '_mandir /tmp/bogus/share/man' --define '_infodir /tmp/bogus/share/info' /home/jsquyres/RPMS/SRPMS/openmpi-1.6-1.src.rpm

When then gave me what I think you want:

+ ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/tmp/bogus --exec-prefix=/tmp/bogus --bindir=/tmp/bogus/bin --sbindir=/tmp/bogus/sbin --sysconfdir=/tmp/bogus/etc --datadir=/tmp/bogus/share --includedir=/tmp/bogus/include --libdir=/tmp/bogus/lib64 --libexecdir=/tmp/bogus/libexec --localstatedir=/tmp/bogus/var --sharedstatedir=/tmp/bogus/var/lib --mandir=/tmp/bogus/share/man --infodir=/tmp/bogus/share/info

Jeff Squyres
For corporate legal information go to: