Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[policycoreutils] Update to 3.0. Contributes to JB#48729
  • Loading branch information
Lauri Kopo committed Jan 31, 2020
1 parent 4cf5b3e commit eb58cd0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 21 deletions.
18 changes: 15 additions & 3 deletions rpm/0002-fix_systemd_path.patch
@@ -1,15 +1,27 @@
From ef6dc2583233c3b1a4a59d36033f724166bd07eb Mon Sep 17 00:00:00 2001
From: Lauri Kopo <lauri.kopo@jolla.com>
Date: Tue, 28 Jan 2020 11:53:50 +0200
Subject: [PATCH] fix_systemd_path

---
restorecond/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/restorecond/Makefile b/restorecond/Makefile
index 25be18d4..65bd1775 100644
index 12452cd2..27062bc2 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -51,8 +51,8 @@ install: all
@@ -48,8 +48,8 @@ install: all
install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop
-mkdir -p $(DESTDIR)$(DBUSSERVICEDIR)
install -m 600 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service
install -m 644 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service
- -mkdir -p $(DESTDIR)$(SYSTEMDDIR)/system
- install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/system/
+ -mkdir -p $(DESTDIR)$(SYSTEMDDIR)/
+ install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/
relabel: install
/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond

--
2.24.1

58 changes: 41 additions & 17 deletions rpm/policycoreutils.spec
Expand Up @@ -21,10 +21,9 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

%global libauditver 2.1.3
%global libsepolver 2.8
%global libsemanagever 2.8
%global libselinuxver 2.8
%global sepolgenver 2.8
%global libsepolver 3.0
%global libsemanagever 3.0
%global libselinuxver 3.0

%global generatorsdir /lib/systemd/system-generators

Expand All @@ -38,10 +37,9 @@

Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.8
Version: 3.0
Release: 1
License: GPLv2
Group: System Environment/Base
Source: %{name}-%{version}.tar.bz2
URL: https://github.com/SELinuxProject
Source15: selinux-autorelabel
Expand Down Expand Up @@ -96,10 +94,7 @@ load_policy to load policies, setfiles to label filesystems, newrole
to switch roles.

%prep
%setup -q -n %{name}-%{version}/upstream
%patch0 -p1
%patch1 -p1
%patch2 -p1
%autosetup -p1 -n %{name}-%{version}/upstream

%build
make -C policycoreutils LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" SEMODULE_PATH="%{_sbindir}" LIBSEPOLA="%{_libdir}/libsepol.a" all
Expand Down Expand Up @@ -135,11 +130,14 @@ make -C restorecond PYTHON=%{__python3} DESTDIR="%{buildroot}" SBINDIR="%{_sbind
rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/restorecond

rm -f %{buildroot}/usr/share/man/man8/open_init_pty.8
rm -f %{buildroot}/usr/share/man/ru/man8/open_init_pty.8
rm -f %{buildroot}%{_sbindir}/open_init_pty
rm -f %{buildroot}%{_sbindir}/run_init
rm -f %{buildroot}/etc/pam.d/run_init*
rm -f %{buildroot}/usr/share/man/man8/sepolicy-gui.8*
rm -f %{buildroot}/usr/share/man/ru/man8/sepolicy-gui.8*
rm -f %{buildroot}/usr/share/man/man8/run_init.8*
rm -f %{buildroot}/usr/share/man/ru/man8/run_init.8*
rm -f %{buildroot}/usr/lib/python3.*/site-packages/sepolicy/sepolicy.glade
rm -f %{buildroot}/usr/lib/python3.*/site-packages/sepolicy/gui.py

Expand Down Expand Up @@ -204,7 +202,6 @@ an SELinux environment.

%package python3
Summary: SELinux policy core python3 interfaces
Group: System Environment/Base
Requires:policycoreutils = %{version}-%{release}
Requires:libsemanage-python3 >= %{libsemanagever} libselinux-python3 libcgroup
Requires:audit-libs-python3 >= %{libauditver}
Expand Down Expand Up @@ -238,7 +235,6 @@ by python 3 in an SELinux environment.

%package devel
Summary: SELinux policy core policy devel utilities
Group: System Environment/Base
Requires: policycoreutils-python-utils = %{version}-%{release}
Requires: /usr/bin/make
Requires: selinux-policy-devel
Expand All @@ -254,44 +250,74 @@ The policycoreutils-devel package contains the management tools use to develop p
/var/lib/sepolgen/perm_map
%{_bindir}/sepolicy
%{_mandir}/man8/sepolgen.8*
%{_mandir}/ru/man8/sepolgen.8*
%{_mandir}/man8/sepolicy-booleans.8*
%{_mandir}/ru/man8/sepolicy-booleans.8*
%{_mandir}/man8/sepolicy-generate.8*
%{_mandir}/ru/man8/sepolicy-generate.8*
%{_mandir}/man8/sepolicy-interface.8*
%{_mandir}/ru/man8/sepolicy-interface.8*
%{_mandir}/man8/sepolicy-network.8*
%{_mandir}/ru/man8/sepolicy-network.8*
%{_mandir}/man8/sepolicy.8*
%{_mandir}/ru/man8/sepolicy.8*
%{_mandir}/man8/sepolicy-communicate.8*
%{_mandir}/ru/man8/sepolicy-communicate.8*
%{_mandir}/man8/sepolicy-manpage.8*
%{_mandir}/ru/man8/sepolicy-manpage.8*
%{_mandir}/man8/sepolicy-transition.8*
%{_mandir}/ru/man8/sepolicy-transition.8*
%{_usr}/share/bash-completion/completions/sepolicy
%{_bindir}/semodule_expand
%{_bindir}/semodule_link
%{_bindir}/semodule_unpackage
%{_mandir}/man8/semodule_expand.8*
%{_mandir}/ru/man8/semodule_expand.8*
%{_mandir}/man8/semodule_link.8*
%{_mandir}/ru/man8/semodule_link.8*
%{_mandir}/man8/semodule_unpackage.8*
%{_mandir}/ru/man8/semodule_unpackage.8*
%{_mandir}/man5/selinux_config.5.gz
%{_mandir}/ru/man5/selinux_config.5.gz
%{_mandir}/man5/sestatus.conf.5.gz
%{_mandir}/ru/man5/sestatus.conf.5.gz
%{_mandir}/man8/fixfiles.8*
%{_mandir}/ru/man8/fixfiles.8*
%{_mandir}/man8/load_policy.8*
%{_mandir}/ru/man8/load_policy.8*
%{_mandir}/man8/restorecon.8*
%{_mandir}/ru/man8/restorecon.8*
%{_mandir}/man8/restorecon_xattr.8*
%{_mandir}/ru/man8/restorecon_xattr.8*
%{_mandir}/man8/semodule.8*
%{_mandir}/ru/man8/semodule.8*
%{_mandir}/man8/sestatus.8*
%{_mandir}/ru/man8/sestatus.8*
%{_mandir}/man8/setfiles.8*
%{_mandir}/ru/man8/setfiles.8*
%{_mandir}/man8/setsebool.8*
%{_mandir}/ru/man8/setsebool.8*
%{_mandir}/man1/secon.1*
%{_mandir}/ru/man1/secon.1*
%{_mandir}/man8/genhomedircon.8*
%{_mandir}/ru/man8/genhomedircon.8*
%{_mandir}/man1/newrole.1.gz
%{_mandir}/ru/man1/newrole.1.gz
%{_mandir}/man8/restorecond.8*
%{_mandir}/ru/man8/restorecond.8*
%{_mandir}/man1/audit2allow.1*
%{_mandir}/ru/man1/audit2allow.1*
%{_mandir}/man8/semodule_package.8*
%{_mandir}/ru/man8/semodule_package.8*
%{_mandir}/man1/audit2why.1*
%{_mandir}/ru/man1/audit2why.1*
%{_mandir}/man8/chcat.8*
%{_mandir}/ru/man8/chcat.8*
%{_mandir}/man8/semanage*.8*
%{_mandir}/ru/man8/semanage*.8*

%package newrole
Summary: The newrole application for RBAC/MLS
Group: System Environment/Base
Requires: policycoreutils = %{version}-%{release}

%description newrole
Expand Down Expand Up @@ -322,13 +348,11 @@ or level of a logged in user.
%{generatorsdir}/selinux-autorelabel-generator.sh
%config %{_sysconfdir}/sestatus.conf
# selinux-policy Requires: policycoreutils, so we own this set of directories and our files within them
%doc policycoreutils/COPYING
%license policycoreutils/COPYING
%doc %{_usr}/share/doc/%{name}

%package restorecond
Summary: SELinux restorecond utilities
Group: System Environment/Base
#BuildRequires: systemd-units

%description restorecond
The policycoreutils-restorecond package contains the restorecond service.
Expand All @@ -340,7 +364,7 @@ The policycoreutils-restorecond package contains the restorecond service.
%config %{_sysconfdir}/selinux/restorecond_user.conf
%{_sysconfdir}/xdg/autostart/restorecond.desktop
%{_datadir}/dbus-1/services/org.selinux.Restorecond.service
%doc policycoreutils/COPYING
%license policycoreutils/COPYING

%post restorecond
%systemd_post restorecond.service
Expand Down
2 changes: 1 addition & 1 deletion upstream
Submodule upstream updated from a9f8a1 to dca7ce

0 comments on commit eb58cd0

Please sign in to comment.