aur/drone/PKGBUILD

66 lines
1.5 KiB
Text
Raw Normal View History

2021-05-19 09:31:28 +02:00
# Maintainer: Sl@ny <webmaster [at] slany [dot] work>
pkgname=drone
2022-10-28 22:25:15 +00:00
pkgver=2.15.0
2022-09-21 22:07:49 +00:00
pkgrel=1
2021-05-19 09:31:28 +02:00
pkgdesc="Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant"
arch=('x86_64')
url="https://drone.io"
2022-07-14 09:51:09 +02:00
license=('custom')
makedepends=('go' 'git')
options=('!lto')
2021-05-19 09:31:28 +02:00
backup=('etc/drone/server')
source=(git+https://github.com/drone/drone.git#tag=v$pkgver
2022-07-14 09:51:09 +02:00
'drone.service'
'server.conf')
2021-05-19 09:31:28 +02:00
sha256sums=('SKIP'
2022-09-21 22:07:49 +00:00
'3cd219b1c5611b9ff4211d4837dff11228d9a491cd41d21f4c60af77c8c21d5c'
'2b8957cd6b9f9ee6e8d831f58b0ef3fac2170a56f6259884ec7d30c3ba38c73a')
2021-05-19 09:31:28 +02:00
2022-07-14 09:51:09 +02:00
prepare() {
cd "$pkgname"
mkdir build
go mod download
2021-05-19 09:31:28 +02:00
}
2022-07-14 09:51:09 +02:00
build() {
cd "$pkgname"
2021-05-19 09:31:28 +02:00
2022-07-14 09:51:09 +02:00
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
local COMMON_FLAGS=(
-trimpath
-buildmode=pie
-mod=readonly
-modcacherw
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
)
2021-05-19 09:31:28 +02:00
2022-07-14 09:51:09 +02:00
go build \
"${COMMON_FLAGS[@]}" \
-tags "nolimit" \
-o build \
./cmd/...
}
2021-05-19 09:31:28 +02:00
2022-07-14 09:51:09 +02:00
check() {
cd "$pkgname"
go test -v ./...
}
package() {
2021-05-19 09:31:28 +02:00
# service
install -Dm644 drone.service "$pkgdir/usr/lib/systemd/system/drone.service"
# config
install -Dm644 server.conf "$pkgdir/etc/drone/server"
2022-07-14 09:51:09 +02:00
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/*
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
2021-05-19 09:31:28 +02:00
}