Gentoo Archives: gentoo-commits

From: Theo Anderson <telans@××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: www-apps/gogs/, www-apps/gogs/files/
Date: Fri, 08 Jan 2021 11:19:37
Message-Id: 1610104648.ed515cf2a9eae78e2d1d6f8881e49a427b4d0942.telans@gentoo
1 commit: ed515cf2a9eae78e2d1d6f8881e49a427b4d0942
2 Author: Theo Anderson <telans <AT> posteo <DOT> de>
3 AuthorDate: Fri Jan 8 11:17:28 2021 +0000
4 Commit: Theo Anderson <telans <AT> posteo <DOT> de>
5 CommitDate: Fri Jan 8 11:17:28 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ed515cf2
7
8 www-apps/gogs: tidy ebuild
9
10 Closes: https://bugs.gentoo.org/741522
11 Package-Manager: Portage-3.0.12, Repoman-3.0.2
12 Signed-off-by: Theo Anderson <telans <AT> posteo.de>
13
14 www-apps/gogs/files/gogs-0.12.3.patch | 6 ++---
15 www-apps/gogs/gogs-0.12.3.ebuild | 45 +++++++++++++++++++----------------
16 2 files changed, 28 insertions(+), 23 deletions(-)
17
18 diff --git a/www-apps/gogs/files/gogs-0.12.3.patch b/www-apps/gogs/files/gogs-0.12.3.patch
19 index 2d99c012..f5c0eb0b 100644
20 --- a/www-apps/gogs/files/gogs-0.12.3.patch
21 +++ b/www-apps/gogs/files/gogs-0.12.3.patch
22 @@ -1,6 +1,6 @@
23 -diff --git a/custom/conf/app.ini b/custom/conf/app.ini
24 ---- a/custom/conf/app.ini
25 -+++ b/custom/conf/app.ini
26 +diff --git a/conf/app.ini b/conf/app.ini
27 +--- a/conf/app.ini
28 ++++ b/conf/app.ini
29 @@ -1,14 +1,12 @@
30 -# !!! NEVER EVER MODIFY THIS FILE !!!
31 -# !!! PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE !!!
32
33 diff --git a/www-apps/gogs/gogs-0.12.3.ebuild b/www-apps/gogs/gogs-0.12.3.ebuild
34 index d8679f2a..05c81318 100644
35 --- a/www-apps/gogs/gogs-0.12.3.ebuild
36 +++ b/www-apps/gogs/gogs-0.12.3.ebuild
37 @@ -1,4 +1,4 @@
38 -# Copyright 1999-2020 Gentoo Authors
39 +# Copyright 1999-2021 Gentoo Authors
40 # Distributed under the terms of the GNU General Public License v2
41
42 EAPI=7
43 @@ -6,7 +6,10 @@ EAPI=7
44 inherit fcaps go-module systemd
45
46 DESCRIPTION="Gogs is a self-hosted Git service written in Go"
47 -HOMEPAGE="https://gogs.io https://github.com/gogs/gogs"
48 +HOMEPAGE="
49 + https://gogs.io
50 + https://github.com/gogs/gogs
51 +"
52
53 EGO_SUM=(
54 "cloud.google.com/go v0.26.0/go.mod"
55 @@ -439,26 +442,26 @@ EGO_SUM=(
56 "xorm.io/core v0.7.2/go.mod"
57 "xorm.io/xorm v0.8.0"
58 "xorm.io/xorm v0.8.0/go.mod"
59 - )
60 +)
61 +
62 go-module_set_globals
63
64 -SRC_URI="https://github.com/gogs/gogs/archive/v${PV}.tar.gz -> ${P}.tar.gz ${EGO_SUM_SRC_URI}"
65 +SRC_URI="
66 + https://github.com/gogs/gogs/archive/v${PV}.tar.gz -> ${P}.tar.gz
67 + ${EGO_SUM_SRC_URI}
68 +"
69
70 LICENSE="Apache-2.0 BSD MIT"
71 SLOT="0"
72 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
73 -
74 IUSE="cert mysql +pam postgres +sqlite"
75 REQUIRED_USE="|| ( sqlite mysql postgres )"
76 -PATCHES=( "${FILESDIR}/${P}.patch" )
77 -
78 RESTRICT="mirror"
79
80 DEPEND="
81 acct-user/gogs
82 sqlite? ( dev-db/sqlite:3 )
83 "
84 -
85 RDEPEND="
86 ${DEPEND}
87 app-shells/bash
88 @@ -469,24 +472,23 @@ RDEPEND="
89 postgres? ( dev-db/postgresql[pam?] )
90 "
91
92 +PATCHES=( "${FILESDIR}/${P}.patch" )
93 FILECAPS=(
94 cap_net_bind_service+ep usr/bin/gogs
95 )
96
97 src_prepare() {
98 - mkdir -p "${S}/custom/conf/"
99 - cp "${S}/conf/app.ini" "${S}/custom/conf/"
100 -
101 default
102 -
103 - sed -i -e 's:data/gogs.db:database/gogs.db:' "${S}/templates/install.tmpl" || die
104 + mkdir -p custom/conf/
105 + cp conf/app.ini custom/conf/
106 + sed -i 's:data/:database/:' templates/install.tmpl || die
107 }
108
109 src_compile() {
110 - GOLANG_PKG_TAGS=""
111 - use cert && GOLANG_PKG_TAGS+=" cert"
112 - use pam && GOLANG_PKG_TAGS+=" pam"
113 - go build -tags ${GOLANG_PKG_TAGS} -o gogs
114 + local GOLANG_PKG_TAGS=()
115 + use cert && GOLANG_PKG_TAGS+=( cert )
116 + use pam && GOLANG_PKG_TAGS+=( pam )
117 + go build -tags ${GOLANG_PKG_TAGS[@]} -o gogs || die
118 }
119
120 src_install() {
121 @@ -501,9 +503,7 @@ src_install() {
122 newinitd "${FILESDIR}/gogs-initd" gogs
123
124 # Install HTTPS certs
125 - if use cert; then
126 - keepdir /etc/${PN}/https
127 - fi
128 + use cert && keepdir /etc/${PN}/https
129
130 # Install configuration files
131 insinto /etc/${PN}/conf
132 @@ -530,3 +530,8 @@ src_install() {
133 keepdir /var/log/${PN}
134 fowners -R gogs:git /var/log/${PN}
135 }
136 +
137 +pkg_postinst() {
138 + ewarn "You will not be able to run gogs via the command line."
139 + ewarn "Please use the installed service files."
140 +}