lfs-buildscripts/CH8Build/CH08.59-gawk.sh

50 lines
894 B
Bash
Raw Normal View History

2024-10-07 01:55:01 +08:00
#!/bin/bash
source versions.sh
GLSOURCES="/sources"
2024-10-09 09:50:04 +08:00
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-07 01:55:01 +08:00
[ -d gawk-${gawk_version} ] && rm -rf gawk-${gawk_version}
tar -Jxf ${gawk_tarball}
cd gawk-${gawk_version}
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr
make
if [ $? -ne 0 ]; then
myfail "Failed building gawk"
fi
2024-10-09 09:50:04 +08:00
if [ ! -f ${GLSOURCES}/SKIPTESTS ]; then
echo "running gawk make check"
chown -R tester .
su tester -c "PATH=$PATH make check > gawk.check.log"
mv gawk.check.log ${GLSOURCES}/
fi
2024-10-07 01:55:01 +08:00
rm -f /usr/bin/gawk-${gawk_version}
make install
if [ $? -ne 0 ]; then
myfail "Failed installing xz"
fi
ln -sv gawk.1 /usr/share/man/man1/awk.1
mkdir -p /usr/share/doc/gawk-${gawk_version}
cp doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-${gawk_version}
2024-10-08 14:25:15 +08:00
popd
# cleanup
pushd $GLSOURCES
rm -rf gawk-${gawk_version}
popd