summaryrefslogtreecommitdiff
path: root/community/syncthing/PKGBUILD
blob: 9830506ccadca85133d9019db312ff0da33bd03d (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
# $Id:
# Maintainer : Martin Wimpress <code@flexion.org>
# Contributor: Sauyon Lee <sauyonl@sauyon.com>
# Contributor: Kevin MacMartin <prurigro@gmail.com>
# Contributor: korjjj <korjjj+aur@gmail.com>

_pkgstamp=$(date +%s)
pkgname=syncthing
pkgver=0.8.16
pkgrel=1
pkgdesc="Open Source Continuous Replication / Cluster Synchronization Thing"
url="http://syncthing.net/"
license=('MIT')
arch=('i686' 'x86_64')
depends=('glibc')
makedepends=('go' 'godep' 'inetutils' 'sed')
source=("https://github.com/calmh/${pkgname}/archive/v${pkgver}.tar.gz"
        "syncthing@.service"
        "syncthing.1")
sha1sums=('62ed3ac4f01546bba743e223dd98a2af8f67ca2b'
          '204cad3823306c793a14a17a23220e26199160d4'
          '17be8b3f99c577e325765abc251f597e204d7711')
install=${pkgname}.install

prepare() {
    cd "${srcdir}"
    mkdir -p "src/github.com/calmh"
    mv "${pkgname}-${pkgver}" "src/github.com/calmh/${pkgname}"
    # Patch the build variables that require a git clone
    sed -i -e "s/^version=.*/version=\"${pkgver}\"/" "${srcdir}/src/github.com/calmh/${pkgname}/build.sh"
    sed -i -e "s/^date=.*/date=\"${_pkgstamp}\"/" "${srcdir}/src/github.com/calmh/${pkgname}/build.sh"
}

build() {
    export GOPATH="${srcdir}"
    cd "${srcdir}/src/github.com/calmh/${pkgname}"
    ./build.sh
}

check() {
    export GOPATH="${srcdir}"
    cd "${srcdir}/src/github.com/calmh/${pkgname}"
    ./build.sh test
}

package() {
    cd "${srcdir}/src/github.com/calmh/${pkgname}"
    install -D -m 755 syncthing "${pkgdir}/usr/bin/syncthing"
    install -D -m 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -D -m 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
    install -D -m 644 "${srcdir}/${pkgname}@.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}@.service"
    install -D -m 644 "${srcdir}/${pkgname}.1" "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}