mcstrans/mcstrans.spec
2019-12-25 17:16:41 +08:00

102 lines
3.1 KiB
RPMSpec

Name: mcstrans
Version: 0.3.4
Release: 16
Summary: SELinux Translation Daemon
License: GPL2
URL: https://src.fedoraproject.org/rpms/mcstrans
Source0: https://src.fedoraproject.org/repo/pkgs/mcstrans/%{name}-%{version}.tgz
Source1: mcstransd.service
BuildRequires: gcc systemd-units
BuildRequires: libselinux-devel >= 1.30.3-1
BuildRequires: libcap-devel pcre-devel libsepol-devel libsepol-static
Requires: pcre
Requires(pre): systemd
Requires(post): systemd
Provides: libsetrans
Obsoletes: libsetrans
Provides: setransd
%description
Security-enhanced Linux is a feature of the Linux® kernel and a number
of utilities with enhanced security functionality designed to add
mandatory access controls to Linux. The Security-enhanced Linux
kernel contains new architectural components originally developed to
improve the security of the Flask operating system. These
architectural components provide general support for the enforcement
of many kinds of mandatory access control policies, including those
based on the concepts of Type Enforcement®, Role-based Access
Control, and Multi-level Security.
mcstrans provides an translation daemon to translate SELinux categories
from internal representations to user defined representation.
%package help
Summary: Mcstrans help document
%description help
mcstrans-help include help files for man page
%prep
%setup -q
%build
make clean
make CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" LIBDIR="%{_libdir}" %{?_smp_mflags}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/selinux/mls/setrans.d
mkdir -p %{buildroot}%{_usr}/share/mcstrans
mkdir -p %{buildroot}/%{_libdir}
mkdir -p %{buildroot}/%{_lib}
make SHLIBDIR="%{buildroot}/%{_lib}" SBINDIR="%{buildroot}%{_sbindir}" DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" install
rm -f %{buildroot}%{_libdir}/*.a
cp -r share/* %{buildroot}%{_usr}/share/mcstrans/
mkdir -p %{buildroot}%{_unitdir}
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/mcstrans
%post
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ]; then
/usr/bin/systemctl --no-reload mcstransd.service >/dev/null 2>&1 || :
/usr/bin/systemctl stop mcstransd.service > /dev/null 2>&1 || :
fi
%postun
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then
/usr/bin/systemctl try-restart mcstransd.service >/dev/null 2>&1 || :
fi
%files
%dir %{_sysconfdir}/selinux/mls/setrans.d
%{_unitdir}/mcstransd.service
/usr/sbin/mcstransd
%dir %{_usr}/share/mcstrans
%defattr(0644,root,root,0755)
%dir %{_usr}/share/mcstrans/util
%dir %{_usr}/share/mcstrans/examples
%{_usr}/share/mcstrans/examples/*
%defattr(0755,root,root,0755)
%{_usr}/share/mcstrans/util/*
%files help
%{_mandir}/man8/*.8.gz
%changelog
* Wed Dec 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.3.4-16
- Add missing URL
* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.3.4-15
- Adjust requires
* Wed Jul 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.3.4-14
- Package init