summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9885c31959ff607c60f30cccc7da5a1fe49cdf85 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: Peltoche <pierre.peltier@protonmail.com>
pkgname=duckcloud
pkgver=23.11.1
pkgrel=1
epoch=1
pkgdesc="A cloud for your family"
arch=(x86_64 i686 armv6h armv7h aarch64)
url=https://duckcloud.co
license=(AGPL3)
depends=(glibc)
makedepends=(go openssl)
optdepends=()
backup=(etc/duckcloud/password.cred)
install=duckcloud.install

source=(https://github.com/theduckcompany/duckcloud/archive/refs/tags/${pkgver}.tar.gz
      ${pkgname}.service
      ${pkgname}.sysusers
      ${pkgname}.tmpfiles
      LICENSE)

sha256sums=('e408dbd31e4375bd77bbeb5979e068cc71e1e5cd15961902e6d7774f8eb135dc'
            'b35676f9d721521089676ccf1a287fc7369cce0c7dd70991deeea0e8c3d0c6af'
            'ca526231ca260be83df4dfb5cc3d7400e82a35e3f164b9799c63be9d4b1bcead'
            '8ee8d3bf748a986fdd040e56c208742045df91837de3e250d5148e0b3fd65692'
            '8486a10c4393cee1c25392769ddd3b2d6c242d6ec7928e1414efff7dfb2f07ef')

prepare() {
  cd ${pkgname}-${pkgver}
  go mod vendor
}

build() {
  cd ${pkgname}-${pkgver}
  export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
    go build -v \
    -ldflags "-linkmode external \
    -X github.com/theduckcompany/duckcloud/internal/tools/buildinfosj.Version=${pkgver} \
    -X github.com/theduckcompany/duckcloud/internal/tools/buildinfos.BuildTime=$(date --utc -Iseconds)" \
    -o ${pkgname} ./cmd/duckcloud
}

package() {
  install -Dm644 "${pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system/"
    install -Dm644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
    install -Dm644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
    install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    cd "${pkgname}-${pkgver}"
    install -Dm755 "${pkgname}" -t "${pkgdir}/usr/bin/"
}