summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e97d8589fbcdbb2adeb031465dac8d0e6c467536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pkgname=zedle
pkgver=2025.1.14
pkgrel=2
pkgdesc="A graphical interface to create, read and modify encrypted Zed! containers."
arch=('x86_64')
url="https://www.primx.eu"
license=('custom')
depends=('libxslt' 'libxml2-legacy' 'qt5-base' 'hicolor-icon-theme' 'icu')
makedepends=('curl' 'unzip' 'coreutils')
source=('https://client.primx.eu/Legal/Terms')
sha256sums=('c4c7a856f63bf1849faa931919f70ec7649599a55c113b01819258b01dbd09ce')

prepare() {
    # No deeplink available, need to submit the form on the website
    curl 'https://client.primx.eu/PublicSoftware/zedlimitededition/' -X POST \
        --data-raw "Version=$pkgver-Linux+Ubuntu-x64" --output "${pkgname^^}.zip"
    unzip -p "${pkgname^^}.zip" "Ubuntu 24.04/${pkgname^^}-$pkgver.Ubuntu24.04.amd64.deb" > "${pkgname^^}.deb"
    sha256sum "${pkgname^^}.deb"
    rm "${pkgname^^}.zip"
}

package() {
    ar x "${pkgname^^}.deb"
    tar -xvf data.tar.zst -C "$pkgdir"

    # Change directory permissions from 775 to 755
    chmod 755 -R "$pkgdir/usr"

    install -dm1777 "$pkgdir/etc/primx/accessfiles"
    install -dm1777 "$pkgdir/var/log/zed"

    touch "$pkgdir/etc/primx/users.registry"
    chmod 666 "$pkgdir/etc/primx/users.registry"

    install -Dm644 "$srcdir/Terms" -t "$pkgdir/usr/share/licenses/$pkgname/Terms.html"
}

check() {
    # SHA verification needs to be done manually because the file is downloaded manually as well
    SHA_SUM=feeb57991df2bccff818cf6dfafa4a679dd51ca8ba983ea9b79964a6a82c4283
    echo "$SHA_SUM ${pkgname^^}.deb" | sha256sum --check --status
}