PDA

View Full Version : RPM spec file question



Victor Brilon
2003-11-30, 23:35
Dean,

In the current RPM spec file, there's a piece of code that looks like this:

%post
# Make sure we have the correct SLIMSERVER_HOME in /etc/sysconfig/slimserver
# Convert / to \/ for the sed substitution
if [ `grep -c PREFIX /etc/sysconfig/slimserver` -gt 0 ]; then
DEST_FILE=/etc/sysconfig/slimserver
else
DEST_FILE=/etc/sysconfig/slimserver.rpmnew
fi
SLIMSERVER_PREFIX=`echo %{slimdir} | sed 's/\//\\\\\//g'`
sed "s/PREFIX/$SLIMSERVER_PREFIX/" $DEST_FILE > /tmp/slimserver.$$
if [ -s /tmp/slimserver.$$ ]; then
cp /tmp/slimserver.$$ $DEST_FILE
rm /tmp/slimserver.$$
fi


What exactly is trying to be accomplished here? I don't recall seeing a
"PREFIX" placeholder in any config file before. Therefore the if-loop
above will always fail. And that's why the latest RPM build has the
error where sed is complaining about a missing file.

Should it be looking for SLIMSERVER_HOME by chance or something similar
instead?

I'm glad to fix it, just let me know what you intend for it to do :)

Victor