Skip to content

Commit

Permalink
Add lo_version to vars/main.yml to be set to the latest LibreOffice s…
Browse files Browse the repository at this point in the history
…table version available, you can run ./scripts/loVersion.sh to make sure this value is correctly set. If not, you will be invited to edit vars/main.yml to set the correct value.
  • Loading branch information
gfenoy committed Mar 28, 2016
1 parent dc7fb73 commit eeea5b5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion debian/dependencies/vars/main.yml
Expand Up @@ -4,4 +4,5 @@ srcdir: /home/src
datadir: /var/data
rootdir: /var/www/html
pgvers: 9.4
indicators: false
indicators: false
lo_version: 5.0.5
6 changes: 3 additions & 3 deletions debian/mapmint/tasks/main.yml
Expand Up @@ -152,13 +152,13 @@
unarchive: copy=no src={{datadir}}/fonts.tar.bz2 dest={{datadir}}/fonts

- name: Download LibreOffice
get_url: url=http://download.documentfoundation.org/libreoffice/stable/5.0.4/deb/x86_64/LibreOffice_5.0.4_Linux_x86-64_deb.tar.gz dest={{srcdir}}
get_url: url=http://download.documentfoundation.org/libreoffice/stable/{{lo_version}}/deb/x86_64/LibreOffice_{{lo_version}}_Linux_x86-64_deb.tar.gz dest={{srcdir}}

- name: Uncompress LibreOffice
unarchive: copy=no src={{srcdir}}/LibreOffice_5.0.4_Linux_x86-64_deb.tar.gz dest={{srcdir}}/ owner=www-data
unarchive: copy=no src={{srcdir}}/LibreOffice_{{lo_version}}_Linux_x86-64_deb.tar.gz dest={{srcdir}}/ owner=www-data

- name: Install LibreOffice
shell: cd {{srcdir}}/LibreOffice_5.0.4.2_Linux_x86-64_deb/DEBS ; dpkg -i *.deb
shell: cd {{srcdir}}/LibreOffice_{{lo_version}}.2_Linux_x86-64_deb/DEBS ; dpkg -i *.deb

- name: Install LibreOffice Server init script
copy: src=files/mapmint-libreoffice-server dest=/etc/init.d/mapmint-libreoffice-server
Expand Down
15 changes: 15 additions & 0 deletions scripts/loVersion.sh
@@ -0,0 +1,15 @@
#!/bin/bash

curl -o list.html "http://download.documentfoundation.org/libreoffice/stable/" 2> log
grep "a href=" -rni ./list.html | grep -v Size | grep -v "Parent Directory" > list1.html
head -n1 list1.html | cut -d">" -f5 | cut -d'=' -f2 | sed 's:"::g' | sed 's:/::g' > version.txt

if [ "5.0.5" = "$(cat version.txt)" ]; then
echo "LibreOffice version is 5.0.5, you have nothing to do.";
else
echo "Please edit the following files:";
for i in debian ubuntu; do
echo " * " $i/dependencies/vars/main.yml
done
echo "to define the LibreOffice version (lo_version) as $(cat version.txt)";
fi
3 changes: 2 additions & 1 deletion ubuntu/dependencies/vars/main.yml
Expand Up @@ -4,4 +4,5 @@ srcdir: /home/src
datadir: /var/data
rootdir: /var/www/html
pgvers: 9.3
indicators: false
indicators: false
lo_version: 5.0.5

0 comments on commit eeea5b5

Please sign in to comment.