| |
@@ -1,7 +1,12 @@
|
| |
+ # Defining macros needed by SELinux
|
| |
+ %global with_selinux 1
|
| |
+ %global modulename gpm
|
| |
+ %global selinuxtype targeted
|
| |
+
|
| |
Summary: A mouse server for the Linux console
|
| |
Name: gpm
|
| |
Version: 1.20.7
|
| |
- Release: 27%{?dist}
|
| |
+ Release: 28%{?dist}
|
| |
License: GPLv2 and OFSFDL
|
| |
URL: http://www.nico.schottelius.org/software/gpm/
|
| |
#URL2 : http://freecode.com/projects/gpm
|
| |
@@ -17,6 +22,11 @@
|
| |
|
| |
Source: %{name}-%{version}.tar.xz
|
| |
Source1: gpm.service
|
| |
+ # selinux policy (extracted from
|
| |
+ # https://github.com/fedora-selinux/selinux-policy/tree/rawhide/policy/modules/contrib)
|
| |
+ Source100: %{modulename}.te
|
| |
+ Source101: %{modulename}.if
|
| |
+ Source102: %{modulename}.fc
|
| |
Patch0: https://github.com/telmich/gpm/compare/1.20.7...e82d1a653ca94aa4ed12441424da6ce780b1e530.diff
|
| |
Patch1: gpm-1.20.6-multilib.patch
|
| |
Patch2: gpm-1.20.1-lib-silent.patch
|
| |
@@ -37,6 +47,11 @@
|
| |
BuildRequires: make
|
| |
Requires: linuxconsoletools
|
| |
Requires: %{name}-libs = %{version}-%{release}
|
| |
+ %if 0%{?with_selinux}
|
| |
+ # This ensures that the *-selinux package and all it’s dependencies are not pulled
|
| |
+ # into containers and other systems that do not use SELinux
|
| |
+ Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
|
| |
+ %endif
|
| |
|
| |
%description
|
| |
Gpm provides mouse support to text-based Linux applications like the
|
| |
@@ -70,6 +85,19 @@
|
| |
The gpm-static package includes static libraries of gpm. The gpm provides
|
| |
mouse support to text-based Linux applications.
|
| |
|
| |
+ %if 0%{?with_selinux}
|
| |
+ # SELinux subpackage
|
| |
+ %package selinux
|
| |
+ Summary: %{name} SELinux policy
|
| |
+ BuildArch: noarch
|
| |
+ Requires: selinux-policy-%{selinuxtype}
|
| |
+ Requires(post): selinux-policy-%{selinuxtype}
|
| |
+ BuildRequires: selinux-policy-devel
|
| |
+ %{?selinux_requires}
|
| |
+
|
| |
+ %description selinux
|
| |
+ Custom SELinux policy module
|
| |
+ %endif
|
| |
|
| |
%prep
|
| |
%setup -q
|
| |
@@ -87,6 +115,16 @@
|
| |
%configure
|
| |
%make_build
|
| |
|
| |
+ %if 0%{?with_selinux}
|
| |
+ # SELinux policy (originally from selinux-policy-contrib)
|
| |
+ # this policy module will override the production module
|
| |
+ mkdir selinux
|
| |
+ cp -p %{SOURCE100} %{SOURCE101} %{SOURCE102} selinux/
|
| |
+
|
| |
+ make -f %{_datadir}/selinux/devel/Makefile %{modulename}.pp
|
| |
+ bzip2 -9 %{modulename}.pp
|
| |
+ %endif
|
| |
+
|
| |
%install
|
| |
%make_install
|
| |
|
| |
@@ -111,6 +149,10 @@
|
| |
rm -rf %{buildroot}%{_mandir}
|
| |
%endif
|
| |
|
| |
+ %if 0%{?with_selinux}
|
| |
+ install -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
|
| |
+ %endif
|
| |
+
|
| |
%post
|
| |
%ifnarch s390 s390x
|
| |
%systemd_post gpm.service
|
| |
@@ -128,6 +170,30 @@
|
| |
|
| |
%ldconfig_scriptlets libs
|
| |
|
| |
+ %if 0%{?with_selinux}
|
| |
+ # SELinux contexts are saved so that only affected files can be
|
| |
+ # relabeled after the policy module installation
|
| |
+ %pre selinux
|
| |
+ %selinux_relabel_pre -s %{selinuxtype}
|
| |
+
|
| |
+ %post selinux
|
| |
+ %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
|
| |
+ %selinux_relabel_post -s %{selinuxtype}
|
| |
+
|
| |
+ if [ "$1" -le "1" ]; then # First install
|
| |
+ # the daemon needs to be restarted for the custom label to be applied
|
| |
+ %systemd_postun_with_restart %{modulename}.service
|
| |
+ fi
|
| |
+
|
| |
+ %postun selinux
|
| |
+ if [ $1 -eq 0 ]; then
|
| |
+ %selinux_modules_uninstall -s %{selinuxtype} %{modulename}
|
| |
+ %selinux_relabel_post -s %{selinuxtype}
|
| |
+ # the daemon needs to be restarted for the custom label to be removed
|
| |
+ %systemd_postun_with_restart %{modulename}.service
|
| |
+ fi
|
| |
+ %endif
|
| |
+
|
| |
%files
|
| |
%doc COPYING README TODO
|
| |
%doc doc/README* doc/FAQ doc/Announce doc/changelog
|
| |
@@ -150,7 +216,17 @@
|
| |
%files static
|
| |
%{_libdir}/libgpm.a
|
| |
|
| |
+ %if 0%{?with_selinux}
|
| |
+ %files selinux
|
| |
+ %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.*
|
| |
+ %ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
|
| |
+ %endif
|
| |
+
|
| |
%changelog
|
| |
+ * Wed Apr 28 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-28
|
| |
+ - Add selinux subpackage
|
| |
+ See https://fedoraproject.org/wiki/SELinux/IndependentPolicy
|
| |
+
|
| |
* Wed Mar 24 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-27
|
| |
- Fix License tag
|
| |
|
| |
Not present anymore.