summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO40
-rw-r--r--PKGBUILD35
-rw-r--r--slimjet.install225
3 files changed, 300 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c258d5daaa7d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,40 @@
+pkgbase = slimjet
+ pkgdesc = Fast, smart and powerful browser based on Blink
+ pkgver = 4.0.15.0
+ pkgrel = 2
+ url = http://www.slimjet.com
+ arch = i686
+ arch = x86_64
+ license = custom:slimjet
+ makedepends = pacman>=4.2.0
+ depends = alsa-lib
+ depends = desktop-file-utils
+ depends = flac
+ depends = gconf
+ depends = gtk2
+ depends = harfbuzz
+ depends = harfbuzz-icu
+ depends = hicolor-icon-theme
+ depends = icu
+ depends = libpng
+ depends = libxss
+ depends = libxtst
+ depends = nss
+ depends = opus
+ depends = snappy
+ depends = speech-dispatcher
+ depends = ttf-font
+ depends = xdg-utils
+ optdepends = kdebase-kdialog: needed for file dialogs in KDE
+ optdepends = ttf-liberation: fix fonts for some PDFs
+ provides = slimjet
+ provides = pepper-flash
+ options = !emptydirs
+ options = !strip
+ source_i686 = slimjet_i386.deb::http://www.slimjet.com//slimjet_i386.deb
+ sha512sums_i686 = b0d7e80ed9340f48bfe71af834602c4aa508386d76fda74d32c824e8e24b8ac0cc1b48e65a4831dce9e8af1dc7dd0879f9d7fa8b8d6786bed447ba3abdc72b4f
+ source_x86_64 = slimjet_amd64.deb::http://www.slimjet.com/{}/slimjet_amd64.deb
+ sha512sums_x86_64 = 72d2029c805a8b91c9a7e386291235fb410181eefd14b22176822dc4d7584b7a3f95b743c43669399ce552d0ea73e901c16b045ca7d7c33aa308338d31fc87a9
+
+pkgname = slimjet
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0d73ad6bf7b3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: eagleeyetom <eagleeyetom@gmail.com>
+# Contrubutor: raininja <raijin@rai.ninja>
+
+pkgname=slimjet
+pkgver=4.0.15.0
+pkgrel=2
+pkgdesc="Fast, smart and powerful browser based on Blink"
+arch=('i686' 'x86_64')
+url="http://www.slimjet.com"
+license=('custom:slimjet')
+depends=('alsa-lib' 'desktop-file-utils' 'flac' 'gconf' 'gtk2' 'harfbuzz' 'harfbuzz-icu' 'hicolor-icon-theme'
+ 'icu' 'libpng' 'libxss' 'libxtst' 'nss' 'opus' 'snappy' 'speech-dispatcher' 'ttf-font' 'xdg-utils')
+optdepends=('kdebase-kdialog: needed for file dialogs in KDE'
+ 'ttf-liberation: fix fonts for some PDFs')
+makedepends=('pacman>=4.2.0')
+provides=('slimjet' 'pepper-flash')
+options=('!emptydirs' '!strip')
+source_i686=("${pkgname}_i386.deb::http://www.slimjet.com/${_channel}/${pkgname}_i386.deb")
+source_x86_64=("${pkgname}_amd64.deb::http://www.slimjet.com/{$_channel}/${pkgname}_amd64.deb")
+sha512sums_i686=('b0d7e80ed9340f48bfe71af834602c4aa508386d76fda74d32c824e8e24b8ac0cc1b48e65a4831dce9e8af1dc7dd0879f9d7fa8b8d6786bed447ba3abdc72b4f')
+sha512sums_x86_64=('72d2029c805a8b91c9a7e386291235fb410181eefd14b22176822dc4d7584b7a3f95b743c43669399ce552d0ea73e901c16b045ca7d7c33aa308338d31fc87a9')
+
+package() {
+ msg2 "Extracting the data.tar.lzma..."
+ bsdtar -xf data.tar.lzma -C "$pkgdir/"
+ msg2 "Changing permissions. . ."
+ chmod -R 0755 "$pkgdir/"
+
+ for i in 16x16 22x22 24x24 32x32 48x48 64x64 128x128 256x256; do
+ install -Dm644 "$pkgdir"/opt/slimjet/product_logo_${i/x*}.png \
+ "$pkgdir"/usr/share/icons/hicolor/$i/apps/flashpeak-slimjet.png
+
+ done
+
+}
diff --git a/slimjet.install b/slimjet.install
new file mode 100644
index 000000000000..6dda0219933b
--- /dev/null
+++ b/slimjet.install
@@ -0,0 +1,225 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+
+ ARCH=$(uname -m)
+
+
+ # Add icons to the system icons
+ XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`"
+ if [ ! -x "$XDG_ICON_RESOURCE" ]; then
+ echo "Error: Could not find xdg-icon-resource" >&2
+ exit 1
+ fi
+ for icon in "/opt/slimjet/product_logo_"*.png; do
+ size="${icon##*/product_logo_}"
+ "$XDG_ICON_RESOURCE" install --size "${size%.png}" "$icon" "flashpeak-slimjet"
+ done
+
+ UPDATE_MENUS="`which update-mime-database usr/share/mime &> /dev/null 2> /dev/null || true`"
+ if [ -x "$UPDATE_MENUS" ]; then
+ update-mime-database usr/share/mime &> /dev/null
+ fi
+
+ # Update cache of .desktop file MIME types. Non-fatal since it's just a cache.
+ update-desktop-database > /dev/null 2>&1 || true
+
+ # Updates defaults.list file if present.
+ update_defaults_list() {
+ # $1: name of the .desktop file
+
+ #local DEFAULTS_FILE="/usr/share/applications/defaults.list"
+ DEFAULTS_FILE="/usr/share/applications/defaults.list"
+
+ if [ ! -f "${DEFAULTS_FILE}" ]; then
+ return
+ fi
+
+ # Split key-value pair out of MimeType= line from the .desktop file,
+ # then split semicolon-separated list of mime types (they should not contain
+ # spaces).
+ mime_types="$(grep MimeType= /usr/share/applications/${1} |
+ cut -d '=' -f 2- |
+ tr ';' ' ')"
+ for mime_type in ${mime_types}; do
+ if egrep -q "^${mime_type}=" "${DEFAULTS_FILE}"; then
+ if ! egrep -q "^${mime_type}=.*${1}" "${DEFAULTS_FILE}"; then
+ default_apps="$(grep ${mime_type}= "${DEFAULTS_FILE}" |
+ cut -d '=' -f 2-)"
+ egrep -v "^${mime_type}=" "${DEFAULTS_FILE}" > "${DEFAULTS_FILE}.new"
+ echo "${mime_type}=${default_apps};${1}" >> "${DEFAULTS_FILE}.new"
+ mv "${DEFAULTS_FILE}.new" "${DEFAULTS_FILE}"
+ fi
+ else
+ # If there's no mention of the mime type in the file, add it.
+ echo "${mime_type}=${1};" >> "${DEFAULTS_FILE}"
+ fi
+ done
+ }
+
+ update_defaults_list "slimjet.desktop"
+
+ # This function uses sed to insert the contents of one file into another file,
+ # after the first line matching a given regular expression. If there is no
+ # matching line, then the file is unchanged.
+ insert_after_first_match() {
+ # $1: file to update
+ # $2: regular expression
+ # $3: file to insert
+ sed -i -e "1,/$2/ {
+ /$2/ r $3
+ }" "$1"
+ }
+
+ # If /usr/share/gnome-control-center/gnome-default-applications.xml exists, it
+ # may need to be updated to add ourselves to the default applications list. If
+ # we find the file and it does not seem to contain our patch already (the patch
+ # is safe to leave even after uninstall), update it.
+ GNOME_DFL_APPS=/usr/share/gnome-control-center/gnome-default-applications.xml
+ if [ -f "$GNOME_DFL_APPS" ]; then
+ # Conditionally insert the contents of the file "default-app-block" after the
+ # first "<web-browsers>" line we find in gnome-default-applications.xml
+ fgrep -q "FlashPeak Slimjet" "$GNOME_DFL_APPS" || insert_after_first_match "$GNOME_DFL_APPS" "^[ ]*<web-browsers>[ ]*$" "/opt/slimjet/default-app-block"
+ fi
+
+
+ get_lib_dir() {
+ if [ "$ARCH" = "i686" ]; then
+ LIBDIR=/usr/lib
+ elif [ "$ARCH" = "x86_64" ]; then
+ LIBDIR=/usr/lib64
+ else
+ echo Unknown CPU Architecture: "$ARCH"
+ exit 1
+ fi
+ }
+
+ NSS_FILES="libnspr4.so.0d libplds4.so.0d libplc4.so.0d libssl3.so.1d libnss3.so.1d libsmime3.so.1d libnssutil3.so.1d"
+
+ add_nss_symlinks() {
+ get_lib_dir
+ for f in $NSS_FILES
+ do
+ target=$(echo $f | sed 's/.[01]d$//')
+ if [ -f "/$LIBDIR/$target" ]; then
+ ln -snf "/$LIBDIR/$target" "/opt/slimjet/$f"
+ elif [ -f "/usr/$LIBDIR/$target" ]; then
+ ln -snf "/usr/$LIBDIR/$target" "/opt/slimjet/$f"
+ else
+ echo $f not found in "/$LIBDIR/$target" or "/usr/$LIBDIR/$target".
+ exit 1
+ fi
+ done
+ }
+
+ remove_nss_symlinks() {
+ for f in $NSS_FILES
+ do
+ rm -rf "/opt/slimjet/$f"
+ done
+ }
+
+ # Fedora 18 now has libudev.so.1. http://crbug.com/145160
+ # Same for Ubuntu 13.04. http://crbug.com/226002
+ LIBUDEV_0=libudev.so.0
+ LIBUDEV_1=libudev.so.1
+
+ add_udev_symlinks() {
+ get_lib_dir
+
+ ln -snf "/$LIBDIR/$LIBUDEV_1" "/opt/slimjet/$LIBUDEV_0"
+
+ }
+
+ remove_udev_symlinks() {
+ rm -rf "/opt/slimjet/$LIBUDEV_0"
+ }
+
+ remove_udev_symlinks
+ add_udev_symlinks
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+
+
+ # Remove icons from the system icons
+ XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`"
+ if [ ! -x "$XDG_ICON_RESOURCE" ]; then
+ echo "Error: Could not find xdg-icon-resource" >&2
+ exit 1
+ fi
+ for icon in "/opt/slimjet/product_logo_"*.png; do
+ size="${icon##*/product_logo_}"
+ "$XDG_ICON_RESOURCE" uninstall --size "${size%.png}" "flashpeak-slimjet"
+ done
+
+ UPDATE_MENUS="`which update-mime-database usr/share/mime &> /dev/null 2> /dev/null || true`"
+ if [ -x "$UPDATE_MENUS" ]; then
+ update-mime-database usr/share/mime &> /dev/null
+ fi
+
+ # Update cache of .desktop file MIME types. Non-fatal since it's just a cache.
+ update-desktop-database > /dev/null 2>&1 || true
+
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+
+
+ ARCH=$(uname -m)
+
+
+ get_lib_dir() {
+ if [ "$ARCH" = "i686" ]; then
+ LIBDIR=/usr/lib
+ elif [ "$ARCH" = "x86_64" ]; then
+ LIBDIR=/usr/lib64
+ else
+ echo Unknown CPU Architecture: "$ARCH"
+ exit 1
+ fi
+ }
+
+ NSS_FILES="libnspr4.so.0d libplds4.so.0d libplc4.so.0d libssl3.so.1d libnss3.so.1d libsmime3.so.1d libnssutil3.so.1d"
+
+ add_nss_symlinks() {
+ get_lib_dir
+ for f in $NSS_FILES
+ do
+ target=$(echo $f | sed 's/.[01]d$//')
+ if [ -f "/$LIBDIR/$target" ]; then
+ ln -snf "/$LIBDIR/$target" "/opt/slimjet/$f"
+ elif [ -f "/usr/$LIBDIR/$target" ]; then
+ ln -snf "/usr/$LIBDIR/$target" "/opt/slimjet/$f"
+ else
+ echo $f not found in "/$LIBDIR/$target" or "/usr/$LIBDIR/$target".
+ exit 1
+ fi
+ done
+ }
+
+ remove_nss_symlinks() {
+ for f in $NSS_FILES
+ do
+ rm -rf "/opt/slimjet/$f"
+ done
+ }
+
+ # Fedora 18 now has libudev.so.1. http://crbug.com/145160
+ # Same for Ubuntu 13.04. http://crbug.com/226002
+ LIBUDEV_0=libudev.so.0
+ LIBUDEV_1=libudev.so.1
+
+
+ remove_udev_symlinks() {
+ rm -rf "/opt/slimjet/$LIBUDEV_0"
+ }
+
+ remove_udev_symlinks
+ update-desktop-database -q
+}