Red Hat build scripts suggestion

Ronan Waide waider at waider.ie
Wed Aug 20 15:41:33 GMT 2003


In the current makerpms.sh file, there is the following snippet of
code:

if [ -r ~/.rpmmacros ]; then
        TOPDIR=`awk '/topdir/ {print $2}' < ~/.rpmmacros`
        if [ z$TOPDIR != "z" ]; then
                SPECDIR=${TOPDIR}/SPECS
                SRCDIR=${TOPDIR}/SOURCES
        fi
fi

This assumes that topdir is defined and that the spec and src dirs are
below it. This, alas, is not the case for my own rpmmacros file. RPM
provides a useful fix for this, though: rpm -E %macro prints the
expansion of macro. So the above code could be replaced with:

SPECDIR=`rpm -E %_specdir`
SOURCEDIR=`rpm -E %_sourcedir`

Cheers,
Waider.
-- 
waider at waider.ie / Yes, it /is/ very personal of me.

heehoo says, "Well, it's not a party until everybody has liver damage 
    and nobody can find the carpet."



More information about the samba-technical mailing list