First selinux policy package
This commit is contained in:
78
fedora/SPECS/danweb2-selinux.spec
Normal file
78
fedora/SPECS/danweb2-selinux.spec
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
%define myname danweb2
|
||||||
|
%global selinuxtype targeted
|
||||||
|
%global moduletype services
|
||||||
|
%global modulenames %{myname}
|
||||||
|
|
||||||
|
# Relabel files
|
||||||
|
%global relabel_files() \ # ADD files in *.fc file
|
||||||
|
|
||||||
|
|
||||||
|
# Version of distribution SELinux policy package
|
||||||
|
# rpm -q selinux-policy
|
||||||
|
%global selinux_policyver 3.14.0
|
||||||
|
|
||||||
|
# Package information
|
||||||
|
Name: %{myname}-selinux
|
||||||
|
Version: 1.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
License: GPLv2
|
||||||
|
Group: System Environment/Base
|
||||||
|
Summary: SELinux Policies for %{myname}
|
||||||
|
BuildArch: noarch
|
||||||
|
URL: https://www.dsteiner.ch
|
||||||
|
Requires(post): selinux-policy-base >= %{selinux_policyver},
|
||||||
|
Requires(post): selinux-policy-targeted >= %{selinux_policyver}
|
||||||
|
Requires(post): policycoreutils
|
||||||
|
Requires(post): policycoreutils-python-utils
|
||||||
|
Requires(post): libselinux-utils
|
||||||
|
BuildRequires: selinux-policy selinux-policy-devel
|
||||||
|
|
||||||
|
Source: selinux-%{myname}.tar
|
||||||
|
|
||||||
|
%description
|
||||||
|
SELinux policy modules for use on %{myname}
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n selinux
|
||||||
|
|
||||||
|
%build
|
||||||
|
# link Makefile to source dir:
|
||||||
|
ln -s /usr/share/selinux/devel/Makefile
|
||||||
|
make
|
||||||
|
|
||||||
|
%install
|
||||||
|
|
||||||
|
# Install SELinux interfaces
|
||||||
|
export INTERFACES="$(ls *.if)"
|
||||||
|
install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
||||||
|
install -p -m 644 $INTERFACES \
|
||||||
|
%{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
||||||
|
|
||||||
|
# Install policy modules
|
||||||
|
export MODULES="$(ls *.pp)"
|
||||||
|
install -d %{buildroot}%{_datadir}/selinux/packages
|
||||||
|
install -m 0644 $MODULES \
|
||||||
|
%{buildroot}%{_datadir}/selinux/packages
|
||||||
|
|
||||||
|
%post
|
||||||
|
#
|
||||||
|
# Install all modules in a single transaction
|
||||||
|
#
|
||||||
|
export MODULES="$(ls %{_datadir}/selinux/packages/*.pp)"
|
||||||
|
%selinux_modules_install -s %{selinuxtype} $MODULES
|
||||||
|
|
||||||
|
%postun
|
||||||
|
export MODULES="$(rpm -ql %{name} | grep '.pp$')"
|
||||||
|
if [ $1 -eq 0 ]; then
|
||||||
|
%selinux_modules_uninstall -s %{selinuxtype} $MODULES
|
||||||
|
fi
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,0755)
|
||||||
|
%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
|
||||||
|
%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sat Sep 12 2020 <daniel.steiner@dsteiner.ch>
|
||||||
|
- Additional selinux modules for danweb2 server
|
||||||
|
|
||||||
Reference in New Issue
Block a user