# 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" }