makedeb


tutanota-desktop-bin 259.241213.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="259.241213.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')
#wget -c -O "tutanota-desktop-250.241025.0.AppImage"  "https://app.tuta.com/desktop/tutanota-desktop-linux.AppImage"
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}")
#wget  -o /dev/null -O- https://github.com/tutao/tutanota/releases/tag/tutanota-desktop-release-250.241025.0 | grep -A 1 'tutanota-desktop-linux.AppImage:</strong>' | grep -v tutanota-desktop-linux.AppImage | sed 's!</p>!!'
sha256sums=('3b99130d3399c47fc7eb239188c1079f9e40a2e39a4ba8ce0123d9fa250599f5'
            '4fa35df2b5ef1b9f34fa5021bd86dd36b2978de76bc89154ee292b864e8e2755'
            '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}/"
}