arch-pkgs/drone/PKGBUILD
George Rawlinson 38f1fa10ab
upgpkg: drone
* Fix systemd sysusers & service file.
* Fix functionality/licensing.
* Add check() function.
2021-09-08 00:59:17 +00:00

73 lines
2 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Khorne <khorne AT khorne DOT me>
pkgname=drone
pkgver=2.2.0
pkgrel=2
pkgdesc="Continuous Delivery platform built on container technology"
arch=('x86_64')
url="https://drone.io"
license=('custom:Drone-Non-Commercial')
makedepends=('go' 'git')
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/drone/drone/archive/v$pkgver.tar.gz"
'systemd.service'
'tmpfiles.conf'
'sysusers.conf'
)
b2sums=('18da9c94f6c519329547898e3f873cd1bef4bd136d5a37eb26c679eb22b0722443221066b097d7aba50dd8eff6f40019af2fe3dfe71142d4d25b7267a36079ac'
'38cfe24fcc9738a0332626eb0ea0698cdb3aa605f633a8141d0dee8ad4ed06fab1817a096784f2fbdd9be54d088f422c3ecb3b1b202978c000205224436b1bda'
'9c1bf8e4a382190f2d1bd560ef5c4a9fadad8c38dcd3cf3b79af42f6d0c16de533ba2d5f6cf676003e4ca6b745833e5e100baf4328111cf540ac5f43f67c6145'
'18e5c4ea19348479dc3408bd2546f324f0908acc759c7c79c350006c6c5e6db02cd388a9aa9bd3d4f6b4b1f2efcf6aa7f7e67eac43f8d55566afe341b7ec142e')
prepare() {
cd "$pkgname-$pkgver"
# create directory for build output
mkdir build
# download dependencies
go mod vendor
}
build() {
cd "$pkgname-$pkgver"
# set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
go build -v \
-trimpath \
-buildmode=pie \
-mod=vendor \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-o build \
./cmd/...
}
check() {
cd "$pkgname-$pkgver"
go test -v ./...
}
package() {
# systemd integration
install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
cd "$pkgname-$pkgver"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/*
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" .github/readme.md *.md
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
}