Commit c1238019 authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

testing/gogs: improve abuild, make package() more readable

parent 430baceb
......@@ -2,7 +2,7 @@
# Maintainer: 7heo <7heo@mail.com>
pkgname=gogs
pkgver=0.9.48
pkgrel=1
pkgrel=2
pkgdesc="A self-hosted Git service written in Go"
url="http://gogs.io/"
arch="all"
......@@ -32,27 +32,32 @@ build() {
package() {
cd "$builddir"
mkdir -p "$pkgdir"/usr/share/webapps/$pkgname \
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 gogs -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 || return 1
chown -R gogs:www-data "$pkgdir"/var/lib/$pkgname \
"$pkgdir"/var/cache/gogs/sessions \
"$pkgdir"/var/log/$pkgname || return 1
"$pkgdir"/var/log/$pkgname \
"$pkgdir"/etc/$pkgname/conf || return 1
install -D -m 0755 ${pkgname}-${pkgver} \
"$pkgdir"/usr/bin/$pkgname || return 1
# allow to bind to port 80
# Allow to bind to port 80.
setcap cap_net_bind_service=+ep \
"$pkgdir"/usr/bin/$pkgname || return 1
install -d -o gogs -g www-data \
"$pkgdir"/etc/$pkgname/conf || return 1
install -D -m 0664 -o gogs -g www-data "$srcdir"/${pkgname}.ini \
"$pkgdir"/etc/$pkgname/conf/app.ini || return 1
mv public "$pkgdir"/usr/share/webapps/$pkgname/ || return 1
mv templates "$pkgdir"/usr/share/webapps/$pkgname/ || 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 \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment