From 7c96be40230b43bd8e2c15730ed1d21819c55025 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Wed, 18 Jan 2017 10:38:50 +0100 Subject: testing/gitea: new aport --- testing/gitea/APKBUILD | 79 +++++++++++++++++++++++++++++++++++++++++ testing/gitea/gitea.confd | 2 ++ testing/gitea/gitea.ini | 29 +++++++++++++++ testing/gitea/gitea.initd | 15 ++++++++ testing/gitea/gitea.pre-install | 7 ++++ 5 files changed, 132 insertions(+) create mode 100644 testing/gitea/APKBUILD create mode 100644 testing/gitea/gitea.confd create mode 100644 testing/gitea/gitea.ini create mode 100644 testing/gitea/gitea.initd create mode 100644 testing/gitea/gitea.pre-install (limited to 'testing') diff --git a/testing/gitea/APKBUILD b/testing/gitea/APKBUILD new file mode 100644 index 0000000000..35d8ecc825 --- /dev/null +++ b/testing/gitea/APKBUILD @@ -0,0 +1,79 @@ +# Contributor: Carlo Landmeter +# Maintainer: 7heo <7heo@mail.com> +pkgname=gitea +pkgver=1.0.1 +pkgrel=0 +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" +builddir="$srcdir/src/code.gitea.io/$pkgname" + +prepare() { + mkdir -p ${builddir%/*} + mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 + default_prepare +} + +build() { + cd "$builddir" + export GOPATH="$srcdir" + govendor sync -v || return 1 + 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 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 +15d303d47b25ac42da36c7118878dd35 gitea.confd +b7a9ab6bf9a1c995c1edef73f6aaf374 gitea.ini" +sha256sums="79df6391bdf9d7833dd16f312ec8ab998f18671f3a3d889875b4fa81cc010a17 gitea-1.0.1.tar.gz +c5236c76d1db76390ec9c0c4e670916e64f4ea64ee856ad191098a55f644e8f7 gitea.initd +c2e9831078af389acf2e6e3d4a7d747d8b03c1ed3570f8b7515c7c3da0d92cc5 gitea.confd +c9248a706c9c0c96b07304b2c03ba662473e5beaa0e1cb501dcaf1bb3ba40cbe gitea.ini" +sha512sums="bde94f503ff7df33b0f891bfa726546d07c35c3731ed300dc9be50ee778229a0a358c22fc8206b0f0f4da5085a63bb196748968ed37b9310be9b1cab1c743ce4 gitea-1.0.1.tar.gz +5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd +6d2fc0bc54f98f4676398738abb099fc1b3f9db9c9eb5593b5b438dd146ed9bc0baf7be9092feed5e7de2bc05288d30f3e2d8dd4f2334847c04c11a4eb08dae5 gitea.confd +07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini" diff --git a/testing/gitea/gitea.confd b/testing/gitea/gitea.confd new file mode 100644 index 0000000000..781ef8f10b --- /dev/null +++ b/testing/gitea/gitea.confd @@ -0,0 +1,2 @@ +GETEA_CUSTOM="/etc/gitea" +GITEA_USER="gitea" diff --git a/testing/gitea/gitea.ini b/testing/gitea/gitea.ini new file mode 100644 index 0000000000..5ed7198f01 --- /dev/null +++ b/testing/gitea/gitea.ini @@ -0,0 +1,29 @@ +RUN_USER = gitea +RUN_MODE = prod + +[repository] +ROOT = /var/lib/gitea/git +SCRIPT_TYPE = sh + +[server] +STATIC_ROOT_PATH = /usr/share/webapps/gitea + +[database] +DB_TYPE = sqlite3 +PATH = /var/lib/gitea/db/gitea.db +SSL_MODE = disable + +[session] +PROVIDER_CONFIG = /var/cache/gitea/sessions +PROVIDER = file + +[picture] +AVATAR_UPLOAD_PATH = /var/lib/gitea/avatars + +[attachment] +PATH = /var/lib/gitea/attachements + +[log] +ROOT_PATH = /var/log/gitea +MODE = file +LEVEL = Info diff --git a/testing/gitea/gitea.initd b/testing/gitea/gitea.initd new file mode 100644 index 0000000000..3b18678b6b --- /dev/null +++ b/testing/gitea/gitea.initd @@ -0,0 +1,15 @@ +#!/sbin/openrc-run + +name=gitea +conffile="$GITEA_CUSTOM/conf/app.ini" +command="/usr/bin/gitea" +command_args="web -c $conffile" +start_stop_daemon_args="${GITEA_USER:+--user} $GITEA_USER --env GITEA_CUSTOM=$GITEA_CUSTOM" +pidfile="/var/run/gitea.pid" +command_background="yes" + +depend() { + use logger dns + need net + after firewall +} diff --git a/testing/gitea/gitea.pre-install b/testing/gitea/gitea.pre-install new file mode 100644 index 0000000000..04b5a24008 --- /dev/null +++ b/testing/gitea/gitea.pre-install @@ -0,0 +1,7 @@ +#!/bin/sh + +addgroup -S www-data 2>/dev/null +adduser -S -D -h /var/lib/gitea -s /bin/ash -G www-data -g gitea gitea 2>/dev/null +passwd -u gitea 2>/dev/null + +exit 0 -- cgit v1.2.3