Username: Password: Remember me
#Note: this PKGBUILD is made to always install the latest version of iridium
 
pkgname=iridium-browser
pkgver=2019.04.73
pkgrel=1
pkgdesc="A web browser securing your privacy (latest bin release)"
arch=('x86_64')
url="https://iridiumbrowser.de"
screenshot="https://i.imgur.com/euAS2xi.png"
license=('BSD')
depends=('alsa-lib' 'libcups' 'libxss' 'libxtst' 'nss' 'kdialog' 'kwallet' 'plasma-browser-integration' 'gtk3' 'curl' 'sed' 'grep' 'coreutils' 'libva')
optdepends=('breeze-gtk' 'kde-gtk-config')
# kdialog: to have kde save/load dialogs
# plasma-browser-integration: for https://chrome.google.com/webstore/detail/plasma-integration/cimiefiiaegbelhefglklhhakcgmhkai
# gtk3,breeze,kde-gtk-config: to use the systems style, font and icon settings if style is set to gtk.
# kwallet: to use kwallet instead of gnome-keyring.
# grep,sed,curl,coreutils,ping: for update checking see launch script below(should be already installed on any system)!
makedepends=('binutils' 'gawk')
options=('!emptydirs' '!strip')
conflicts=("${pkgname}")
provides=("${pkgname}")
 
pkgver() {
  cd $srcdir
_ver=$(grep 'Version' control|sed 's/[^0-9.]*//;s/-.*$//')
  printf "$_ver"
}
 
prepare() {
  cd $srcdir
_dl=$(curl -L https://downloads.iridiumbrowser.de/deb/dists/stable/main/binary-amd64/Packages|awk '/Package: iridium-browser/' RS="\n\n" ORS="\n\n"|grep Filename|cut -d' ' -f2)
  curl -L https://downloads.iridiumbrowser.de/deb/${_dl} > ${srcdir}/$pkgname.amd64.deb
  ar p $pkgname.amd64.deb control.tar.gz|tar zx
}
 
package() {
  ar p ${srcdir}/$pkgname.amd64.deb data.tar.xz|tar -xJp -C "$pkgdir/"
  rm -rf "$pkgdir"/usr/share/lintian "$pkgdir"/usr/share/gnome-control-center
  mv $pkgdir/usr/bin/$pkgname $pkgdir/usr/bin/$pkgname-latest
  cat <<\EOF> $pkgdir/usr/bin/$pkgname
#!/bin/sh
### Make sure we always have the latest version installed! (adds curl, sed, grep and cut to depends)
_pkgname=iridium-browser
_current=$(curl -L https://downloads.iridiumbrowser.de/deb/dists/stable/main/binary-amd64/Packages|grep Version|cut -d' ' -f2|tail -1|sed 's/-.*$//')
 
### check for internet connection and if online check version
if ping -q -w1 -c1 google.com &>/dev/null; then
  printf "connected, checking for new version of ${_pkgname}...\n"
_installed=$(pacman -Qi ${_pkgname}|grep Version|cut -d':' -f2|sed 's/-*.$//;s/[^0-9.]*//g')
_highest=$(printf "$_current\n$_installed"|sort -V|tail -1)
    if [ "$_highest" != "$_installed" ]; then
        kdialog --error "Your version of ${_pkgname} is out-of-date, please reinstall the CCR package to update! \n\nchaser install ${_pkgname}"
    fi
else
    printf "disconnected, could not check for new version of ${_pkgname}\n"
fi
 
### Link to the plasma extension after first launch so people can install it.
if [ -d $HOME/.config/iridium ]; then
    exec /usr/bin/iridium-browser-latest "${@}"
else
    exec /usr/bin/iridium-browser-latest https://chrome.google.com/webstore/detail/plasma-integration/cimiefiiaegbelhefglklhhakcgmhkai "${@}"
fi
EOF
 chmod +x $pkgdir/usr/bin/$pkgname
}