wok view get-vivaldi/stuff/get-vivaldi @ rev 19092
Add brower-html5 virtual package (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 01 10:46:33 2016 +0200 (2016-05-01) |
parents | 5e26ab6bd360 |
children | 29e8f3296626 |
line source
1 #!/bin/sh
3 # Get and install Vivaldi browser for Linux
5 # Check if we are root
6 if [ $(id -u) -ne 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 1
10 fi
12 # Get link to downloading precompiled package
13 dl_page='https://vivaldi.com/download'
14 dl_type='32bit RPM'
15 url=$(busybox wget -O - "$dl_page" | fgrep "$dl_type" | cut -d'"' -f2)
16 if [ -z "$url" ]; then
17 echo -e "\nCan't find download link on $dl_page for $dl_type."
18 exit 1
19 fi
21 # Download package
22 tmp_dir="$(mktemp -d)"
23 cd "$tmp_dir"
24 busybox wget $url
25 pkg=$(basename $url)
26 if [ ! -f $pkg ]; then
27 cd -
28 rm -r "$tmp_dir"
29 echo "Could not download $pkg. Exiting."
30 exit 1
31 fi
33 # Extract package
34 rpm2cpio $pkg | cpio -dium
35 rm $pkg
37 # Remove updater cron job
38 rm -r ./etc
40 # Add icons
41 for size in 16 22 24 32 48 64 128 256; do
42 mkdir -p "$tmp_dir/usr/share/icons/hicolor/${size}x$size/apps"
43 ln -s /opt/vivaldi/product_logo_$size.png "$tmp_dir/usr/share/icons/hicolor/${size}x$size/apps/vivaldi.png"
44 done
46 # Prepare to packaging
47 VERSION="$(echo $pkg | sed 's|[^_]*_\(.*\)\.i386.*|\1|')"
48 mkdir -p $tmp_dir/vivaldi-$VERSION/fs
49 mv $tmp_dir/opt $tmp_dir/usr $tmp_dir/vivaldi-$VERSION/fs
51 cat > $tmp_dir/vivaldi-$VERSION/receipt << EOT
52 PACKAGE="vivaldi"
53 VERSION="$VERSION"
54 CATEGORY="non-free"
55 SHORT_DESC="An advanced browser made with the power user in mind"
56 DEPENDS="gtk+ bash libcups libexif GConf"
57 WEB_SITE="https://vivaldi.com/"
58 EOT
60 tazpkg pack vivaldi-$VERSION gzip
62 # Clean to save RAM memory
63 rm -rf $PACKAGE-$VERSION
65 # Install pseudo package
66 yes y | tazpkg install vivaldi-$VERSION.tazpkg
68 # Clean
69 cd -
70 rm -rf $tmp_dir