RPM Community Forums

Mailing List Message of <rpm-users>

Re: Where to put distrubtion-specific macros

From: Eric MSP Veith <eveith@wwweb-library.net>
Date: Tue 14 Oct 2008 - 19:13:35 CEST
Message-Id: <200810141713.36534.eveith@wwweb-library.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

ok, these options pretty much look very specific, either for a user or a 
build process or a spec file. But how would a distributor ship his own 
macros? Is it patching the "offical" macros file?

		-- Eric


On Tuesday 14 October 2008, Jeff Johnson <n3npq@mac.com> wrote:
> On Oct 14, 2008, at 11:34 AM, Jeff Johnson wrote:
> > #!/bin/sh
> > macros="/usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/
> > macros.specspo:/etc/rpm/macros.sqlite:/etc/rpm/macros.cdb:/etc/rpm/
> > macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:/X/macros"
> >
> > case  in
> > -t*|-b*)        rpm=/usr/bin/rpmbuild;;
> > *)      rpm=/usr/bin/rpm;;
> > esac
> >
> > exec  --macros
>
> Hmmm, having a bad day w cut-n-paste and mail.
>
> Here's the complete ~/bin/xxxrpm wrapper script:
> #!/bin/sh
> macros="/usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/
> macros.specspo:/etc/rpm/macros.sqlite:/etc/rpm/macros.cdb:/etc/rpm/
> macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:/X/macros"
>
> case $1 in
> -t*|-b*)        rpm=/usr/bin/rpmbuild;;
> *)      rpm=/usr/bin/rpm;;
> esac
>
> exec $rpm --macros ${macros} $*
>
> > You can also compile a different set of paths to load macros from
> > if you configure with
> >  --with-path-macros=ARG  build with colon-separated RPM macro files
> > path
> > A number of other paths can be changed by configure, see
> >    ./configure --help
> > for the goop.
> >
> > The only rule for the colon separated list is that the first path
> > *must* exist.
> > Usually /usr/lib/rpm/macros is the 1st element in the list.
> >
> > BTW, there's also a
> > 	%{load:/path/to/custom/macros}
> > macro primitive that can be added to your spec files to specifically
> > load a pre-defined custom set of macros when building.
> >
> > hth
> >
> > 73 de Jeff
> >
> > ______________________________________________________________________
> > RPM Package Manager                                    http://rpm5.org
> > User Communication List                             rpm-users@rpm5.org
>
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkj000AACgkQfkUtd7QNU/tb6QCgpDVielmqirpIMyk8Uxv56snx
YaEAnjX3v2BDRBo5wRwcKa0/Z6vdo46q
=k6Rd
-----END PGP SIGNATURE-----
Received on Tue Oct 14 19:13:41 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.