summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2016-12-25 21:53:19 +0100
committerManuel Rüger <mrueg@gentoo.org>2016-12-25 21:53:19 +0100
commit50929e7f8b9281b23126cea5a231110c36e267b1 (patch)
tree17940a0f1857cc347dc836ee35007327f5d00914 /www-apps
parentdev-ruby/rest-client: Add ruby23 (diff)
downloadgentoo-50929e7f8b9281b23126cea5a231110c36e267b1.tar.gz
gentoo-50929e7f8b9281b23126cea5a231110c36e267b1.tar.bz2
gentoo-50929e7f8b9281b23126cea5a231110c36e267b1.zip
www-apps/gitea: Move config file to /var/lib/gitea, further misc fixes
Package-Manager: portage-2.3.3
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/gitea/files/gitea.confd2
-rw-r--r--www-apps/gitea/files/gitea.initd2
-rw-r--r--www-apps/gitea/gitea-1.0.0-r1.ebuild62
3 files changed, 64 insertions, 2 deletions
diff --git a/www-apps/gitea/files/gitea.confd b/www-apps/gitea/files/gitea.confd
index cb99b520c839..8b1710b06fbc 100644
--- a/www-apps/gitea/files/gitea.confd
+++ b/www-apps/gitea/files/gitea.confd
@@ -1,2 +1,2 @@
# arguments for gitea
-command_args="--config /etc/gitea/app.ini"
+command_args="--config /var/lib/gitea/conf/app.ini"
diff --git a/www-apps/gitea/files/gitea.initd b/www-apps/gitea/files/gitea.initd
index 05565f6da278..a9aaac7ee378 100644
--- a/www-apps/gitea/files/gitea.initd
+++ b/www-apps/gitea/files/gitea.initd
@@ -9,7 +9,7 @@ user=${user:-${SVCNAME}}
group=${group:-${SVCNAME}}
command="/usr/bin/gitea web"
-command_args="${command_args:--config /etc/gitea/app.ini}"
+command_args="${command_args:--config /var/lib/gitea/conf/app.ini}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/${SVCNAME}/${SVCNAME}.log \
diff --git a/www-apps/gitea/gitea-1.0.0-r1.ebuild b/www-apps/gitea/gitea-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..8283d50ed3ca
--- /dev/null
+++ b/www-apps/gitea/gitea-1.0.0-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="code.gitea.io/gitea/..."
+EGIT_COMMIT="6aacf4d2f09631359b99df562b4bf31dcef44ea3"
+ARCHIVE_URI="https://github.com/go-gitea/gitea/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="A painless self-hosted Git service, written in Go, forked from gogs"
+HOMEPAGE="https://github.com/go-gitea/gitea"
+SRC_URI="${ARCHIVE_URI}"
+
+LICENSE="MIT"
+SLOT="0/${PVR}"
+IUSE=""
+
+DEPEND="dev-go/go-bindata"
+RDEPEND="dev-vcs/git"
+
+pkg_setup() {
+ enewgroup gitea
+ enewuser gitea -1 /bin/bash /var/lib/gitea gitea
+}
+
+src_prepare() {
+ default
+ local GITEA_PREFIX=${EPREFIX}/var/lib/gitea
+ sed -i -e "s/git rev-parse --short HEAD/echo ${EGIT_COMMIT:0:7}/"\
+ -e "s/^LDFLAGS += -X \"main.Version.*$/LDFLAGS += -X \"main.Version=${PV}\"/"\
+ -e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN%/*}/Makefile || die
+ sed -i -e "s#RUN_USER = git#RUN_USER = gitea#"\
+ -e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${GITEA_PREFIX}/data#"\
+ -e "s#^PATH = data/gitea.db#PATH = ${GITEA_PREFIX}/data/gitea.db#"\
+ -e "s#^PROVIDER_CONFIG = data/sessions#PROVIDER_CONFIG = ${GITEA_PREFIX}/data/sessions#"\
+ -e "s#^AVATAR_UPLOAD_PATH = data/avatars#AVATAR_UPLOAD_PATH = ${GITEA_PREFIX}/data/avatars#"\
+ -e "s#^TEMP_PATH = data/tmp/uploads#TEMP_PATH = ${GITEA_PREFIX}/data/tmp/uploads#"\
+ -e "s#^PATH = data/attachments#PATH = ${GITEA_PREFIX}/data/attachments#"\
+ -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#" src/${EGO_PN%/*}/conf/app.ini || die
+}
+
+src_compile() {
+ GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} generate
+ TAGS="bindata pam sqlite" LDFLAGS="" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} build
+}
+
+src_install() {
+ pushd src/${EGO_PN%/*} || die
+ dobin gitea
+ insinto /var/lib/gitea/conf
+ doins conf/app.ini
+ popd || die
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/gitea.logrotated gitea
+ newinitd "${FILESDIR}"/gitea.initd gitea
+ newconfd "${FILESDIR}"/gitea.confd gitea
+ keepdir /var/log/gitea /var/lib/gitea/data
+ fowners -R gitea:gitea /var/log/gitea /var/lib/gitea/
+}