1 |
commit: 05b7acaa3d40b21b40f56cc8541f6c74d9eaa02e |
2 |
Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de> |
3 |
AuthorDate: Wed Apr 24 06:25:13 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 7 13:17:46 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05b7acaa |
7 |
|
8 |
www-apps/gitea: bump to 1.8.2 + fix systemd service |
9 |
|
10 |
Closes: https://bugs.gentoo.org/671596 |
11 |
Closes: https://bugs.gentoo.org/684196 |
12 |
Closes: https://bugs.gentoo.org/685616 |
13 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
14 |
Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de> |
15 |
Closes: https://github.com/gentoo/gentoo/pull/11977 |
16 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
17 |
|
18 |
www-apps/gitea/Manifest | 1 + |
19 |
www-apps/gitea/files/gitea.initd-r3 | 22 +++++++ |
20 |
www-apps/gitea/files/gitea.service-r2 | 34 +++++++++++ |
21 |
www-apps/gitea/gitea-1.8.2.ebuild | 104 ++++++++++++++++++++++++++++++++++ |
22 |
4 files changed, 161 insertions(+) |
23 |
|
24 |
diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest |
25 |
index 4bc7d85e617..7b0f2c8349b 100644 |
26 |
--- a/www-apps/gitea/Manifest |
27 |
+++ b/www-apps/gitea/Manifest |
28 |
@@ -1 +1,2 @@ |
29 |
DIST gitea-1.8.0.tar.gz 24268907 BLAKE2B b46a17733fc7bd0f228620bdfadf0d596ea56fca6e685afab7734e794c1f87c5e004529ca3d69e907d516bcb83563565b1d8c32501f1c2c0f9295ca028d96ad0 SHA512 eebbe2f77ed2e4c3562f48a6fa647e6f2a0492c5b6ea4f13542a5ef82e94a357a8d53897aa013107b5f735d2aff9d719893b5724de44831c43998c2e9c6e78d7 |
30 |
+DIST gitea-1.8.2.tar.gz 24321492 BLAKE2B 48a718edd1d607e4f8ee2a301bdd907f2a233be515fa327eac9cfb50cdbc024e5f90e6e86e95056c256cb35497c5a3b2ab5fa4a068a22b28c1a3d2b94780da7a SHA512 23ef63c1cea276800a19fe04b87b4baa421e1202260b4ec55614a77ee54c0bc9e5db6dad7f98791c4d902b2d4cb15f4facc4d201631cf2ef7cefd0ff996753be |
31 |
|
32 |
diff --git a/www-apps/gitea/files/gitea.initd-r3 b/www-apps/gitea/files/gitea.initd-r3 |
33 |
new file mode 100644 |
34 |
index 00000000000..680ae834e23 |
35 |
--- /dev/null |
36 |
+++ b/www-apps/gitea/files/gitea.initd-r3 |
37 |
@@ -0,0 +1,22 @@ |
38 |
+#!/sbin/openrc-run |
39 |
+# Copyright 2016-2019 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+description="Gitea, a self-hosted Git service" |
43 |
+ |
44 |
+: ${GITEA_CONF:=/etc/gitea/app.ini} |
45 |
+: ${GITEA_USER:=git} |
46 |
+: ${GITEA_GROUP:=git} |
47 |
+: ${GITEA_WORK_DIR:=/var/lib/gitea} |
48 |
+: ${GITEA_CUSTOM:=${GITEA_WORK_DIR}/custom} |
49 |
+ |
50 |
+command="/usr/bin/gitea web" |
51 |
+command_args="--config ${GITEA_CONF}" |
52 |
+command_background="true" |
53 |
+command_user="${GITEA_USER}:${GITEA_GROUP}" |
54 |
+error_log="/var/log/${RC_SVCNAME}/${RC_SVCNAME}.err" |
55 |
+pidfile="/run/${RC_SVCNAME}.pid" |
56 |
+required_files="${GITEA_CONF}" |
57 |
+start_stop_daemon_args="-d ${GITEA_WORK_DIR}" |
58 |
+start_stop_daemon_args="${start_stop_daemon_args} -e GITEA_WORK_DIR=${GITEA_WORK_DIR}" |
59 |
+start_stop_daemon_args="${start_stop_daemon_args} -e GITEA_CUSTOM=${GITEA_CUSTOM}" |
60 |
|
61 |
diff --git a/www-apps/gitea/files/gitea.service-r2 b/www-apps/gitea/files/gitea.service-r2 |
62 |
new file mode 100644 |
63 |
index 00000000000..1931b46c73c |
64 |
--- /dev/null |
65 |
+++ b/www-apps/gitea/files/gitea.service-r2 |
66 |
@@ -0,0 +1,34 @@ |
67 |
+[Unit] |
68 |
+Description=Gitea service |
69 |
+Documentation=https://docs.gitea.io/ |
70 |
+ |
71 |
+AssertPathIsDirectory=/var/lib/gitea |
72 |
+AssertPathIsReadWrite=/var/lib/gitea |
73 |
+ |
74 |
+After=network.target |
75 |
+Requires=network.target |
76 |
+After=mysqld.service |
77 |
+After=postgresql-9.3.service |
78 |
+After=postgresql-9.4.service |
79 |
+After=postgresql-9.5.service |
80 |
+After=postgresql-9.6.service |
81 |
+After=postgresql-10.service |
82 |
+After=postgresql-11.service |
83 |
+After=postgresql-12.service |
84 |
+After=memcached.service |
85 |
+After=redis.service |
86 |
+ |
87 |
+[Service] |
88 |
+User=git |
89 |
+Group=git |
90 |
+ |
91 |
+Environment="GITEA_WORK_DIR=/var/lib/gitea" "GITEA_CUSTOM=/var/lib/gitea/custom" |
92 |
+WorkingDirectory=/var/lib/gitea |
93 |
+ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini |
94 |
+ |
95 |
+Restart=always |
96 |
+PrivateTmp=true |
97 |
+Nice=5 |
98 |
+ |
99 |
+[Install] |
100 |
+WantedBy=multi-user.target |
101 |
|
102 |
diff --git a/www-apps/gitea/gitea-1.8.2.ebuild b/www-apps/gitea/gitea-1.8.2.ebuild |
103 |
new file mode 100644 |
104 |
index 00000000000..bdefa9b6352 |
105 |
--- /dev/null |
106 |
+++ b/www-apps/gitea/gitea-1.8.2.ebuild |
107 |
@@ -0,0 +1,104 @@ |
108 |
+# Copyright 1999-2019 Gentoo Authors |
109 |
+# Distributed under the terms of the GNU General Public License v2 |
110 |
+ |
111 |
+EAPI=7 |
112 |
+inherit golang-vcs-snapshot systemd user |
113 |
+ |
114 |
+EGO_PN="code.gitea.io/gitea" |
115 |
+ |
116 |
+DESCRIPTION="A painless self-hosted Git service" |
117 |
+HOMEPAGE="https://gitea.io" |
118 |
+SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
119 |
+ |
120 |
+LICENSE="MIT" |
121 |
+SLOT="0" |
122 |
+KEYWORDS="~amd64 ~arm ~arm64" |
123 |
+IUSE="pam sqlite" |
124 |
+ |
125 |
+COMMON_DEPEND="pam? ( sys-libs/pam )" |
126 |
+DEPEND="${COMMON_DEPEND} |
127 |
+ dev-go/go-bindata" |
128 |
+RDEPEND="${COMMON_DEPEND} |
129 |
+ dev-vcs/git" |
130 |
+ |
131 |
+DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md ) |
132 |
+S="${WORKDIR}/${P}/src/${EGO_PN}" |
133 |
+ |
134 |
+pkg_setup() { |
135 |
+ enewgroup git |
136 |
+ enewuser git -1 /bin/bash /var/lib/gitea git |
137 |
+} |
138 |
+ |
139 |
+gitea_make() { |
140 |
+ local my_tags=( |
141 |
+ bindata |
142 |
+ $(usev pam) |
143 |
+ $(usex sqlite 'sqlite sqlite_unlock_notify' '') |
144 |
+ ) |
145 |
+ local my_makeopt=( |
146 |
+ DRONE_TAG=${PV} |
147 |
+ TAGS="${my_tags[@]}" |
148 |
+ ) |
149 |
+ GOPATH=${WORKDIR}/${P}:$(get_golibdir_gopath) emake "${my_makeopt[@]}" "$@" |
150 |
+} |
151 |
+ |
152 |
+src_prepare() { |
153 |
+ default |
154 |
+ sed -i \ |
155 |
+ -e "s#^RUN_MODE = dev#RUN_MODE = prod#" \ |
156 |
+ -e "s#^ROOT =#ROOT = ${EPREFIX}/var/lib/gitea/gitea-repositories#" \ |
157 |
+ -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#" \ |
158 |
+ -e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${EPREFIX}/var/lib/gitea/data#" \ |
159 |
+ -e "s#^HTTP_ADDR = 0.0.0.0#HTTP_ADDR = 127.0.0.1#" \ |
160 |
+ -e "s#^MODE = console#MODE = file#" \ |
161 |
+ -e "s#^LEVEL = Trace#LEVEL = Info#" \ |
162 |
+ -e "s#^LOG_SQL = true#LOG_SQL = false#" \ |
163 |
+ -e "s#^DISABLE_ROUTER_LOG = false#DISABLE_ROUTER_LOG = true#" \ |
164 |
+ -e "s#^APP_ID =#;APP_ID =#" \ |
165 |
+ -e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#" \ |
166 |
+ custom/conf/app.ini.sample || die |
167 |
+ if use sqlite ; then |
168 |
+ sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die |
169 |
+ fi |
170 |
+ |
171 |
+ gitea_make generate |
172 |
+} |
173 |
+ |
174 |
+src_compile() { |
175 |
+ gitea_make build |
176 |
+} |
177 |
+ |
178 |
+src_test() { |
179 |
+ gitea_make test |
180 |
+} |
181 |
+ |
182 |
+src_install() { |
183 |
+ dobin gitea |
184 |
+ |
185 |
+ einstalldocs |
186 |
+ |
187 |
+ newconfd "${FILESDIR}"/gitea.confd-r1 gitea |
188 |
+ newinitd "${FILESDIR}"/gitea.initd-r3 gitea |
189 |
+ systemd_newunit "${FILESDIR}"/gitea.service-r2 gitea.service |
190 |
+ |
191 |
+ insinto /etc/gitea |
192 |
+ newins custom/conf/app.ini.sample app.ini |
193 |
+ fowners root:git /etc/gitea/{,app.ini} |
194 |
+ fperms g+w,o-rwx /etc/gitea/{,app.ini} |
195 |
+ |
196 |
+ diropts -m0750 -o git -g git |
197 |
+ keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data |
198 |
+ keepdir /var/log/gitea |
199 |
+} |
200 |
+ |
201 |
+pkg_postinst() { |
202 |
+ if [[ -e "${EROOT}/var/lib/gitea/conf/app.ini" ]]; then |
203 |
+ ewarn "The configuration path has been changed to ${EROOT}/etc/gitea/app.ini." |
204 |
+ ewarn "Please move your configuration from ${EROOT}/var/lib/gitea/conf/app.ini" |
205 |
+ ewarn "and adapt the gitea-repositories hooks and ssh authorized_keys." |
206 |
+ ewarn "Depending on your configuration you should run something like:" |
207 |
+ ewarn "sed -i -e 's#${EROOT}/var/lib/gitea/conf/app.ini#${EROOT}/etc/gitea/app.ini#' \\" |
208 |
+ ewarn " /var/lib/gitea/gitea-repositories/*/*/hooks/*/* \\" |
209 |
+ ewarn " /var/lib/gitea/.ssh/authorized_keys" |
210 |
+ fi |
211 |
+} |