headscale-bin: Add -bin ebuild
Based on the gentoo headscale one, but using the official amd64 binary, as a lame workaround for the "improved" 0.17+ NIX buildsystem. Signed-off-by: Stefan Knoblich <stkn@bitplumber.de>
This commit is contained in:
50
net-vpn/headscale-bin/headscale-bin-0.17.1.ebuild
Normal file
50
net-vpn/headscale-bin/headscale-bin-0.17.1.ebuild
Normal file
@@ -0,0 +1,50 @@
|
||||
# Copyright 2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit systemd
|
||||
|
||||
DESCRIPTION="An open source, self-hosted implementation of the Tailscale control server"
|
||||
HOMEPAGE="https://github.com/juanfont/headscale"
|
||||
SRC_URI="https://github.com/juanfont/headscale/releases/download/v${PV}/headscale_${PV}_linux_amd64
|
||||
https://github.com/juanfont/headscale/archive/refs/tags/v${PV}.tar.gz -> headscale-${PV}.tar.gz"
|
||||
|
||||
LICENSE="BSD Apache-2.0 MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
S="${WORKDIR}/headscale-${PV}"
|
||||
|
||||
DEPEND="
|
||||
acct-group/headscale
|
||||
acct-user/headscale
|
||||
!net-vpn/headscale
|
||||
"
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
net-firewall/iptables
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/config-socket.patch
|
||||
)
|
||||
|
||||
src_compile() {
|
||||
cp "${DISTDIR}/headscale_${PV}_linux_amd64" headscale || die "Failed to copy headscale binary"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin headscale
|
||||
dodoc -r docs/* config-example.yaml
|
||||
keepdir /etc/headscale /var/lib/headscale
|
||||
systemd_dounit "${FILESDIR}"/headscale.service
|
||||
newconfd "${FILESDIR}"/headscale.confd headscale
|
||||
newinitd "${FILESDIR}"/headscale.initd headscale
|
||||
fowners -R ${PN}:${PN} /etc/headscale /var/lib/headscale
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
[[ -f "${EROOT}"/etc/headscale/config.yaml ]] && return
|
||||
elog "Please create ${EROOT}/etc/headscale/config.yaml before starting the service"
|
||||
elog "An example is in ${EROOT}/usr/share/doc/${PV}/config-example.yaml"
|
||||
}
|
||||
Reference in New Issue
Block a user