perl: replace hardcoded destdir paths.

--HG--
extra : convert_revision : 5734e2f06b62fa52a4616edd77a21231171e1f34
This commit is contained in:
Juan RP 2009-02-04 01:03:44 +01:00
parent c1f0ae6c16
commit 24f389b5ca

View file

@ -40,3 +40,22 @@ pre_build()
sed -i -e "s|$XBPS_MASTERDIR||g" $wrksrc/config.h
fi
}
post_install()
{
# Remove hardcoded paths of XBPS_DESTDIR.
local destdir="$XBPS_DESTDIR/$pkgname-$version"
local FILES="Config.pm Config_heavy.pl .packlist"
local opmult="${xbps_machine}-linux-thread-multi"
local thrdir="${destdir}/usr/lib/perl5/${version}/${opmult}"
for f in ${FILES}; do
sed -i -e "s|$destdir||g" ${thrdir}/${f}
done
for f in $(find $destdir/usr/bin/ -type f -print); do
if $(echo $f|grep -q $destdir); then
sed -i -e "s|$destdir||g" $f
echo "Replacing $f"
fi
done
}