# Contributor: Carlo Landmeter # Maintainer: 7heo <7heo@mail.com> pkgname=gitea pkgver=1.0.1 pkgrel=2 pkgdesc="A self-hosted Git service written in Go" url="http://gitea.io/" arch="all" license="MIT" depends="git" makedepends="govendor go-tools perl libcap" install="$pkgname.pre-install" pkgusers="gitea" pkggroups="www-data" source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.confd $pkgname.ini aarch64-go-log-fix.patch" builddir="$srcdir/src/code.gitea.io/$pkgname" prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 cd "$builddir" export GOPATH="$srcdir" govendor sync -v || return 1 default_prepare } build() { cd "$builddir" export GOPATH="$srcdir" go build -v -tags "tidb sqlite" -o bin/$pkgname || return 1 } package() { cd "$builddir" install -d -m 0755 \ "$pkgdir"/usr/share/webapps/$pkgname || return 1 # TODO: Is it really necessary to be world-readable?! install -d -m 0755 -o gitea -g www-data \ "$pkgdir"/var/lib/$pkgname \ "$pkgdir"/var/lib/$pkgname/git \ "$pkgdir"/var/lib/$pkgname/db \ "$pkgdir"/var/lib/$pkgname/avatars \ "$pkgdir"/var/lib/$pkgname/attachements \ "$pkgdir"/var/cache/$pkgname/sessions \ "$pkgdir"/var/log/$pkgname \ "$pkgdir"/etc/$pkgname/conf || return 1 install -D -m 0755 bin/$pkgname \ "$pkgdir"/usr/bin/$pkgname || return 1 # Allow to bind to port 80. setcap cap_net_bind_service=+ep \ "$pkgdir"/usr/bin/$pkgname || return 1 install -D -m 0664 -o gitea -g www-data "$srcdir"/${pkgname}.ini \ "$pkgdir"/etc/$pkgname/conf/app.ini || return 1 mv options/* "$pkgdir"/etc/$pkgname/conf/ || return 1 mv public templates "$pkgdir"/usr/share/webapps/$pkgname/ || return 1 install -D -m755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 install -D -m644 "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname || return 1 } md5sums="c031c1d3745e95afbb93309f76f9897c gitea-1.0.1.tar.gz 41eaec7f58dd872c1df9cf523b7595ae gitea.initd fc039e2eb200d020867a3105c227b267 gitea.confd b7a9ab6bf9a1c995c1edef73f6aaf374 gitea.ini 91caa13a896c29ec9bc52a259769ee7a aarch64-go-log-fix.patch" sha256sums="79df6391bdf9d7833dd16f312ec8ab998f18671f3a3d889875b4fa81cc010a17 gitea-1.0.1.tar.gz c5236c76d1db76390ec9c0c4e670916e64f4ea64ee856ad191098a55f644e8f7 gitea.initd 749340849d1066c04295267a013107d8517cce53a460e81eb448a2b6e5d45539 gitea.confd c9248a706c9c0c96b07304b2c03ba662473e5beaa0e1cb501dcaf1bb3ba40cbe gitea.ini cd088148e2786c8c720e856d9d518568ea4e6dd7764c72eb86d06ff6eb47fa2f aarch64-go-log-fix.patch" sha512sums="bde94f503ff7df33b0f891bfa726546d07c35c3731ed300dc9be50ee778229a0a358c22fc8206b0f0f4da5085a63bb196748968ed37b9310be9b1cab1c743ce4 gitea-1.0.1.tar.gz 5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd 07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini c5762d3c06a5b9f5a40f15945f57963ebb114a4ccf40ab188fc379dfc8a077f478ef54b88561ee1f316423bd30d8bf8c12527acbddda50b884354374683c843b aarch64-go-log-fix.patch"