Integrate SELinux policy into build system

Hook up the new policy to autoconf and automake.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Christian Heimes
2020-03-05 09:57:00 +01:00
parent 5b573bb9a3
commit 9288901f9b
6 changed files with 54 additions and 7 deletions
+4
View File
@@ -182,3 +182,7 @@ ipatests/i18n.py
ipatests/ipa-run-tests
ipatests/ipa-test-config
ipatests/ipa-test-task
selinux/tmp
selinux/*.pp
selinux/*.pp.bz2
+1 -1
View File
@@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I m4
if ENABLE_SERVER
IPASERVER_SUBDIRS = ipaserver
SERVER_SUBDIRS = daemons init install
SERVER_SUBDIRS = daemons init install selinux
endif
if WITH_IPATESTS
+1
View File
@@ -578,6 +578,7 @@ AC_CONFIG_FILES([
pypi/ipatests/Makefile
po/Makefile.in
po/Makefile.hack
selinux/Makefile
util/Makefile
])
+1 -6
View File
@@ -367,7 +367,7 @@ Requires: sssd-dbus >= %{sssd_version}
# This ensures that the *-selinux package and all its dependencies are not pulled
# into containers and other systems that do not use SELinux
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
%endif # if with_selinux
%endif
Provides: %{alt_name}-server = %{version}
Conflicts: %{alt_name}-server
@@ -870,11 +870,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/cron.d
# ONLY_CLIENT
%endif
%if 0%{?with_selinux}
install -D -m 0644 selinux/%{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
# with_selinux
%endif
%clean
rm -rf %{buildroot}
+35
View File
@@ -0,0 +1,35 @@
SELINUXTYPE = targeted
NULL =
if BUILD_SELINUX_POLICY
MODULE = ipa.pp.bz2
MODULE_IF = ipa.if
else
MODULE =
MODULE_IF =
endif
dist_noinst_DATA = \
ipa.fc \
ipa.if \
ipa.te \
$(NULL)
# selinuxincludedir = $(datarootdir)/selinux/devel/include/contrib
# nodist_selinuxinclude_DATA = \
# $(MODULE_IF) \
# $(NULL)
selinuxpolicydir = $(datarootdir)/selinux/packages/$(SELINUXTYPE)
nodist_selinuxpolicy_DATA = \
$(MODULE) \
$(NULL)
%.pp.bz2: %.pp
bzip2 -f -9 $^
%.pp: %.te %.fc %.if
make -f $(selinux_makefile) $@
clean-local:
rm -f *~ *.tc *.pp *.pp.bz2
+12
View File
@@ -168,3 +168,15 @@ AC_ARG_WITH([systemdtmpfilesdir],
[systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
AC_SUBST([systemdtmpfilesdir])
dnl ---------------------------------------------------------------------------
dnl - Check for SELinux policy devel
dnl ---------------------------------------------------------------------------
selinux_makefile=/usr/share/selinux/devel/Makefile
AC_SUBST([selinux_makefile])
AC_CHECK_FILE([$selinux_makefile],
[build_selinux=yes],
[build_selinux=no])
AM_CONDITIONAL(BUILD_SELINUX_POLICY, test x$build_selinux = xyes)