# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=gitea pkgver=1.9.4 pkgrel=0 pkgdesc="A self-hosted Git service written in Go" url="https://gitea.io" arch="all" license="MIT" options="chmod-clean" [ "$CARCH" = x86 ] && options="!check" # git-lfs is currently not available depends="git" makedepends="go libcap" checkdepends="bash git-lfs gnupg openssh openssh-keygen sqlite" install="$pkgname.pre-install" pkgusers="gitea" pkggroups="www-data" subpackages="$pkgname-openrc" source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.ini " builddir="$srcdir/src/code.gitea.io/$pkgname" case "$CARCH" in armhf) options="!check" ;; # FIXME esac prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ cd "$builddir" default_prepare } build() { export GOPATH="$srcdir" export TAGS="tidb sqlite sqlite_unlock_notify" export GITEA_VERSION="$pkgver" unset LDFLAGS make build } check() { ## "make test" - modified (exclude broken tests) #https://github.com/go-gitea/gitea/issues/8089 ## 'code.gitea.io/gitea/modules/migrations': github hase rate limits! 403 API PACKAGES=$(go list ./... | grep -v /vendor/ | \ grep -v 'code.gitea.io/gitea/modules/migrations' | \ grep -v 'code.gitea.io/gitea/integrations' | \ grep -v '^code.gitea.io/gitea/models$' | \ grep -v 'code.gitea.io/gitea/modules/git' | \ grep -v 'code.gitea.io/gitea/modules/repofiles') GO111MODULE=on go test -mod=vendor -tags='sqlite sqlite_unlock_notify' $PACKAGES timeout -s ABRT 20m make test-sqlite } package() { for dir in $pkgname $pkgname/git $pkgname/data $pkgname/db $pkgname/custom; do install -d -m 750 -o gitea -g www-data \ "$pkgdir"/var/lib/$dir done install -d -m 755 -o gitea -g www-data "$pkgdir"/var/log/$pkgname install -D -m 755 $pkgname "$pkgdir"/usr/bin/$pkgname # Allow non root to bind to port 80. setcap cap_net_bind_service=+ep \ "$pkgdir"/usr/bin/$pkgname install -D -m 644 -o gitea -g www-data "$srcdir"/${pkgname}.ini \ "$pkgdir"/etc/$pkgname/app.ini chown gitea:www-data "$pkgdir"/etc/$pkgname install -d -m 755 "$pkgdir"/usr/share/webapps/$pkgname mv options public templates "$pkgdir"/usr/share/webapps/$pkgname/ install -D -m 755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname } sha512sums="a885567ffcc21ef821348be0b698b5f101bfc46b746603679441bee4c6abe34ea062bd0a2d5fb5c029ce26caa3b70a51c6d9088fdccebb44be74f1e523faf711 gitea-1.9.4.tar.gz 2497e6f2a18e3ceb65352cd220eab2c1c0893d0e731600462a60397de2b70d7c1de7db2af2769b25fe708b0822c811bb20dc797b59b9dd93efb376bea1c35796 gitea.initd 27a202006d6e8d4146659f6356eaa99437f9f596dd369e9430d64b859bc6a1ad16091eef09232aa385fe1bf8ca94bbdf31b94975068220ad10338cded384f726 gitea.ini"