65 lines
1.5 KiB
Bash
65 lines
1.5 KiB
Bash
# Maintainer: Sl@ny <webmaster [at] slany [dot] work>
|
|
pkgname=drone
|
|
pkgver=2.15.0
|
|
pkgrel=1
|
|
pkgdesc="Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant"
|
|
arch=('x86_64')
|
|
url="https://drone.io"
|
|
license=('custom')
|
|
makedepends=('go' 'git')
|
|
options=('!lto')
|
|
backup=('etc/drone/server')
|
|
source=(git+https://github.com/drone/drone.git#tag=v$pkgver
|
|
'drone.service'
|
|
'server.conf')
|
|
sha256sums=('SKIP'
|
|
'3cd219b1c5611b9ff4211d4837dff11228d9a491cd41d21f4c60af77c8c21d5c'
|
|
'2b8957cd6b9f9ee6e8d831f58b0ef3fac2170a56f6259884ec7d30c3ba38c73a')
|
|
|
|
prepare() {
|
|
cd "$pkgname"
|
|
|
|
mkdir build
|
|
|
|
go mod download
|
|
}
|
|
|
|
build() {
|
|
cd "$pkgname"
|
|
|
|
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}\""
|
|
)
|
|
|
|
go build \
|
|
"${COMMON_FLAGS[@]}" \
|
|
-tags "nolimit" \
|
|
-o build \
|
|
./cmd/...
|
|
}
|
|
|
|
check() {
|
|
cd "$pkgname"
|
|
go test -v ./...
|
|
}
|
|
|
|
package() {
|
|
# service
|
|
install -Dm644 drone.service "$pkgdir/usr/lib/systemd/system/drone.service"
|
|
# config
|
|
install -Dm644 server.conf "$pkgdir/etc/drone/server"
|
|
|
|
cd "$pkgname"
|
|
|
|
# binary
|
|
install -vDm755 -t "$pkgdir/usr/bin" build/*
|
|
# license
|
|
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
|
|
}
|