Skip to content

Instantly share code, notes, and snippets.

@mochaaP
Last active May 5, 2023 14:02
Show Gist options
  • Save mochaaP/0d787e59d8444d578c6a8d00ef93c235 to your computer and use it in GitHub Desktop.
Save mochaaP/0d787e59d8444d578c6a8d00ef93c235 to your computer and use it in GitHub Desktop.
%global commit0 a3b934e7b2d13ecf05ff4521459ad2202a3a477b
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global selinuxtype targeted
%global modulename tailscaled
Name: tailscale-selinux
Version: 0.0.0
Release: 4%{?dist}
Summary: Tailscale SELinux policy
License: BSD
URL: https://github.com/mcha-forks/%{name}
BuildArch: noarch
Source0: %{url}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
BuildRequires: selinux-policy-devel
%{?selinux_requires}
%description
Tailscale VPN SELinux policy.
%prep
%autosetup -p1 -n %{name}-%{commit0}
%build
make -f %{_datadir}/selinux/devel/Makefile %{modulename}.pp
bzip2 -9 %{modulename}.pp
%install
install -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
%pre
%selinux_relabel_pre -s %{selinuxtype}
%post
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
%postun
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} %{modulename}
fi
%posttrans
%selinux_relabel_post -s %{selinuxtype}
%files
%license LICENSE
%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.*
%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
%changelog
* Fri May 5 2023 Zephyr Lykos <[email protected]> - 0.0.0-4
- Allow Caddy to issue certificates.
* Fri May 5 2023 Zephyr Lykos <[email protected]> - 0.0.0-3
- Misc fixes.
* Fri May 5 2023 Zephyr Lykos <[email protected]> - 0.0.0-2
- Move source to fork.
- Allow sys_ptrace.
* Thu May 4 2023 Zephyr Lykos <[email protected]> - 0.0.0-1
- First build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment