makedeb


tutanota-desktop-bin 3.104.5-0


Official Tutanota email client

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for tutanota-desktop-bin.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# Contributor: Mark Wagie (AUR) <mark dot wagie at tutanota dot com>
# Contributor: Aaron J. Graves (AUR) <linux@ajgraves.com>
pkgname=tutanota-desktop-bin
pkgver=3.104.5
pkgrel=0
pkgdesc="Official Tutanota email client"
arch=('amd64')
url="https://tutanota.com"
license=('GPL3')
depends=('libasound2' 'libgtk-3-0' 'libsecret-1-0' 'libnss3')
makedepends=('libssl1.1')
optdepends=('libappindicator3-1: StatusNotifierItem support')
source=("${pkgname%-bin}-$pkgver.AppImage::https://mail.tutanota.com/desktop/${pkgname%-bin}-linux.AppImage"
        "linux-sig-$pkgver.bin::https://mail.tutanota.com/desktop/linux-sig.bin"
        "tutao-pub-$pkgver.pem::https://github.com/tutao/tutanota/raw/${pkgname%-bin}-release-${pkgver%}/tutao-pub.pem")
provides=("${pkgname%-bin}")
conflicts=("${pkgname%-bin}" "${pkgname%-bin}-linux")
replaces=("${pkgname%-bin}-linux")
sha256sums=('339a8d39c4c82ee5af2fa74e906f97a9a00403d4b39ca13b7fc6a3b85864368a'
            'e5dd554fab64610d131e9ad50b7e0ac322b96cbb42d4a3a6a27ec27a2c2d7d97'
            '837890c39de1c52f297b44b50194869754fb4d1327112cdafd14bdc0c3db27fd')
prepare() {
  # Validate the signature against public key: https://tutanota.com/howto/#verify-desktop
  openssl dgst -sha512 -verify tutao-pub-${pkgver}.pem -signature linux-sig-${pkgver}.bin \
    "${pkgname%-bin}-$pkgver.AppImage"

  chmod +x "${pkgname%-bin}-$pkgver.AppImage"
  ./"${pkgname%-bin}-$pkgver.AppImage" --appimage-extract

  # Correct path for .desktop file
  sed -i 's|Exec=AppRun|Exec=/opt/tutanota-desktop/tutanota-desktop|g' "squashfs-root/${pkgname%-bin}.desktop"

  # Remove X-AppImage-Version
  sed -i '/AppImage/d' "squashfs-root/${pkgname%-bin}.desktop"
}

package() {
  find squashfs-root/{locales,resources,usr/share/icons}/ -type d -exec chmod 755 {} +

  install -d "$pkgdir/opt/${pkgname%-bin}/"
  cp -av squashfs-root/* "$pkgdir/opt/${pkgname%-bin}/"
  chmod 4755 "$pkgdir/opt/${pkgname%-bin}/chrome-sandbox"
  rm -rf "$pkgdir/opt/${pkgname%-bin}/usr/"
  rm "$pkgdir/opt/${pkgname%-bin}"/{"${pkgname%-bin}".desktop,AppRun}

  # Fix permisssions
  chmod 644 "$pkgdir/opt/${pkgname%-bin}"/resources/app{.asar,-update.yml}

  install -d "$pkgdir/usr/bin"
  ln -s "/opt/${pkgname%-bin}/${pkgname%-bin}" "$pkgdir/usr/bin/"

  install -Dm644 "squashfs-root/${pkgname%-bin}.desktop" -t "$pkgdir/usr/share/applications/"

  install -d "$pkgdir/usr/share/icons/"
  cp -r squashfs-root/usr/share/icons/hicolor/ "$pkgdir/usr/share/icons/"

  install -d "$pkgdir/usr/share/doc/${pkgname%-bin}"
  ln -sf /usr/share/common-licenses/GPL-3 "$pkgdir/usr/share/doc/${pkgname%-bin}/"
}