RPM Community Forums

Mailing List Message of <rpm-users>

Re: Where to put distrubtion-specific macros

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 14 Oct 2008 - 18:48:44 CEST
Message-id: <AC49857F-211E-4078-B152-A1DA608F87CC@mac.com>

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
Received on Tue Oct 14 18:48:57 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.