wok-current view get-opera/stuff/get-opera @ rev 9117
scim-tables-additional: remove spurrious part of genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 05 13:01:38 2011 +0100 (2011-03-05) |
parents | 0edf44a4a7be |
children | 712b7c1ce69a |
line source
1 #!/bin/sh -e
3 URL=http://mirrors.dedipower.com/opera/linux/
4 ROOT="$1"
6 if test $(id -u) != 0 ; then
7 echo -e "\nYou must be root to run `basename $0`."
8 echo -e "Please type 'su' and root password to become super-user.\n"
9 exit 0
10 fi
12 if [ -d $ROOT/var/lib/tazpkg/installed/opera ]; then
13 [ -n "$ROOT" ] && exit 1
14 tazpkg remove opera
15 [ -d /var/lib/tazpkg/installed/opera ] && exit 1
16 fi
18 TMP_DIR=/tmp/get-opera-$$-$RANDOM
19 CUR_DIR=$(pwd)
20 mkdir -p $TMP_DIR && cd $TMP_DIR
22 get_releases()
23 {
24 wget -O - "$URL?C=M;O=D" 2>/dev/null | awk '/folder/ { print $5 }' | \
25 sed -e 's/href="\(.*\)">.*/\1/' -e 's|/||'
26 }
28 # Download deb
29 for RELEASE in $(get_releases); do
30 [ -n "$RELEASE" ] || continue
31 FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.deb | sed 's/.*href="\(.*\)">.*/\1/' | head -n 1)
32 [ -n "$FILE" ] || continue
33 wget $URL$RELEASE/$FILE
34 [ -s $FILE ] && break
35 done
37 if [ ! -f $FILE ]; then
38 cd $CUR_DIR
39 rm -rf $TMP_DIR
40 echo "Could not download $FILE. Exiting."
41 exit 1
42 fi
44 mkdir opera
45 dpkg-deb -e $FILE opera/meta
46 dpkg-deb -x $FILE opera/fs
47 # extracted pkg can be removed: Save RAM
48 rm -f $FILE
49 sed '/^Description:/,$!d;s/^Description://' \
50 < opera/meta/control > opera/description.txt
52 VERSION=$(grep ^Version opera/meta/control | awk '{ print $2 }')
53 mv opera opera-$VERSION
54 cd opera-$VERSION/fs
56 # Create menu
57 mkdir -p usr/share/applications
58 cat > usr/share/applications/opera-browser.desktop <<EOT
59 [Desktop Entry]
60 Version=1.0
61 TryExec=opera
62 Encoding=UTF-8
63 Name=Opera
64 Name[af]=opera
65 Name[eo]=Opero
66 Name[zu]=I Opera
67 GenericName=Web browser
68 GenericName[bs]=Web preglednik
69 GenericName[de]=Web-Browser
70 GenericName[eo]=TTT-rigardilo
71 GenericName[es]=Navegador web
72 GenericName[et]=Veebibrauser
73 GenericName[eu]=Web arakatzailea
74 GenericName[fi]=WWW-selain
75 GenericName[fr]=Un navigateur web
76 GenericName[is]=Vafri
77 GenericName[it]=Browser Web
78 GenericName[nl]=webbrowser
79 GenericName[nn]=Nettlesar
80 GenericName[pt]=Navegador Web
81 GenericName[pt_BR]=Navegador
82 GenericName[ro]=Navigator de web
83 GenericName[sl]=Spletni brskalnik
84 GenericName[ven]=Buronza ya Webu
85 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
86 GenericName[zu]=Umkhangeli zincwadi we Web
87 Exec=opera %u
88 Terminal=false
89 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
90 Icon=opera-browser.png
91 MimeType=text/html;text/xml;application/xhtml+xml;application/x-mimearchive;application/xml;application/rss+xml;application/rdf+xml;image/svg+xml;image/gif;image/jpeg;image/png;image/x-bmp;image/x-xbm;application/mime
92 Comment=Web Browser
93 Type=Application
94 EOT
95 cd ../..
97 cat > opera-$VERSION/receipt <<EOT
98 PACKAGE="opera"
99 VERSION="$VERSION"
100 CATEGORY="non-free"
101 SHORT_DESC="Opera Web browser."
102 DEPENDS="libQtGui"
103 WEB_SITE="http://www.opera.com/"
104 EOT
106 # Remove unwanted locale
107 mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full
108 mkdir -p opera-$VERSION/fs/usr/share/opera/locale
109 . /etc/locale.conf
110 for i in $LANG $(echo $LANG | sed 's/_/-/') ${LANG:0:2} ; do
111 [ -d opera-$VERSION/fs/usr/share/opera/locale-full/$i ] &&
112 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/$i \
113 opera-$VERSION/fs/usr/share/opera/locale
114 done
115 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \
116 opera-$VERSION/fs/usr/share/opera/locale-full/fr \
117 opera-$VERSION/fs/usr/share/opera/locale-full/pt \
118 opera-$VERSION/fs/usr/share/opera/locale-full/de \
119 opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \
120 opera-$VERSION/fs/usr/share/opera/locale
121 rm -rf opera-$VERSION/fs/usr/share/opera/locale-full
122 rm -rf opera-$VERSION/fs/usr/share/pixmaps
125 # Pack
126 tazpkg pack opera-$VERSION
128 # Clean to save RAM memory
129 rm -rf opera-$VERSION
131 # Install pseudo package
132 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
134 # Clean
135 cd $CUR_DIR
136 rm -rf $TMP_DIR