Compare commits

..

2 commits

Author SHA1 Message Date
095e04b129
upgpkg: distrobuilder-create 0.2-1
* New upstream release.
* Ensure /etc/sudoers.d has the correct permissions.
2021-09-13 07:14:21 +00:00
be288da091
upgpkg: drone
Convert PKGBUILD to a split package that provides both versions of
Drone (Enterprise & Community).
2021-09-13 07:11:24 +00:00
2 changed files with 55 additions and 16 deletions

View file

@ -1,7 +1,7 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org> # Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=distrobuilder-create pkgname=distrobuilder-create
pkgver=0.1 pkgver=0.2
pkgrel=1 pkgrel=1
pkgdesc="Automatically create images with distrobuilder" pkgdesc="Automatically create images with distrobuilder"
arch=('any') arch=('any')
@ -10,8 +10,8 @@ license=('GPL')
depends=('lxd' 'distrobuilder' 'sudo' 'systemd') depends=('lxd' 'distrobuilder' 'sudo' 'systemd')
checkdepends=('shfmt' 'shellcheck') checkdepends=('shfmt' 'shellcheck')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz") source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('687c88453d09ab7d76e3f478ff32f71db85b17652598644f3557034d0ffa82dd40a59069012a0849aa4ccdf34c882fe7df0ab22063e8ceb79a0488d58fa15196') sha512sums=('8d150c932d8a54130717d04fe8b1ab16bc5acc4b2972d8dec3ec6d5586bbcbd8277959a24af61671675f3592355e9b8a0b6241740d6d155e98cc4fd9ccb1ce20')
b2sums=('729bece0188ac50b8aeac0111a2da9b6256af254522726151ddd96600c351cc96dc18c329a90b84489c211da4c07bb90209d584dde624ec9b098ae3e0e2b647a') b2sums=('d87245965a362536ef3dcd036646c7eb638f631addaf99e21bbbb5bea2c30c29af8f1d81494cc49758d8cc294797b4e5ebd777c424a53ca2b6700a6a87ee9239')
check() { check() {
cd "$pkgname" cd "$pkgname"
@ -30,6 +30,7 @@ package() {
install -vDm755 distrobuilder-create.sh "$pkgdir/usr/bin/$pkgname" install -vDm755 distrobuilder-create.sh "$pkgdir/usr/bin/$pkgname"
# drop-in sudoers snippet # drop-in sudoers snippet
install -vd 0750 "$pkgdir/etc/sudoers.d"
install -vDm440 sudoers.conf "$pkgdir/etc/sudoers.d/$pkgname" install -vDm440 sudoers.conf "$pkgdir/etc/sudoers.d/$pkgname"
# systemd integration # systemd integration

View file

@ -1,44 +1,52 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org> # Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Khorne <khorne AT khorne DOT me> # Contributor: Khorne <khorne AT khorne DOT me>
pkgname=drone pkgbase=drone
pkgname=(
'drone'
'drone-oss'
)
pkgver=2.3.1 pkgver=2.3.1
pkgrel=2 pkgrel=2
pkgdesc="Continuous Delivery platform built on container technology" pkgdesc="Continuous Delivery platform built on container technology"
arch=('x86_64') arch=('x86_64')
url="https://drone.io" url="https://drone.io"
license=('custom:Drone-Non-Commercial')
# ref: https://discourse.drone.io/t/exec-runner-404-error-on-ping/7922
makedepends=('go' 'git') makedepends=('go' 'git')
source=( source=(
"$pkgname-$pkgver.tar.gz::https://github.com/drone/drone/archive/v$pkgver.tar.gz" "$pkgbase-$pkgver.tar.gz::https://github.com/drone/drone/archive/v$pkgver.tar.gz"
'https://patch-diff.githubusercontent.com/raw/drone/drone/pull/3141.patch'
'systemd.service' 'systemd.service'
'tmpfiles.conf' 'tmpfiles.conf'
'sysusers.conf' 'sysusers.conf'
) )
b2sums=('623b2d1ca3d68c9169b0f4bd35678e6a459d9db054338bb3a604cb050ad7b9eacdf997c169ea12ae0afbaa0af42621e86ada2a94f488584fb8c63406e2ce121d' b2sums=('623b2d1ca3d68c9169b0f4bd35678e6a459d9db054338bb3a604cb050ad7b9eacdf997c169ea12ae0afbaa0af42621e86ada2a94f488584fb8c63406e2ce121d'
'd529b69af0494753f9fe2e4dfcda36176d85fad1574943a575844ab81c0e5177f376174924051340af8975c98b771fa6ae0ff91a3826570f202c5ef01b5b9ba3'
'3d3e2ad52fe1ec9f1c803540de5baa01ed0cda3b720551e6594223b5f0a836bc69448b30b6e1408d13e2451e6d25666c2bc7b188a7a1075afec4ef70a6f0b48c' '3d3e2ad52fe1ec9f1c803540de5baa01ed0cda3b720551e6594223b5f0a836bc69448b30b6e1408d13e2451e6d25666c2bc7b188a7a1075afec4ef70a6f0b48c'
'9c1bf8e4a382190f2d1bd560ef5c4a9fadad8c38dcd3cf3b79af42f6d0c16de533ba2d5f6cf676003e4ca6b745833e5e100baf4328111cf540ac5f43f67c6145' '9c1bf8e4a382190f2d1bd560ef5c4a9fadad8c38dcd3cf3b79af42f6d0c16de533ba2d5f6cf676003e4ca6b745833e5e100baf4328111cf540ac5f43f67c6145'
'18e5c4ea19348479dc3408bd2546f324f0908acc759c7c79c350006c6c5e6db02cd388a9aa9bd3d4f6b4b1f2efcf6aa7f7e67eac43f8d55566afe341b7ec142e') '18e5c4ea19348479dc3408bd2546f324f0908acc759c7c79c350006c6c5e6db02cd388a9aa9bd3d4f6b4b1f2efcf6aa7f7e67eac43f8d55566afe341b7ec142e')
prepare() { prepare() {
cd "$pkgname-$pkgver" cd "$pkgbase-$pkgver"
# apply patch that breaks OSS compilation
patch --strip=1 --input="$srcdir/3141.patch"
# create directory for build output # create directory for build output
mkdir build mkdir build build-oss
# download dependencies # download dependencies
go mod vendor go mod vendor
} }
build() { build() {
cd "$pkgname-$pkgver" cd "$pkgbase-$pkgver"
# set Go flags # set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}" export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}"
# enterprise version
go build -v \ go build -v \
-trimpath \ -trimpath \
-buildmode=pie \ -buildmode=pie \
@ -47,28 +55,58 @@ build() {
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \ -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-o build \ -o build \
./cmd/... ./cmd/...
# community version
go build -v \
-trimpath \
-buildmode=pie \
-mod=vendor \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-tags "oss nolimit" \
-o build-oss \
./cmd/...
} }
check() { check() {
cd "$pkgname-$pkgver" cd "$pkgbase-$pkgver"
go test -v ./... go test -v ./...
} }
package() { 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')
# systemd integration # systemd integration
install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service" install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
cd "$pkgname-$pkgver" cd "$pkgbase-$pkgver"
# binary # binary
install -vDm755 -t "$pkgdir/usr/bin" build/* install -vDm755 -t "$pkgdir/usr/bin" build/*
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" .github/readme.md *.md
# license # license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
} }
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/*
}