summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dde923bebc3751c2c6ace5dcb8c0c6108ecacec0 (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
# Maintainer: Rocket Aaron <i at rocka dot me>
# Contributor: Manuel Gugger <mdgdot[at]tutanota[dot]com>

pkgname=act_runner
pkgver=0.2.11
pkgrel=1
pkgdesc="Runner for Gitea based on Gitea fork of act"
arch=('x86_64')
url="https://gitea.com/gitea/act_runner"
license=('MIT')
optdepends=('docker' 'gitea')
makedepends=('go')
backup=('etc/act_runner/act_runner.yaml')
source=("act_runner-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
        'act_runner.service'
        'act_runner.sysusers'
        'act_runner.tmpfiles')
sha256sums=('8b317700d1f3344d8664be9edb004914723a4aacc8f8b1b3719ca2260a5866b6'
            '0211027d0fe34635b1ad7bc301c941a1ae40d2c9c72eef66b552c9bc2ded8cf2'
            'f0de2d8076ff59db8f5686addc096fc29e02190bfb7b44329979b3d9e1ad292f'
            '86885e9226ffb7bc3dbb105dc2e10630c41717212c804e19413acf3974c8b347')

build() {
    cd "${pkgname}"
    # https://wiki.archlinux.org/title/Go_package_guidelines#Supporting_debug_packages
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOPATH="${srcdir}"
    export GOFLAGS="-buildmode=pie -mod=readonly -modcacherw"
    go build -ldflags "-compressdwarf=false -linkmode external -X gitea.com/gitea/act_runner/internal/pkg/ver.version=$pkgver"
    "${srcdir}/act_runner/act_runner" generate-config > "$srcdir/act_runner.yaml"
}

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