From 23980ddbd76a735adb0f6f8f66b4a80d72df363a Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Fri, 10 Mar 2017 00:30:23 +0100 Subject: testing/gitea: move to community --- community/gitea/APKBUILD | 86 ++++++++++++++++++++++++++++++ community/gitea/allow-to-set-version.patch | 15 ++++++ community/gitea/gitea.confd | 2 + community/gitea/gitea.ini | 29 ++++++++++ community/gitea/gitea.initd | 15 ++++++ community/gitea/gitea.pre-install | 7 +++ testing/gitea/APKBUILD | 86 ------------------------------ testing/gitea/allow-to-set-version.patch | 15 ------ testing/gitea/gitea.confd | 2 - testing/gitea/gitea.ini | 29 ---------- testing/gitea/gitea.initd | 15 ------ testing/gitea/gitea.pre-install | 7 --- 12 files changed, 154 insertions(+), 154 deletions(-) create mode 100644 community/gitea/APKBUILD create mode 100644 community/gitea/allow-to-set-version.patch create mode 100644 community/gitea/gitea.confd create mode 100644 community/gitea/gitea.ini create mode 100644 community/gitea/gitea.initd create mode 100644 community/gitea/gitea.pre-install delete mode 100644 testing/gitea/APKBUILD delete mode 100644 testing/gitea/allow-to-set-version.patch delete mode 100644 testing/gitea/gitea.confd delete mode 100644 testing/gitea/gitea.ini delete mode 100644 testing/gitea/gitea.initd delete mode 100644 testing/gitea/gitea.pre-install diff --git a/community/gitea/APKBUILD b/community/gitea/APKBUILD new file mode 100644 index 0000000000..0b0f36ba70 --- /dev/null +++ b/community/gitea/APKBUILD @@ -0,0 +1,86 @@ +# Contributor: Carlo Landmeter +# Maintainer: 7heo <7heo@mail.com> +pkgname=gitea +pkgver=1.1.0 +pkgrel=0 +pkgdesc="A self-hosted Git service written in Go" +url="http://gitea.io/" +arch="all" +license="MIT" +depends="git" +makedepends="go 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 + allow-to-set-version.patch + " +builddir="$srcdir/src/code.gitea.io/$pkgname" + +prepare() { + mkdir -p ${builddir%/*} + mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 + cd "$builddir" + default_prepare +} + +build() { + cd "$builddir" + export GOPATH="$srcdir" + export TAGS="tidb sqlite" + export VERSION="$pkgver" + unset LDFLAGS + make build +} + +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/conf \ + "$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 $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"/var/lib/$pkgname/conf || return 1 + chown gitea:www-data -R "$pkgdir"/var/lib/$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 +} + +check() { + # basic check to see if the app works + "$builddir"/$pkgname help > /dev/null 2>&1 || return 1 +} + +sha512sums="206b3b3b2af13634573bb956f7a7db11a45dba36b73a48fb2561018b445b9f7d215d77af6ed1b985d8098d835502544347974223d3892a75abfdce7f5769cbba gitea-1.1.0.tar.gz +5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd +ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd +07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini +e38a701faed6749cbb897536d9ec7e723dc258c01b43daea7e19f3bd56dda4d69cd3be2b0813c24bef902f0b82c734120e36276b4e72899d2d2b3be54dc4574e allow-to-set-version.patch" diff --git a/community/gitea/allow-to-set-version.patch b/community/gitea/allow-to-set-version.patch new file mode 100644 index 0000000000..4be917c846 --- /dev/null +++ b/community/gitea/allow-to-set-version.patch @@ -0,0 +1,15 @@ +--- ./Makefile.orig ++++ ./Makefile +@@ -11,7 +11,11 @@ + STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less) + JAVASCRIPTS := + +-LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)" ++ifeq ($(origin VERSION), undefined) ++ VERSION=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') ++endif ++ ++LDFLAGS += -X "main.Version=$(VERSION)" + + PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell go list ./... | grep -v /vendor/)) + SOURCES ?= $(shell find . -name "*.go" -type f) diff --git a/community/gitea/gitea.confd b/community/gitea/gitea.confd new file mode 100644 index 0000000000..347fc5ab63 --- /dev/null +++ b/community/gitea/gitea.confd @@ -0,0 +1,2 @@ +GITEA_CUSTOM="/etc/gitea" +GITEA_USER="gitea" diff --git a/community/gitea/gitea.ini b/community/gitea/gitea.ini new file mode 100644 index 0000000000..5ed7198f01 --- /dev/null +++ b/community/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/community/gitea/gitea.initd b/community/gitea/gitea.initd new file mode 100644 index 0000000000..3b18678b6b --- /dev/null +++ b/community/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/community/gitea/gitea.pre-install b/community/gitea/gitea.pre-install new file mode 100644 index 0000000000..04b5a24008 --- /dev/null +++ b/community/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 diff --git a/testing/gitea/APKBUILD b/testing/gitea/APKBUILD deleted file mode 100644 index 0b0f36ba70..0000000000 --- a/testing/gitea/APKBUILD +++ /dev/null @@ -1,86 +0,0 @@ -# Contributor: Carlo Landmeter -# Maintainer: 7heo <7heo@mail.com> -pkgname=gitea -pkgver=1.1.0 -pkgrel=0 -pkgdesc="A self-hosted Git service written in Go" -url="http://gitea.io/" -arch="all" -license="MIT" -depends="git" -makedepends="go 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 - allow-to-set-version.patch - " -builddir="$srcdir/src/code.gitea.io/$pkgname" - -prepare() { - mkdir -p ${builddir%/*} - mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 - cd "$builddir" - default_prepare -} - -build() { - cd "$builddir" - export GOPATH="$srcdir" - export TAGS="tidb sqlite" - export VERSION="$pkgver" - unset LDFLAGS - make build -} - -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/conf \ - "$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 $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"/var/lib/$pkgname/conf || return 1 - chown gitea:www-data -R "$pkgdir"/var/lib/$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 -} - -check() { - # basic check to see if the app works - "$builddir"/$pkgname help > /dev/null 2>&1 || return 1 -} - -sha512sums="206b3b3b2af13634573bb956f7a7db11a45dba36b73a48fb2561018b445b9f7d215d77af6ed1b985d8098d835502544347974223d3892a75abfdce7f5769cbba gitea-1.1.0.tar.gz -5cd3144d040139ff27fb5acef9b09406f7acbdda2779638ba20fcf8a7739697351502a26a30020a42c84b9146fdc96b9943b85099819a86facf0d53a4f000078 gitea.initd -ea4a771652871a6aefd5f236c6cd96bf0b17abb46a016e60fe1ae96b88df972e014be438f52dc9c0f8a35e50f5897d48b8a413a6aeaf54adf8ed1e1005e472c1 gitea.confd -07d31133712675cdef326da95bf6ea24d7312c58b126a160cf28a64a5548dbe72b9d64f99d25aaa052f08c7ae4d8a74425d8307a6f41a58bd74f34c8fdb08d8f gitea.ini -e38a701faed6749cbb897536d9ec7e723dc258c01b43daea7e19f3bd56dda4d69cd3be2b0813c24bef902f0b82c734120e36276b4e72899d2d2b3be54dc4574e allow-to-set-version.patch" diff --git a/testing/gitea/allow-to-set-version.patch b/testing/gitea/allow-to-set-version.patch deleted file mode 100644 index 4be917c846..0000000000 --- a/testing/gitea/allow-to-set-version.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ./Makefile.orig -+++ ./Makefile -@@ -11,7 +11,11 @@ - STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less) - JAVASCRIPTS := - --LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)" -+ifeq ($(origin VERSION), undefined) -+ VERSION=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') -+endif -+ -+LDFLAGS += -X "main.Version=$(VERSION)" - - PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell go list ./... | grep -v /vendor/)) - SOURCES ?= $(shell find . -name "*.go" -type f) diff --git a/testing/gitea/gitea.confd b/testing/gitea/gitea.confd deleted file mode 100644 index 347fc5ab63..0000000000 --- a/testing/gitea/gitea.confd +++ /dev/null @@ -1,2 +0,0 @@ -GITEA_CUSTOM="/etc/gitea" -GITEA_USER="gitea" diff --git a/testing/gitea/gitea.ini b/testing/gitea/gitea.ini deleted file mode 100644 index 5ed7198f01..0000000000 --- a/testing/gitea/gitea.ini +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 3b18678b6b..0000000000 --- a/testing/gitea/gitea.initd +++ /dev/null @@ -1,15 +0,0 @@ -#!/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 deleted file mode 100644 index 04b5a24008..0000000000 --- a/testing/gitea/gitea.pre-install +++ /dev/null @@ -1,7 +0,0 @@ -#!/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