# Generated by go2rpm 1.9.0 %bcond_without check # https://github.com/juanfont/headscale %global goipath github.com/juanfont/headscale Version: 0.23.0 %gometa -f %global common_description %{expand: An open source, self-hosted implementation of the Tailscale control server.} %global golicenses LICENSE %global godocs docs CODE_OF_CONDUCT.md CHANGELOG.md\\\ README.md integration/README.md Name: headscale Release: 1%{?dist} Summary: An open source, self-hosted implementation of the Tailscale control server License: BSD-3-Clause URL: %{gourl} Source0: https://%{goipath}/archive/refs/tags/v%{version}.tar.gz Source1: headscale.sysusers BuildRequires: systemd-units BuildRequires: systemd-rpm-macros BuildRequires: git BuildRequires: golang >= 1.20 %{?sysusers_requires_compat} Requires: systemd-units %global debug_package %{nil} %description %{common_description} %prep %setup -q -n %{name}-%{version} %build %define tags ts2019 %define ldflags "-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=%{version}-%{release}" export GOTOOLCHAIN=auto export GOSUMDB="sum.golang.org" go build -o headscale -buildmode=pie -compiler gc -gcflags -trimpath -ldflags %{ldflags} -tags %{tags} ./cmd/headscale %install install -d %{buildroot}%{_rundir}/headscale install -d %{buildroot}%{_sharedstatedir}/headscale install -m 0755 -v -p -D headscale %{buildroot}%{_bindir}/headscale install -m 0644 -v -p -D config-example.yaml %{buildroot}%{_sysconfdir}/headscale/config.yaml install -m 0644 -v -p -D docs/packaging/headscale.systemd.service %{buildroot}%{_unitdir}/headscale.service install -m 0644 -v -p -D %{SOURCE1} %{buildroot}%{_sysusersdir}/headscale.conf %pre %sysusers_create_compat %{SOURCE1} %post chown -R headscale:headscale %{_rundir}/headscale chown -R headscale:headscale %{_sharedstatedir}/headscale %files %license LICENSE %doc docs CODE_OF_CONDUCT.md CHANGELOG.md README.md %doc integration/README.md %{_bindir}/headscale %config(noreplace) %{_sysconfdir}/headscale/config.yaml %{_sysusersdir}/headscale.conf %{_unitdir}/headscale.service %dir %{_rundir}/headscale %dir %{_sharedstatedir}/headscale %changelog %autochangelog