wok rev 9549

Up: get-LibreOffice - correct URLs etc.
author Ben Arnold <ben@seawolfsanctuary.com>
date Sat Apr 09 22:07:53 2011 +0100 (2011-04-09)
parents a1c397c67653
children 7bae66654182
files get-LibreOffice/receipt get-LibreOffice/stuff/get-LibreOffice
line diff
     1.1 --- a/get-LibreOffice/receipt	Sat Apr 09 21:24:01 2011 +0100
     1.2 +++ b/get-LibreOffice/receipt	Sat Apr 09 22:07:53 2011 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="get-LibreOffice"
     1.7 -VERSION="1.1.9"
     1.8 +VERSION="1.2"
     1.9  CATEGORY="office"
    1.10  SHORT_DESC="Productivity suite."
    1.11  MAINTAINER="ben@seawolfsanctuary.com"
     2.1 --- a/get-LibreOffice/stuff/get-LibreOffice	Sat Apr 09 21:24:01 2011 +0100
     2.2 +++ b/get-LibreOffice/stuff/get-LibreOffice	Sat Apr 09 22:07:53 2011 +0100
     2.3 @@ -14,12 +14,11 @@
     2.4  
     2.5  VERSION="$(basename $(wget -O - http://download.documentfoundation.org/libreoffice/$DIR/ \
     2.6  	2> /dev/null | grep href=\"[0-9] | tail -1 | sed 's/.*href=\"//;s/[/\">].*//'))"
     2.7 -  if [ -z "$VERSION" ]; then
     2.8 -    echo "Can't detect an appropriate version. The version numbering or URL may have changed.
     2.9 -    Aborted."
    2.10 -    exit 0
    2.11 -  fi
    2.12 -  VER="${VERSION/\-/}" # without hyphens
    2.13 +if [ -z "$VERSION" ]; then
    2.14 +	echo "Can't detect an appropriate version. The version numbering or URL may have changed. Aborted."
    2.15 +	exit 0
    2.16 +fi
    2.17 +VER="${VERSION/\-/}" # without hyphens
    2.18  
    2.19  
    2.20  TARBALL="LibO_${VER}_${SUFFIX}"
    2.21 @@ -29,15 +28,15 @@
    2.22  fr_FR|de_DE|es_ES|it_IT|ru_RU)
    2.23  	LOC=${LANG%_*} # strip
    2.24  	L_SUFFIX="Linux_x86_langpack-rpm_$LOC.tar.gz"
    2.25 -  L_TARBALL="LibO_${VER}_${L_SUFFIX}"
    2.26 -  LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}"
    2.27 -  echo "Added $LANG ($LOC)." ;;
    2.28 +	L_TARBALL="LibO_${VER}_${L_SUFFIX}"
    2.29 +	LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}"
    2.30 +	echo "Added $LANG ($LOC)." ;;
    2.31  en_GB|pt_BR)
    2.32 -  LANG=${LANG/_/-} # convert
    2.33 +	LANG=${LANG/_/-} # convert
    2.34  	L_SUFFIX="Linux_x86_langpack-rpm_$LANG.tar.gz"
    2.35 -  L_TARBALL="LibO_${VER}_${L_SUFFIX}"
    2.36 -  LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}"
    2.37 -  echo "Added $LANG." ;;
    2.38 +	L_TARBALL="LibO_${VER}_${L_SUFFIX}"
    2.39 +	LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}"
    2.40 +	echo "Added $LANG." ;;
    2.41  esac
    2.42  
    2.43  
    2.44 @@ -103,13 +102,13 @@
    2.45  # Check if we have the tarball before.
    2.46  if [ ! -f $SOURCE_DIR/$TARBALL ]; then
    2.47  	echo "Downloading LibreOffice tarball (it's time to have a break)... "
    2.48 -	#Check if $SOURCE_DIR exist
    2.49 +	# Check if $SOURCE_DIR exist
    2.50  	test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR
    2.51  	# Get the file.
    2.52  	wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL
    2.53  	if [ -n $L_TARBALL ] ; then # Are we localised?
    2.54 -    wget -c $LANG_URL -O $SOURCE_DIR/$L_TARBALL
    2.55 -  fi
    2.56 +		wget -c $LANG_URL -O $SOURCE_DIR/$L_TARBALL
    2.57 +	fi
    2.58  	status
    2.59  fi
    2.60  if [ ! -f $SOURCE_DIR/$TARBALL ]; then
    2.61 @@ -123,23 +122,27 @@
    2.62  # Creates TEMP_DIR and extract tarball
    2.63  mkdir -p $TEMP_DIR
    2.64  for TB in $TARBALL $L_TARBALL ; do
    2.65 -  tar xvzf $SOURCE_DIR/$TB -C $TEMP_DIR > $LOG 2>&1 || \
    2.66 -  (echo "Failed to extract $TB" ; exit 1)
    2.67 +	tar xvzf $SOURCE_DIR/$TB -C $TEMP_DIR > $LOG 2>&1 || \
    2.68 +	(echo "Failed to extract $TB" ; exit 1)
    2.69  done
    2.70 +
    2.71 +# Get version found in archive (often directory is still RC version when final is present)
    2.72 +ARCHIVED_VERSION=`find $TEMP_DIR -type d 2> /dev/null | grep LibO | head -n 1 | sed 's/_/ /g' | awk '{print $2}'`
    2.73 +echo -n "(found v${ARCHIVED_VERSION})"
    2.74 +
    2.75  # Consolidate localisations into main package
    2.76  if [ -n $L_TARBALL ] ; then # Are we localised?
    2.77 -#  mv -f $TEMP_DIR/${L_TARBALL/.tar.gz/}/RPMS/*.rpm $TEMP_DIR/${TARBALL/.tar.gz/}/RPMS/
    2.78 -  mv -f $TEMP_DIR/LibO_3.3.0rc4_Linux_x86_langpack-rpm_en-GB/RPMS/*.rpm $TEMP_DIR/LibO_3.3.0rc4_Linux_x86_install-rpm_en-US/RPMS/
    2.79 +	  TARBALL_NAME="${TARBALL/.tar.gz/}"
    2.80 +	L_TARBALL_NAME="${L_TARBALL/.tar.gz/}"
    2.81 +	mv -f $TEMP_DIR/${L_TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/*.rpm $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/
    2.82  fi
    2.83  status
    2.84  
    2.85  # Extracted pkg can be removed: Save RAM
    2.86  rm -rf $SOURCE_DIR
    2.87  
    2.88 -# cd $TEMP_DIR/${TARBALL/.tar.gz/}/RPMS
    2.89 -cd $TEMP_DIR/LibO_3.3.0rc4_Linux_x86_install-rpm_en-US/RPMS
    2.90 -
    2.91  # Extract everything from RPMS
    2.92 +cd $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS
    2.93  for i in *.rpm
    2.94  do
    2.95  	if (! echo $i | egrep -qi $EXCLUDE); then
    2.96 @@ -157,7 +160,7 @@
    2.97  
    2.98  # Make the package
    2.99  mkdir -p $PACKAGE-$VERSION/fs/usr/lib/libreoffice  \
   2.100 -  $PACKAGE-$VERSION/fs/usr/share
   2.101 +         $PACKAGE-$VERSION/fs/usr/share
   2.102  
   2.103  # use mv instead of 'cp -a' to save RAM
   2.104  mv opt/libreoffice* $PACKAGE-$VERSION/fs/usr/lib
   2.105 @@ -182,17 +185,16 @@
   2.106  post_install()
   2.107  {
   2.108  	cd /usr/share/applications
   2.109 -	ln -s /usr/lib/libreoffice/share/xdg/base.desktop libreoffice-base.desktop
   2.110 -	ln -s /usr/lib/libreoffice/share/xdg/impress.desktop libreoffice-impress.desktop
   2.111 -	ln -s /usr/lib/libreoffice/share/xdg/writer.desktop libreoffice-writer.desktop
   2.112 -	ln -s /usr/lib/libreoffice/share/xdg/calc.desktop libreoffice-calc.desktop
   2.113 -	ln -s /usr/lib/libreoffice/share/xdg/math.desktop libreoffice-math.desktop
   2.114 -	ln -s /usr/lib/libreoffice/share/xdg/draw.desktop libreoffice-draw.desktop
   2.115 +	ln -s /usr/lib/libreoffice/share/xdg/base.desktop          libreoffice-base.desktop
   2.116 +	ln -s /usr/lib/libreoffice/share/xdg/impress.desktop       libreoffice-impress.desktop
   2.117 +	ln -s /usr/lib/libreoffice/share/xdg/writer.desktop        libreoffice-writer.desktop
   2.118 +	ln -s /usr/lib/libreoffice/share/xdg/calc.desktop          libreoffice-calc.desktop
   2.119 +	ln -s /usr/lib/libreoffice/share/xdg/math.desktop          libreoffice-math.desktop
   2.120 +	ln -s /usr/lib/libreoffice/share/xdg/draw.desktop          libreoffice-draw.desktop
   2.121  	ln -s /usr/lib/libreoffice/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop
   2.122  
   2.123 -
   2.124  	cd /usr/bin
   2.125 -  ln -s /usr/lib/libreoffice /usr/lib/libreoffice/libreoffice
   2.126 +	ln -s /usr/lib/libreoffice /usr/lib/libreoffice/libreoffice
   2.127  	ln -sf /usr/lib/libreoffice/program/soffice
   2.128  }
   2.129