aboutsummaryrefslogtreecommitdiff
path: root/dev-vcs/git-srht/git-srht-0.83.1.ebuild
blob: 459a40189f44f4d9eb1488173907235eb3463bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_10 )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 go-module optfeature systemd

DESCRIPTION="sr.ht git services"
HOMEPAGE="https://git.sr.ht/~sircmpwn/git.sr.ht"
SRC_URI="http://git.sr.ht/~sircmpwn/git.sr.ht/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="network-sandbox"

RDEPEND=""
DEPEND="${RDEPEND}
	acct-user/git-srht
	acct-group/git-srht
	dev-python/scm-srht[${PYTHON_USEDEP}]
	dev-python/core-srht[${PYTHON_USEDEP}]
	dev-python/pygit2[${PYTHON_USEDEP}]
	dev-python/minio[${PYTHON_USEDEP}]
	net-libs/meta-srht
"
BDEPEND="net-libs/nodejs
	dev-lang/sassc
	dev-lang/go
"

S="${WORKDIR}/git.sr.ht-${PV}"

src_unpack() {
	default_src_unpack
}

src_compile() {
	distutils-r1_src_compile
	cd "${S}/gitsrht-dispatch" || die
	ego build
	cd "${S}/gitsrht-shell" || die
	ego build
	cd "${S}/gitsrht-keys" || die
	ego build
	cd "${S}/gitsrht-update-hook" || die
	ego build
	cd "${S}/api" || die
	ego build -o gitsrht-api
}

src_install() {
	distutils-r1_src_install
	dodir "/etc/sr.ht"
	insinto "/etc/sr.ht/"
	newins "${S}/config.example.ini" "config.example.git.sr.ht.ini"
	dobin "${S}/gitsrht-dispatch/gitsrht-dispatch"
	dobin "${S}/gitsrht-shell/gitsrht-shell"
	dobin "${S}/gitsrht-keys/gitsrht-keys"
	dobin "${S}/gitsrht-update-hook/gitsrht-update-hook"
	dobin "${S}/api/gitsrht-api"
	exeinto "/etc/cron.hourly"
	doexe "${FILESDIR}/git.sr.ht.cron"
	newinitd "${FILESDIR}/git.sr.ht.initd" "git.sr.ht"
	newconfd "${FILESDIR}/git.sr.ht.confd" "git.sr.ht"
	newinitd "${FILESDIR}/git.sr.ht-api.initd" "git.sr.ht-api"
	newconfd "${FILESDIR}/git.sr.ht-api.confd" "git.sr.ht-api"
	newinitd "${FILESDIR}/git.sr.ht-webhooks.initd" "git.sr.ht-webhooks"
	systemd_dounit "${FILESDIR}/git.sr.ht.service"
	systemd_dounit "${FILESDIR}/git.sr.ht-api.service"
	systemd_dounit "${FILESDIR}/git.sr.ht-webhooks.service"
	systemd_dounit "${FILESDIR}/git.sr.ht-periodic.service"
	systemd_dounit "${FILESDIR}/git.sr.ht-periodic.timer"
}

plg_postinst() {
	optfeature "builds.sr.ht integration" "dev-util/builds-srht"
	optfeature "periodic tasks" "virtual/cron"
}