makedeb


tutanota-desktop-bin 220.240411.0-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=220.240411.0
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=('openssl')
source=("${pkgname%-bin}-$pkgver.AppImage::https://app.tuta.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}")
sha256sums=('229fce37cb2d02db8d07a8b02b5a4a193dca8dc2ab3c40a4f3f45328c2107731'
            '991f517e6776d1a365c2871996d3b5e067f7b99ee7849ac2836b54301318aa45'
            '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 -s /usr/share/common-licenses/GPL-3 "$pkgdir/usr/share/doc/${pkgname%-bin}/"
}