Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/gitea/
Date: Wed, 07 Oct 2020 17:01:35
Message-Id: 1602090086.1fcb8067530b2a251c7f2545fd79ef778a586b4d.sam@gentoo
1 commit: 1fcb8067530b2a251c7f2545fd79ef778a586b4d
2 Author: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea <DOT> de>
3 AuthorDate: Tue Aug 25 00:24:36 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 17:01:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fcb8067
7
8 www-apps/gitea: Version bump 1.12.4.
9
10 Closes: https://bugs.gentoo.org/740258
11
12 Signed-off-by: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea.de>
13 Closes: https://github.com/gentoo/gentoo/pull/17255
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 www-apps/gitea/Manifest | 1 +
17 www-apps/gitea/gitea-1.12.4.ebuild | 135 +++++++++++++++++++++++++++++++++++++
18 2 files changed, 136 insertions(+)
19
20 diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest
21 index aa1130e4cf5..a04b71422d1 100644
22 --- a/www-apps/gitea/Manifest
23 +++ b/www-apps/gitea/Manifest
24 @@ -1 +1,2 @@
25 DIST gitea-1.12.1.tar.gz 135104234 BLAKE2B 36510e25e8c2cc1c718702a7cd0be74bbf5448beb33a90732599a4830b0899b37dfc9a58e3a8ffdb5037e93f185ba3b09a0ac7b8acd629c46b1982d6aeab1ec1 SHA512 6ba8a703272e611aac4c214cd818490a9615a9ab9b64ec22ec2c6331e865226324896f600218fb3b39cea7b6649456db7ff18e1857ece6964ab5d3c6d99c3aec
26 +DIST gitea-1.11.8.tar.gz 68927493 BLAKE2B 4e1b1d201848227bd5d5bfac5bbddc291e2f14d7262bb2f8353131b6284520ecda3f844e81c23e95c5cd4ef17a6414e0b3c6adf6e6be5c59f7367c19a2e549d8 SHA512 13216a4d98211eb1a5c319992c9c253ce6f7a7a343ebfdca18802eb599f7300a3c23adbba94784f70ca604751ced5aac7d663a210885554c61a24857de79b6e6
27
28 diff --git a/www-apps/gitea/gitea-1.12.4.ebuild b/www-apps/gitea/gitea-1.12.4.ebuild
29 new file mode 100644
30 index 00000000000..f4f0af94aa8
31 --- /dev/null
32 +++ b/www-apps/gitea/gitea-1.12.4.ebuild
33 @@ -0,0 +1,135 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +inherit fcaps go-module tmpfiles systemd
39 +MY_PV="${PV/_rc/-rc}"
40 +
41 +DESCRIPTION="A painless self-hosted Git service"
42 +HOMEPAGE="https://gitea.io"
43 +
44 +if [[ ${PV} != 9999* ]] ; then
45 + SRC_URI="https://github.com/go-gitea/gitea/releases/download/v${MY_PV}/gitea-src-${MY_PV}.tar.gz -> ${P}.tar.gz"
46 + KEYWORDS="~amd64 ~arm ~arm64"
47 + S="${WORKDIR}"
48 +else
49 + EGIT_REPO_URI="https://github.com/go-gitea/gitea"
50 + inherit git-r3
51 + S="${WORKDIR}/${P}"
52 +fi
53 +
54 +LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
55 +SLOT="0"
56 +IUSE="+acct build-client pam sqlite"
57 +
58 +BDEPEND="build-client? ( >=net-libs/nodejs-10[npm] )"
59 +COMMON_DEPEND="
60 + acct? (
61 + acct-group/git
62 + acct-user/git[gitea] )
63 + pam? ( sys-libs/pam )"
64 +DEPEND="${COMMON_DEPEND}"
65 +RDEPEND="${COMMON_DEPEND}
66 + dev-vcs/git"
67 +
68 +DOCS=(
69 + custom/conf/app.ini.sample CONTRIBUTING.md README.md
70 +)
71 +FILECAPS=(
72 + cap_net_bind_service+ep usr/bin/gitea
73 +)
74 +PATCHES=(
75 + "${FILESDIR}/1.12-fix-vendoring.patch"
76 +)
77 +
78 +RESTRICT="test"
79 +QA_PRESTRIPPED="usr/bin/gitea"
80 +
81 +src_prepare() {
82 + default
83 +
84 + local sedcmds=(
85 + -e "s#^RUN_MODE = dev#RUN_MODE = prod#"
86 + -e "s#^ROOT =#ROOT = ${EPREFIX}/var/lib/gitea/gitea-repositories#"
87 + -e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#"
88 + -e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${EPREFIX}/var/lib/gitea/data#"
89 + -e "s#^HTTP_ADDR = 0.0.0.0#HTTP_ADDR = 127.0.0.1#"
90 + -e "s#^MODE = console#MODE = file#"
91 + -e "s#^LEVEL = Trace#LEVEL = Info#"
92 + -e "s#^LOG_SQL = true#LOG_SQL = false#"
93 + -e "s#^DISABLE_ROUTER_LOG = false#DISABLE_ROUTER_LOG = true#"
94 + -e "s#^APP_ID =#;APP_ID =#"
95 + -e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#"
96 + )
97 +
98 + sed -i "${sedcmds[@]}" custom/conf/app.ini.sample || die
99 + if use sqlite ; then
100 + sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
101 + fi
102 +
103 + einfo "Remove tests which are known to fail with network-sandbox enabled."
104 + rm ./modules/migrations/github_test.go || die
105 +
106 + einfo "Remove tests which depend on gitea git-repo."
107 + rm ./modules/git/blob_test.go || die
108 + rm ./modules/git/repo_test.go || die
109 +
110 + # Remove already build assets (like frontend part)
111 + use build-client && emake clean-all
112 +}
113 +
114 +src_compile() {
115 + local gitea_tags=(
116 + bindata
117 + $(usev pam)
118 + $(usex sqlite 'sqlite sqlite_unlock_notify' '')
119 + )
120 + local gitea_settings=(
121 + "-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/gitea/app.ini"
122 + "-X code.gitea.io/gitea/modules/setting.CustomPath=${EPREFIX}/var/lib/gitea/custom"
123 + "-X code.gitea.io/gitea/modules/setting.AppWorkPath=${EPREFIX}/var/lib/gitea"
124 + )
125 + local makeenv=(
126 + TAGS="${gitea_tags[@]}"
127 + LDFLAGS="-extldflags \"${LDFLAGS}\" ${gitea_settings[@]}"
128 + )
129 + [[ ${PV} != 9999* ]] && makeenv+=("DRONE_TAG=${MY_PV}")
130 +
131 + if use build-client; then
132 + # -j1 as Makefile doesn't handle dependancy correctly, and is not
133 + # useful as golang compiler don't use this info.
134 + env "${makeenv[@]}" emake -j1 build
135 + else
136 + env "${makeenv[@]}" emake backend
137 + fi
138 +}
139 +
140 +src_install() {
141 + dobin gitea
142 +
143 + einstalldocs
144 +
145 + newconfd "${FILESDIR}/gitea.confd-r1" gitea
146 + newinitd "${FILESDIR}/gitea.initd-r3" gitea
147 + newtmpfiles - gitea.conf <<-EOF
148 + d /run/gitea 0755 git git
149 + EOF
150 + systemd_newunit "${FILESDIR}"/gitea.service-r2 gitea.service
151 +
152 + insinto /etc/gitea
153 + newins custom/conf/app.ini.sample app.ini
154 + if use acct ; then
155 + fowners root:git /etc/gitea/{,app.ini}
156 + fperms g+w,o-rwx /etc/gitea/{,app.ini}
157 +
158 + diropts -m0750 -o git -g git
159 + keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
160 + keepdir /var/log/gitea
161 + fi
162 +}
163 +
164 +pkg_postinst() {
165 + fcaps_pkg_postinst
166 + go-module_pkg_postinst
167 + tmpfiles_process gitea.conf
168 +}