Originally Posted by neymac
I've built the latest (3.6.1) version with the 3 files downloaded from http://www.libreoffice.org/download
. I'm looking for a way to check by script if is there a new version, download and build it automatically.
You could probably start with something like this:
LIBOVERSION=$(wget -qO- http://www.libreoffice.org/download | sed -rn 's,.*/LibO_([0-9\.]*)_Linux_x86_install-rpm_en-US.tar.gz[^\.].*,\1,p')
if [ -z $LIBOVERSION ]; then
echo "Could not work out the latest version; exiting"
if /bin/ls /var/log/packages/libreoffice-$LIBOVERSION-* >/dev/null 2>&1 ; then
echo "LibreOffice version $LIBOVERSION is already installed. Nothing to do!"
wget --header="Accept-Language: $(echo $LANG | cut -d. -f1)" -qO- http://www.libreoffice.org/download |\
grep -E "(install-rpm|langpack-rpm|helppack-rpm).*tar.gz[^\.]" |\
grep -v "LibO-SDK" |\
That covers the check for new version and download parts. Put this in a script and have the rest be like a traditional SlackBuild that does repacking, using $LIBOVERSION as the version number.
The above assumes you are using the naming format libreoffice-version
, like Alien Bob does with his packages. If you use some other name (i.e. not libreoffice) adjust my check in /var/log/packages/ accordingly.