Template
62 lines
1.7 KiB
RPMSpec
62 lines
1.7 KiB
RPMSpec
# defining macros needed by SELinux
|
|
%global selinuxtype targeted
|
|
%global modulename ${REPO_NAME}
|
|
|
|
Name: ${REPO_NAME}-selinux
|
|
Version: 0.1.0
|
|
Release: %autorelease
|
|
License: GPLv3
|
|
URL: ${REPO_HTTPS_URL}
|
|
Summary: SELinux policy for ${REPO_NAME}
|
|
Source0: %{modulename}.fc
|
|
Source1: %{modulename}.if
|
|
Source2: %{modulename}.te
|
|
Source3: makefile
|
|
Source4: LICENSE
|
|
Source5: README.md
|
|
|
|
Requires: selinux-policy-%{selinuxtype}
|
|
Requires(post): selinux-policy-%{selinuxtype}
|
|
BuildRequires: selinux-policy-devel
|
|
BuildArch: noarch
|
|
%{?selinux_requires}
|
|
%description
|
|
Custom SELinux policy modules for ${REPO_NAME}.
|
|
|
|
%prep
|
|
%setup -c -T
|
|
%{__cp} %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} .
|
|
|
|
%build
|
|
make
|
|
|
|
%install
|
|
# install policy modules
|
|
%{__install} -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
|
|
%{__install} -D -p -m 0644 selinux/%{modulename}.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{modulename}.if
|
|
%check
|
|
|
|
%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
|
|
%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.*
|
|
%{_datadir}/selinux/devel/include/distributed/%{modulename}.if
|
|
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
|
|
%license LICENCE
|
|
%doc README.md
|
|
|
|
%changelog
|
|
%autochangelog
|