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