summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f3374b8c90129ec7e06a3fca13e0972705edd96b (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
# Maintainer: Jens Jäschke <arch [at] jensjaeschke [dot] de>

pkgname=kopia
pkgdesc='A cross-platform backup-tool with encryption, deduplication, compression and cloud support.'
pkgver=0.10.6
pkgrel=1
arch=('x86_64')
url='https://kopia.io'
license=('APACHE')
depends=('glibc')
makedepends=('go>=1.17')
#makedepends=('go>=1.15', 'git') # git is needed if we switch to signed git commits/tags in the future
#source=("$pkgname-$pkgver::git+https://github.com/kopia/kopia.git#commit=$(git rev-list -n 1 v$pkgver)?signed") # use git commit, if those are signed by a proper key in the future
#source=("$pkgname-$pkgver::git+https://github.com/kopia/kopia.git#tag=v$pkgver?signed") # use git tag, if those are signed by a proper key in the future
source=("$pkgname-$pkgver.tar.gz::https://github.com/kopia/kopia/archive/refs/tags/v$pkgver.tar.gz") # use unsigned tarball for now.
sha256sums=('07df866ff4a2662f503a1348fe02bb62e6cf195260217d7e1234b03ff7b27797')
#checksums calculated by packager, no checksums available from upstream for source tarball.

build() {
        cd $srcdir/$pkgname-$pkgver
        export CGO_CPPFLAGS="${CPPFLAGS}"
        export CGO_CFLAGS="${CFLAGS}"
        export CGO_CXXFLAGS="${CXXFLAGS}"
        export CGO_LDFLAGS="${LDFLAGS}"
        export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
        echo "$CGO_CFLAGS \n $CGO_CPPFLAGS \n $CGO_CXXFLAGS \n $CGO_LDFLAGS"
        #make html-ui
        #go build -tags embedhtml
        go build -ldflags "-X github.com/kopia/kopia/repo.BuildVersion=$pkgver-$pkgrel -X github.com/kopia/kopia/repo.BuildInfo=unofficial -X github.com/kopia/kopia/repo.BuildGitHubRepo=ARCH_USER_REPOSITORY"
}

package() {
    mkdir -p "$pkgdir/usr/bin/"
    cp "$srcdir/$pkgname-$pkgver/kopia" "$pkgdir/usr/bin/"
    chmod +x "$pkgdir/usr/bin/kopia"
}