## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 5; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_without check %if 0%{?rhel} # No idea why this isn't working on EPEL builds... %define _debugsource_template %{nil} %endif Name: innernet Version: 1.6.0 Release: %autorelease URL: https://github.com/tonarino/innernet Summary: A private network system that uses WireGuard under the hood License: MIT Source0: https://github.com/tonarino/innernet/archive/refs/tags/v%{version}.tar.gz Patch0: 0001-hostsfile-Copy-the-SELinux-context-to-the-temp-file-.patch ExclusiveArch: %{rust_arches} BuildRequires: clang-devel BuildRequires: pkgconfig(libselinux) BuildRequires: pkgconfig(sqlite3) BuildRequires: systemd-rpm-macros %if 0%{?rhel} BuildRequires: epel-rpm-macros BuildRequires: rust-toolset %else BuildRequires: cargo BuildRequires: rust BuildRequires: rust-packaging %endif %global _description %{expand: innernet is a private network system that uses WireGuard under the hood. It aims to take advantage of existing networking concepts like CIDRs and the security properties of WireGuard to turn your computer's basic IP networking into more powerful ACL primitives. } %description %{_description} This package contains the innernet client. %package server Summary: A private network system that uses WireGuard under the hood (coordination server) License: MIT %description server %{_description} This package contains the innernet coordination server. %prep %autosetup -p1 %{name}-%{version} %build %if 0%{?rhel} %cargo_build --features selinux %else %cargo_build -f selinux %endif %install for bin in innernet innernet-server; do install -Dm 755 target/release/$bin -t %{buildroot}/%{_bindir} install -Dm 644 doc/$bin.8 -t %{buildroot}/%{_mandir}/man8 install -Dm 644 doc/$bin.completions.bash %{buildroot}/%{bash_completions_dir}/$bin install -Dm 644 doc/$bin.completions.fish %{buildroot}/%{fish_completions_dir}/$bin.fish install -Dm 644 doc/$bin.completions.zsh %{buildroot}/%{zsh_completions_dir}/_$bin done install -Dm 644 client/innernet.target -t %{buildroot}/%{_unitdir} install -Dm 644 client/innernet@.service -t %{buildroot}/%{_unitdir} install -Dm 644 server/innernet-server@.service -t %{buildroot}/%{_unitdir} %if %{with check} %check %cargo_test %endif # systemd_preun doesn't work with template units: # https://github.com/systemd/systemd/issues/15620 %preun if [ $1 -eq 0 ]; then systemctl --no-reload disable %{name}@.service || : systemctl stop '%{name}@*.service' || : fi %preun server if [ $1 -eq 0 ]; then systemctl --no-reload disable %{name}-server@.service || : systemctl stop '%{name}-server@*.service' || : fi %postun %systemd_postun_with_restart '%{name}@*.service' %postun server %systemd_postun_with_restart '%{name}-server@*.service' %files %license LICENSE %{_bindir}/%{name} %{_mandir}/man8/%{name}.8.gz %{_unitdir}/%{name}@.service %{_unitdir}/%{name}.target %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %files server %{_bindir}/%{name}-server %{_mandir}/man8/%{name}-server.8.gz %{_unitdir}/%{name}-server@.service %{bash_completions_dir}/%{name}-server %{fish_completions_dir}/%{name}-server.fish %{zsh_completions_dir}/_%{name}-server %changelog * Fri Jul 21 2023 Ryan Gonzalez - 1.6.0-5 - Backport SELinux fixes for hosts file editing * Thu Jul 20 2023 Ryan Gonzalez - 1.6.0-4 - Fix package updates disabling/stopping the systemd services * Thu Jul 20 2023 Ryan Gonzalez - 1.6.0-3 - [skip changelog] Add utility script for building * Thu Jul 20 2023 Ryan Gonzalez - 1.6.0-2 - Run tests as part of rpm checks * Wed Jul 19 2023 Ryan Gonzalez - 1.6.0-1 - Update to 1.6.0 * Wed Jul 19 2023 Ryan Gonzalez - 1.5.5-6 - Fix preun hook for the template units * Tue May 30 2023 Ryan Gonzalez - 1.5.5-5 - Split out server into innernet-server package * Tue May 30 2023 Ryan Gonzalez - 1.5.5-4 - Refresh netlink buffer size patch to latest iteration * Sun May 28 2023 Ryan Gonzalez - 1.5.5-3 - [skip changelog] Add CI * Sun May 28 2023 Ryan Gonzalez - 1.5.5-2 - Fix failing EPEL builds * Sat May 27 2023 Ryan Gonzalez - 1.5.5-1 - Initial import