Diff gitea-1.8.3 with a gitea-1.9.5

/usr/portage/www-apps/gitea/gitea-1.9.5.ebuild 2019-11-07 09:09:00.000000000 +0300
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=7
5
inherit golang-vcs-snapshot systemd user
5
inherit golang-vcs-snapshot tmpfiles systemd
6 6

  
7 7
EGO_PN="code.gitea.io/gitea"
8 8

  
......
10 10
HOMEPAGE="https://gitea.io"
11 11
SRC_URI="https://github.com/go-gitea/gitea/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 12

  
13
LICENSE="MIT"
13
LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
14 14
SLOT="0"
15 15
KEYWORDS="~amd64 ~arm ~arm64"
16
IUSE="pam sqlite"
16
IUSE="+acct pam sqlite"
17 17

  
18
COMMON_DEPEND="pam? ( sys-libs/pam )"
19
DEPEND="${COMMON_DEPEND}
20
	dev-go/go-bindata"
18
BDEPEND="<dev-lang/go-1.13"
19
COMMON_DEPEND="
20
	acct? (
21
		acct-group/git
22
		acct-user/git[gitea]
23
	)
24
	pam? ( sys-libs/pam )"
25
DEPEND="${COMMON_DEPEND}"
21 26
RDEPEND="${COMMON_DEPEND}
22 27
	dev-vcs/git"
23 28

  
24 29
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
25 30
S="${WORKDIR}/${P}/src/${EGO_PN}"
26 31

  
27
pkg_setup() {
28
	enewgroup git
29
	enewuser git -1 /bin/bash /var/lib/gitea git
30
}
32
PATCHES=( "${FILESDIR}/gitea-mod-vendor.patch" "${FILESDIR}/gitea-logflags.patch" )
31 33

  
32 34
gitea_make() {
33 35
	local my_tags=(
......
38 40
	local my_makeopt=(
39 41
		DRONE_TAG=${PV}
40 42
		TAGS="${my_tags[@]}"
43
		LDFLAGS="-extldflags \"${LDFLAGS}\""
41 44
	)
42 45
	GOPATH=${WORKDIR}/${P}:$(get_golibdir_gopath) emake "${my_makeopt[@]}" "$@"
43 46
}
44 47

  
45 48
src_prepare() {
46 49
	default
47
	sed -i \
48
		-e "s#^RUN_MODE = dev#RUN_MODE = prod#"                                     \
49
		-e "s#^ROOT =#ROOT = ${EPREFIX}/var/lib/gitea/gitea-repositories#"          \
50
		-e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#"                   \
51
		-e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${EPREFIX}/var/lib/gitea/data#" \
52
		-e "s#^HTTP_ADDR = 0.0.0.0#HTTP_ADDR = 127.0.0.1#"                          \
53
		-e "s#^MODE = console#MODE = file#"                                         \
54
		-e "s#^LEVEL = Trace#LEVEL = Info#"                                         \
55
		-e "s#^LOG_SQL = true#LOG_SQL = false#"                                     \
56
		-e "s#^DISABLE_ROUTER_LOG = false#DISABLE_ROUTER_LOG = true#"               \
57
		-e "s#^APP_ID =#;APP_ID =#"                                                 \
58
		-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#"                                 \
59
		custom/conf/app.ini.sample || die
50

  
51
	local sedcmds=(
52
		-e "s#^RUN_MODE = dev#RUN_MODE = prod#"
53
		-e "s#^ROOT =#ROOT = ${EPREFIX}/var/lib/gitea/gitea-repositories#"
54
		-e "s#^ROOT_PATH =#ROOT_PATH = ${EPREFIX}/var/log/gitea#"
55
		-e "s#^APP_DATA_PATH = data#APP_DATA_PATH = ${EPREFIX}/var/lib/gitea/data#"
56
		-e "s#^HTTP_ADDR = 0.0.0.0#HTTP_ADDR = 127.0.0.1#"
57
		-e "s#^MODE = console#MODE = file#"
58
		-e "s#^LEVEL = Trace#LEVEL = Info#"
59
		-e "s#^LOG_SQL = true#LOG_SQL = false#"
60
		-e "s#^DISABLE_ROUTER_LOG = false#DISABLE_ROUTER_LOG = true#"
61
		-e "s#^APP_ID =#;APP_ID =#"
62
		-e "s#^TRUSTED_FACETS =#;TRUSTED_FACETS =#"
63
	)
64

  
65
	sed -i "${sedcmds[@]}" custom/conf/app.ini.sample || die
60 66
	if use sqlite ; then
61 67
		sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
62 68
	fi
......
68 74
	gitea_make build
69 75
}
70 76

  
71
src_test() {
72
	gitea_make test
73
}
74

  
75 77
src_install() {
76 78
	dobin gitea
77 79

  
78 80
	einstalldocs
79 81

  
80
	newconfd "${FILESDIR}"/gitea.confd-r1 gitea
81
	newinitd "${FILESDIR}"/gitea.initd-r3 gitea
82
	newconfd "${FILESDIR}/gitea.confd-r1" gitea
83
	newinitd "${FILESDIR}/gitea.initd-r3" gitea
84
	newtmpfiles - gitea.conf <<-EOF
85
		d /run/gitea 0755 git git
86
	EOF
82 87
	systemd_newunit "${FILESDIR}"/gitea.service-r2 gitea.service
83 88

  
84 89
	insinto /etc/gitea
85 90
	newins custom/conf/app.ini.sample app.ini
86
	fowners root:git /etc/gitea/{,app.ini}
87
	fperms g+w,o-rwx /etc/gitea/{,app.ini}
88

  
89
	diropts -m0750 -o git -g git
90
	keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
91
	keepdir /var/log/gitea
91
	if use acct ; then
92
		fowners root:git /etc/gitea/{,app.ini}
93
		fperms g+w,o-rwx /etc/gitea/{,app.ini}
94

  
95
		diropts -m0750 -o git -g git
96
		keepdir /var/lib/gitea /var/lib/gitea/custom /var/lib/gitea/data
97
		keepdir /var/log/gitea
98
	fi
92 99
}
93 100

  
94 101
pkg_postinst() {
Thank you!