Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/gitea/, www-apps/gitea/files/
Date: Sun, 25 Dec 2016 20:53:54
Message-Id: 1482699199.50929e7f8b9281b23126cea5a231110c36e267b1.mrueg@gentoo
1 commit: 50929e7f8b9281b23126cea5a231110c36e267b1
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 25 20:53:19 2016 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 25 20:53:19 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50929e7f
7
8 www-apps/gitea: Move config file to /var/lib/gitea, further misc fixes
9
10 Package-Manager: portage-2.3.3
11
12 www-apps/gitea/files/gitea.confd | 2 +-
13 www-apps/gitea/files/gitea.initd | 2 +-
14 www-apps/gitea/gitea-1.0.0-r1.ebuild | 62 ++++++++++++++++++++++++++++++++++++
15 3 files changed, 64 insertions(+), 2 deletions(-)
16
17 diff --git a/www-apps/gitea/files/gitea.confd b/www-apps/gitea/files/gitea.confd
18 index cb99b52..8b1710b 100644
19 --- a/www-apps/gitea/files/gitea.confd
20 +++ b/www-apps/gitea/files/gitea.confd
21 @@ -1,2 +1,2 @@
22 # arguments for gitea
23 -command_args="--config /etc/gitea/app.ini"
24 +command_args="--config /var/lib/gitea/conf/app.ini"
25
26 diff --git a/www-apps/gitea/files/gitea.initd b/www-apps/gitea/files/gitea.initd
27 index 05565f6..a9aaac7 100644
28 --- a/www-apps/gitea/files/gitea.initd
29 +++ b/www-apps/gitea/files/gitea.initd
30 @@ -9,7 +9,7 @@ user=${user:-${SVCNAME}}
31 group=${group:-${SVCNAME}}
32
33 command="/usr/bin/gitea web"
34 -command_args="${command_args:--config /etc/gitea/app.ini}"
35 +command_args="${command_args:--config /var/lib/gitea/conf/app.ini}"
36 command_background="true"
37 start_stop_daemon_args="--user ${user} --group ${group} \
38 --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
39
40 diff --git a/www-apps/gitea/gitea-1.0.0-r1.ebuild b/www-apps/gitea/gitea-1.0.0-r1.ebuild
41 new file mode 100644
42 index 00000000..8283d50
43 --- /dev/null
44 +++ b/www-apps/gitea/gitea-1.0.0-r1.ebuild
45 @@ -0,0 +1,62 @@
46 +# Copyright 1999-2016 Gentoo Foundation
47 +# Distributed under the terms of the GNU General Public License v2
48 +# $Id$
49 +
50 +EAPI=6
51 +inherit user golang-build golang-vcs-snapshot
52 +
53 +EGO_PN="code.gitea.io/gitea/..."
54 +EGIT_COMMIT="6aacf4d2f09631359b99df562b4bf31dcef44ea3"
55 +ARCHIVE_URI="https://github.com/go-gitea/gitea/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
56 +KEYWORDS="~amd64"
57 +
58 +DESCRIPTION="A painless self-hosted Git service, written in Go, forked from gogs"
59 +HOMEPAGE="https://github.com/go-gitea/gitea"
60 +SRC_URI="${ARCHIVE_URI}"
61 +
62 +LICENSE="MIT"
63 +SLOT="0/${PVR}"
64 +IUSE=""
65 +
66 +DEPEND="dev-go/go-bindata"
67 +RDEPEND="dev-vcs/git"
68 +
69 +pkg_setup() {
70 + enewgroup gitea
71 + enewuser gitea -1 /bin/bash /var/lib/gitea gitea
72 +}
73 +
74 +src_prepare() {
75 + default
76 + local GITEA_PREFIX=${EPREFIX}/var/lib/gitea
77 + sed -i -e "s/git rev-parse --short HEAD/echo ${EGIT_COMMIT:0:7}/"\
78 + -e "s/^LDFLAGS += -X \"main.Version.*$/LDFLAGS += -X \"main.Version=${PV}\"/"\
79 + -e "s/-ldflags '-s/-ldflags '/" src/${EGO_PN%/*}/Makefile || die
80 + sed -i -e "s#RUN_USER = git#RUN_USER = gitea#"\
81 + -e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${GITEA_PREFIX}/data#"\
82 + -e "s#^PATH = data/gitea.db#PATH = ${GITEA_PREFIX}/data/gitea.db#"\
83 + -e "s#^PROVIDER_CONFIG = data/sessions#PROVIDER_CONFIG = ${GITEA_PREFIX}/data/sessions#"\
84 + -e "s#^AVATAR_UPLOAD_PATH = data/avatars#AVATAR_UPLOAD_PATH = ${GITEA_PREFIX}/data/avatars#"\
85 + -e "s#^TEMP_PATH = data/tmp/uploads#TEMP_PATH = ${GITEA_PREFIX}/data/tmp/uploads#"\
86 + -e "s#^PATH = data/attachments#PATH = ${GITEA_PREFIX}/data/attachments#"\
87 + -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#" src/${EGO_PN%/*}/conf/app.ini || die
88 +}
89 +
90 +src_compile() {
91 + GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} generate
92 + TAGS="bindata pam sqlite" LDFLAGS="" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" emake -C src/${EGO_PN%/*} build
93 +}
94 +
95 +src_install() {
96 + pushd src/${EGO_PN%/*} || die
97 + dobin gitea
98 + insinto /var/lib/gitea/conf
99 + doins conf/app.ini
100 + popd || die
101 + insinto /etc/logrotate.d
102 + newins "${FILESDIR}"/gitea.logrotated gitea
103 + newinitd "${FILESDIR}"/gitea.initd gitea
104 + newconfd "${FILESDIR}"/gitea.confd gitea
105 + keepdir /var/log/gitea /var/lib/gitea/data
106 + fowners -R gitea:gitea /var/log/gitea /var/lib/gitea/
107 +}