wok-4.x rev 12364

Up get-OpenOffice3 (1.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 20 14:58:37 2012 +0100 (2012-12-20)
parents f85ba349ca40
children 9bd79558e5c5
files get-OpenOffice3/receipt get-OpenOffice3/stuff/get-OpenOffice3
line diff
     1.1 --- a/get-OpenOffice3/receipt	Thu Dec 20 10:16:10 2012 +0200
     1.2 +++ b/get-OpenOffice3/receipt	Thu Dec 20 14:58:37 2012 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="get-OpenOffice3"
     1.7 -VERSION="1.1"
     1.8 +VERSION="1.2"
     1.9  CATEGORY="office"
    1.10  SHORT_DESC="Productivity suite"
    1.11  MAINTAINER="erjo@slitaz.org"
     2.1 --- a/get-OpenOffice3/stuff/get-OpenOffice3	Thu Dec 20 10:16:10 2012 +0200
     2.2 +++ b/get-OpenOffice3/stuff/get-OpenOffice3	Thu Dec 20 14:58:37 2012 +0100
     2.3 @@ -21,15 +21,18 @@
     2.4  http://www.ring.gr.jp/archives/misc/openoffice \
     2.5  http://ftp.nluug.nl/pub/office/openoffice \
     2.6  
     2.7 -do wget -O - $MIRROR/ 2> /dev/null | grep -q localized && break ; done
     2.8 +do
     2.9 +	wget -O - $MIRROR/ 2> /dev/null | grep -q localized || continue
    2.10 +	DIR="stable"
    2.11 +	LOC=$(wget -O - $MIRROR/localized/ 2> /dev/null | \
    2.12 +		grep -E ">$LANG/|>${LANG/_/-}/|>${LANG%_*}/" | \
    2.13 +		head -1 | sed 's/.*href=\"\(.*\)\/\".*/\1/')
    2.14 +	[ -n "$LOC" ] && DIR="localized/$LOC"
    2.15 +	VERSION="$(basename $(wget -O - $MIRROR/$DIR/ 2> /dev/null | grep \
    2.16 +	href=\"[0-9] | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/') 2> /dev/null)"
    2.17 +	[ -n "$VERSION" ] && break
    2.18 +done
    2.19  
    2.20 -DIR="stable"
    2.21 -LOC=$(wget -O - $MIRROR/localized/ 2> /dev/null \
    2.22 -| grep -E ">$LANG/|>${LANG/_/-}/|>${LANG%_*}/" | head -1 | sed 's/.*href=\"\(.*\)\/\".*/\1/')
    2.23 -[ -n "$LOC" ] && DIR="localized/$LOC"
    2.24 -
    2.25 -VERSION="$(basename $(wget -O - $MIRROR/$DIR/ \
    2.26 -	2> /dev/null | grep href=\"[0-9] | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/'))"
    2.27  if [ -z "$VERSION" ]; then
    2.28  	echo "Can't find VERSION. Abort."
    2.29  	exit 0
    2.30 @@ -41,6 +44,7 @@
    2.31  WGET_URL=$MIRROR/$DIR/$VERSION/$TARBALL
    2.32  
    2.33  TEMP_DIR="/tmp/$PACKAGE.$$"
    2.34 +CUR_DIR=$(pwd)
    2.35  SOURCE_DIR="/tmp/src.$$"
    2.36  EXCLUDE="kde|gnome|test"
    2.37  LOG="/tmp/$(basename $0 .sh).log"
    2.38 @@ -159,12 +163,12 @@
    2.39  VERSION="$VERSION"
    2.40  CATEGORY="office"
    2.41  SHORT_DESC="Productivity suite."
    2.42 -DEPENDS=""
    2.43 +DEPENDS="java-jre"
    2.44  WEB_SITE="$URL"
    2.45  
    2.46  post_install()
    2.47  {
    2.48 -	cd /usr/share/applications
    2.49 +	cd \$1/usr/share/applications
    2.50  	ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/base.desktop openoffice.org3-base.desktop 
    2.51  	ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/impress.desktop openoffice.org3-impress.desktop
    2.52  	ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/writer.desktop openoffice.org3-writer.desktop
    2.53 @@ -173,26 +177,67 @@
    2.54  	ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/draw.desktop openoffice.org3-draw.desktop
    2.55  	ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/printeradmin.desktop openoffice.org3-printeradmin.desktop
    2.56  	
    2.57 -	cd /usr/bin
    2.58 +	cd \$1/usr/bin
    2.59  	ln -sf /usr/lib/openoffice/openoffice.org3/program/soffice
    2.60  }
    2.61  
    2.62  post_remove()
    2.63  {
    2.64 -	rm -f /usr/share/applications/openoffice.org3-*
    2.65 +	rm -f \$1/usr/share/applications/openoffice.org3-*
    2.66  }
    2.67  
    2.68  EOT
    2.69  
    2.70 -# Pack
    2.71 -tazpkg pack $PACKAGE-$VERSION
    2.72 +fake_install()
    2.73 +{
    2.74 +	mkdir -p $ROOT/var/lib/tazpkg/installed/$PACKAGE
    2.75 +	echo "00000000000000000000000000000000  $PACKAGE-$VERSION.tazpkg" >> \
    2.76 +		$ROOT/var/lib/tazpkg/installed.md5
    2.77 +	[ -s $1/description.txt $ROOT/var/lib/tazpkg/installed/$PACKAGE
    2.78 +	( cd fs ; find *) | sed 's|^|/|' > \
    2.79 +		$ROOT/var/lib/tazpkg/installed/$PACKAGE/files.list
    2.80 +	if grep -q ^CONFIG_FILES= $1/receipt ; then
    2.81 +		cd fs
    2.82 +		find $( . ./receipt ; echo " $CONFIG_FILES" | sed 's| /| |g') |\
    2.83 +			cpio -o -H newc | gzip -9 > \
    2.84 +			$ROOT/var/lib/tazpkg/installed/$PACKAGE/volatile.cpio.gz
    2.85 +		for i in $( . ./receipt ; echo $CONFIG_FILES) ; do
    2.86 +			[ -e $ROOT$i ] && rm -rf .$i
    2.87 +		done
    2.88 +		cd ..
    2.89 +	fi
    2.90 +	sed -i "s/^PACKAGE=/UNPACKED_SIZE=\"$(du -chs $1 | sed '$!d;s/.total//')\"\n&/" \
    2.91 +		$1/receipt
    2.92 +	cp $1/receipt $ROOT/var/lib/tazpkg/installed/$PACKAGE
    2.93 +	echo "Compute md5sum..."
    2.94 +	find fs -type f | xargs md5sum | sed 's|  fs/|  /|' > \
    2.95 +		$ROOT/var/lib/tazpkg/installed/$PACKAGE/md5sum
    2.96 +	echo "Move files..."
    2.97 +	( cd $1/fs ; find ) | while read file ; do 
    2.98 +		[ -e $1/fs/$file -a ! -e $ROOT/$file ] &&
    2.99 +		mv $1/fs/$file $(dirname $ROOT/$file)
   2.100 +	done
   2.101 +}
   2.102  
   2.103 -# Clean to save RAM memory
   2.104 -rm -rf $PACKAGE-$VERSION
   2.105 +case " $@ " in
   2.106 +*\ --q*)	# --quick
   2.107 +	fake_install $PACKAGE-$VERSION ;;
   2.108 +*)
   2.109 +	# Pack
   2.110 +	tazpkg pack $PACKAGE-$VERSION
   2.111  
   2.112 -# Install pseudo package
   2.113 -tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   2.114 +	# Clean to save RAM memory
   2.115 +	rm -rf $PACKAGE-$VERSION
   2.116 +
   2.117 +	# Install pseudo package
   2.118 +	tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   2.119 +
   2.120 +	echo " $@ " | grep -q ' --k' &&
   2.121 +	mv $PACKAGE-$VERSION.tazpkg $CUR_DIR
   2.122 +	;;
   2.123 +esac
   2.124 +
   2.125 +cd $CUR_DIR
   2.126  
   2.127  # Clean
   2.128  rm -rf $TEMP_DIR
   2.129 -