get-scripts view opera @ rev 44

opera: fix non-us layout error, again
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Sat May 23 13:48:59 2015 +0300 (2015-05-23)
parents a2a6f1bd608f
children ec186679eb26
line source
1 SHORT_DESC="Opera browser"
2 WEB_SITE="http://www.opera.com/"
3 # end of get.list data
4 URL=http://mirror.switch.ch/ftp/mirror/opera/linux/
6 get_releases()
7 {
8 wget -qO- "$URL?C=M;O=D" | sed 's|.*[Ff]="\([^"/]*\).*|\1|;/[^0-9b]/d'
9 }
11 # Download deb
12 for RELEASE in $@ $(get_releases); do
13 TARBALL=$(wget -O- "$URL$RELEASE/" 2>/dev/null |sed 's|.*[Ff]="\(.*\)".*|\1|;/6.d/!d;q'|sed 's/".*//')
14 [ -n "$TARBALL" ] || continue
15 WGET_URL=$URL$RELEASE/$TARBALL
16 wget $WGET_URL
17 [ -s $TARBALL ] && break
18 done
20 [ -f $TARBALL ] || abort_package "Could not download $TARBALL from $URL. Exiting."
22 mkdir $PACKAGE
23 dpkg-deb -e $TARBALL $PACKAGE/meta
24 dpkg-deb -x $TARBALL $PACKAGE/fs
25 # extracted pkg can be removed: Save RAM
26 rm -f $TARBALL
27 sed '/^Description:/,$!d;s/^Description://' \
28 < $PACKAGE/meta/control > $PACKAGE/description.txt
30 SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
31 MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
32 VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
33 mv $PACKAGE $PACKAGE-$VERSION
34 cd $PACKAGE-$VERSION/fs
36 # Localized keyboard layout fix
37 busybox sed "s|sh$|sh\nexport XMODIFIERS=\"@im=none\"|" -i usr/bin/opera
39 # Create menu
40 mkdir -p usr/share/applications
41 cat > usr/share/applications/opera-browser.desktop <<EOT
42 [Desktop Entry]
43 Version=1.0
44 TryExec=opera
45 Encoding=UTF-8
46 Name=Opera
47 Name[af]=opera
48 Name[eo]=Opero
49 Name[zu]=I Opera
50 GenericName=Web browser
51 GenericName[bs]=Web preglednik
52 GenericName[de]=Web-Browser
53 GenericName[eo]=TTT-rigardilo
54 GenericName[es]=Navegador web
55 GenericName[et]=Veebibrauser
56 GenericName[eu]=Web arakatzailea
57 GenericName[fi]=WWW-selain
58 GenericName[fr]=Un navigateur web
59 GenericName[is]=Vafri
60 GenericName[it]=Browser Web
61 GenericName[nl]=webbrowser
62 GenericName[nn]=Nettlesar
63 GenericName[pt]=Navegador Web
64 GenericName[pt_BR]=Navegador
65 GenericName[ro]=Navigator de web
66 GenericName[sl]=Spletni brskalnik
67 GenericName[ven]=Buronza ya Webu
68 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
69 GenericName[zu]=Umkhangeli zincwadi we Web
70 Exec=opera %u
71 Terminal=false
72 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
73 Icon=opera-browser
74 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
75 Comment=Web Browser
76 Type=Application
77 EOT
78 cd ../..
80 # Remove unwanted locale
81 mv $PACKAGE-$VERSION/fs/usr/share/opera/locale $PACKAGE-$VERSION/fs/usr/share/opera/locale-full
82 mkdir -p $PACKAGE-$VERSION/fs/usr/share/opera/locale
83 . /etc/locale.conf
84 for i in $LANG ${LANG/_/-} ${LANG:0:2} en fr ru pt de zh-cn ; do
85 [ -d $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i ] &&
86 cp -a $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i \
87 $PACKAGE-$VERSION/fs/usr/share/opera/locale
88 done
89 rm -rf $PACKAGE-$VERSION/fs/usr/share/opera/locale-full
90 rm -rf $PACKAGE-$VERSION/fs/usr/share/pixmaps
91 set +e