2021-08-25 01:14:27 +00:00
|
|
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
|
|
|
|
# Contributor: Khorne <khorne AT khorne DOT me>
|
|
|
|
|
2021-09-13 07:11:21 +00:00
|
|
|
pkgbase=drone
|
|
|
|
pkgname=(
|
|
|
|
'drone'
|
|
|
|
'drone-oss'
|
|
|
|
)
|
2021-09-23 22:09:57 +00:00
|
|
|
pkgver=2.4.0
|
2021-09-27 06:47:48 +00:00
|
|
|
pkgrel=2
|
2021-09-07 01:19:48 +00:00
|
|
|
pkgdesc="Continuous Delivery platform built on container technology"
|
2021-08-25 01:14:27 +00:00
|
|
|
arch=('x86_64')
|
|
|
|
url="https://drone.io"
|
|
|
|
makedepends=('go' 'git')
|
|
|
|
source=(
|
2021-09-13 07:11:21 +00:00
|
|
|
"$pkgbase-$pkgver.tar.gz::https://github.com/drone/drone/archive/v$pkgver.tar.gz"
|
2021-08-25 01:14:27 +00:00
|
|
|
'systemd.service'
|
|
|
|
'tmpfiles.conf'
|
|
|
|
'sysusers.conf'
|
|
|
|
)
|
2021-09-23 22:09:57 +00:00
|
|
|
sha512sums=('91d5bace2bea4aeaa97b49f16153261d6dbd986bff7239367a84a68a7327d4a0d0d0015cf78b2b1e42ccc8fb69516b924c4aff8b0e11d1dac96443cdbe90ae7f'
|
2021-09-27 06:47:48 +00:00
|
|
|
'51f274d1edf1f8ee127cb84ca420c32de1e5c0a8a2363b4221034be430a1c93a7517deb997fddade4988b90735b2fbe50ce450058510e1dd64944ee18a96af49'
|
2021-09-23 22:09:57 +00:00
|
|
|
'dfdc522b0e17f6b68d86f6599020bc75328de84aa1a393c53a0edc5ed229fb6ef99a0b544eebca6f9eee1b9f2ce04906bcca105792bccf2e49cdd51f10026886'
|
|
|
|
'9488ba861487ecaf96e6b39afc3aeabd0951b9c0ee552cdb552d12f08f73cdcf2c57e5a322139f34e0aa5b2c9b2f5751f08bf66dca2bd8dd041b60b96e41c710')
|
|
|
|
b2sums=('7095ecbb3ece029b1b63ae1297f2a257fe9cc5e48de1eb596a6f25efc4e77e371b712f7647fe5ef44d96183cb0ca4e2fe83064995fd942eefe8c2897f938652a'
|
2021-09-27 06:47:48 +00:00
|
|
|
'e7bec2be6fc60c36e8c880dcedffde8ec7d0c1b5cbe0fef07526221b48820314f69a8282f341478a89711216b91b58114c0e7e1270d941bc7bd175f952837452'
|
2021-08-25 01:14:27 +00:00
|
|
|
'9c1bf8e4a382190f2d1bd560ef5c4a9fadad8c38dcd3cf3b79af42f6d0c16de533ba2d5f6cf676003e4ca6b745833e5e100baf4328111cf540ac5f43f67c6145'
|
2021-09-07 01:19:48 +00:00
|
|
|
'18e5c4ea19348479dc3408bd2546f324f0908acc759c7c79c350006c6c5e6db02cd388a9aa9bd3d4f6b4b1f2efcf6aa7f7e67eac43f8d55566afe341b7ec142e')
|
2021-08-25 01:14:27 +00:00
|
|
|
|
|
|
|
prepare() {
|
2021-09-13 07:11:21 +00:00
|
|
|
cd "$pkgbase-$pkgver"
|
|
|
|
|
2021-08-25 01:14:27 +00:00
|
|
|
# create directory for build output
|
2021-09-13 07:11:21 +00:00
|
|
|
mkdir build build-oss
|
2021-08-25 01:14:27 +00:00
|
|
|
|
|
|
|
# download dependencies
|
|
|
|
go mod vendor
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2021-09-13 07:11:21 +00:00
|
|
|
cd "$pkgbase-$pkgver"
|
2021-08-25 01:14:27 +00:00
|
|
|
|
|
|
|
# set Go flags
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
|
2021-09-13 07:11:21 +00:00
|
|
|
# enterprise version
|
2021-08-25 01:14:27 +00:00
|
|
|
go build -v \
|
|
|
|
-trimpath \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=vendor \
|
|
|
|
-modcacherw \
|
|
|
|
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
|
2021-09-07 01:19:48 +00:00
|
|
|
-o build \
|
|
|
|
./cmd/...
|
2021-09-13 07:11:21 +00:00
|
|
|
|
|
|
|
# community version
|
|
|
|
go build -v \
|
|
|
|
-trimpath \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=vendor \
|
|
|
|
-modcacherw \
|
|
|
|
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
|
|
|
|
-tags "oss nolimit" \
|
|
|
|
-o build-oss \
|
|
|
|
./cmd/...
|
2021-09-07 01:19:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2021-09-13 07:11:21 +00:00
|
|
|
cd "$pkgbase-$pkgver"
|
2021-09-07 01:19:48 +00:00
|
|
|
go test -v ./...
|
2021-08-25 01:14:27 +00:00
|
|
|
}
|
|
|
|
|
2021-09-13 07:11:21 +00:00
|
|
|
package_drone() {
|
|
|
|
pkgdesc+=" (Enterprise Edition)"
|
|
|
|
license=('custom:Drone-Non-Commercial')
|
|
|
|
# ref: https://discourse.drone.io/t/exec-runner-404-error-on-ping/7922
|
|
|
|
depends=('glibc' 'docker')
|
|
|
|
conflicts=('drone-oss')
|
|
|
|
|
2021-08-25 01:14:27 +00:00
|
|
|
# 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"
|
|
|
|
|
2021-09-13 07:11:21 +00:00
|
|
|
cd "$pkgbase-$pkgver"
|
2021-08-25 01:14:27 +00:00
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 -t "$pkgdir/usr/bin" build/*
|
|
|
|
|
|
|
|
# license
|
|
|
|
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
|
|
|
|
}
|
|
|
|
|
2021-09-13 07:11:21 +00:00
|
|
|
package_drone-oss() {
|
|
|
|
pkgdesc+=" (Community Edition)"
|
|
|
|
license=('Apache')
|
|
|
|
depends=('glibc')
|
|
|
|
conflicts=('drone')
|
|
|
|
|
|
|
|
# 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 "$pkgbase-$pkgver"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 -t "$pkgdir/usr/bin" build-oss/*
|
|
|
|
}
|