URL: https://github.com/freeipa/freeipa/pull/1931
Author: abbra
 Title: #1931: Install shared templates for client setup too
Action: opened

PR body:
"""
This patchset updates a spec file and our Make files to allow installing shared 
templates for the client build as well. So far we only have a single template 
for krb5.conf.d (freeipa.template) but there might be potentially more coming 
in.

This is a proper solution -- in Fedora 28/29 builds downstream I'm copying the 
files manually to avoid re-spinning a tarball with 4.7.0rc2. We still need to 
filter out client side templates from the server side in the spec file, so 
there is not a single place to define all files, unfortunately, but that's good 
enough for now as we have only a single file used by the client side.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1931/head:pr1931
git checkout pr1931
From ecb7e5512d808c6146de715ed407b03dc3e970ef Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <aboko...@redhat.com>
Date: Wed, 16 May 2018 09:14:38 +0300
Subject: [PATCH 1/2] Do not package freeipa.template twice

freeipa.template should be packaged in freeipa-client-common
The rest of templates in /usr/share/ipa should go to freeipa-server-common

Fenerate file with server templates via find. Since we only need those
at /usr/share/ipa and not in subfolders, synthesize whole path based
on the name. This also gives us an easier way to get rid of the
%{buildroot} prefix.

Use -f option to %files to pass server templates file
---
 freeipa.spec.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 3d75898148..5612e22eff 100755
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -1106,6 +1106,8 @@ touch %{buildroot}%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
 mkdir -p %{buildroot}%{_sysconfdir}/cron.d
 %endif # ONLY_CLIENT
 
+# Collect templates and filter out non-server ones
+find %{buildroot}%{_usr}/share/ipa -maxdepth 1 -name '*.template' -a ! -name 'freeipa.template' -fprintf server-templates '%{_usr}/share/ipa/%f\n'
 
 %clean
 rm -rf %{buildroot}
@@ -1398,7 +1400,7 @@ fi
 %endif # with_python3
 
 
-%files server-common
+%files server-common -f server-templates
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
 %license COPYING
@@ -1414,7 +1416,6 @@ fi
 %{_usr}/share/ipa/kdcproxy.wsgi
 %{_usr}/share/ipa/*.ldif
 %{_usr}/share/ipa/*.uldif
-%{_usr}/share/ipa/*.template
 %dir %{_usr}/share/ipa/advise
 %dir %{_usr}/share/ipa/advise/legacy
 %{_usr}/share/ipa/advise/legacy/*.template

From 4365ba64d8e6fcf70cb5966f2a05178ae4874249 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <aboko...@redhat.com>
Date: Wed, 16 May 2018 10:43:05 +0300
Subject: [PATCH 2/2] Handle install of shared templates for the client build
 as well

FreeIPA has two major build modes and this affects how content
from install/share is handled:

 - server build: everything from install/share is installed
 - client build: only selected templates from install/share are
   installed

This change is needed to allow us reusing the same krb5.conf snippets
for both builds right now.
---
 Makefile.am               |  4 ++--
 install/Makefile.am       | 10 +++++++++-
 install/share/Makefile.am | 18 +++++++++++++++++-
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ba4abf7c55..688008f294 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,14 +2,14 @@ ACLOCAL_AMFLAGS = -I m4
 
 if ENABLE_SERVER
     IPASERVER_SUBDIRS = ipaserver
-    SERVER_SUBDIRS = daemons init install
+    SERVER_SUBDIRS = daemons init
 endif
 
 if WITH_IPATESTS
     IPATESTS_SUBDIRS = ipatests
 endif
 
-IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython
+IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython install
 PYTHON_SUBDIRS = $(IPACLIENT_SUBDIRS) $(IPATESTS_SUBDIRS) $(IPASERVER_SUBDIRS)
 IPA_PLACEHOLDERS = freeipa ipa ipaserver ipatests
 SUBDIRS = asn1 util client contrib po pypi $(PYTHON_SUBDIRS) $(SERVER_SUBDIRS)
diff --git a/install/Makefile.am b/install/Makefile.am
index caff1be574..92a08d5a44 100644
--- a/install/Makefile.am
+++ b/install/Makefile.am
@@ -4,7 +4,8 @@ AUTOMAKE_OPTIONS = 1.7
 
 NULL =
 
-SUBDIRS =			\
+if ENABLE_SERVER
+SERVER_SUBDIRS =		\
         certmonger		\
         html			\
         migration		\
@@ -16,7 +17,13 @@ SUBDIRS =			\
         wsgi			\
         oddjob			\
 	$(NULL)
+endif
 
+SUBDIRS = share 		\
+	  $(SERVER_SUBDIRS)	\
+	  $(NULL)
+
+if ENABLE_SERVER
 install-exec-local:
 	$(INSTALL) -d -m 700 $(DESTDIR)$(IPA_SYSCONF_DIR)/custodia
 	$(INSTALL) -d -m 700 $(DESTDIR)$(localstatedir)/lib/ipa/backup
@@ -37,3 +44,4 @@ uninstall-local:
 	-rmdir $(DESTDIR)$(localstatedir)/lib/ipa
 
 EXTRA_DIST = README.schema
+endif
diff --git a/install/share/Makefile.am b/install/share/Makefile.am
index fefcd1e66d..c629d2a921 100644
--- a/install/share/Makefile.am
+++ b/install/share/Makefile.am
@@ -1,12 +1,20 @@
 NULL =
+appdir = $(IPA_DATA_DIR)
 
+# FreeIPA has two major build modes:
+# server build: full install is needed
+# client build: only few templates needed
+#
+# If changes or additions required, make
+# sure to handle both branches of the
+# following conditional
+if ENABLE_SERVER
 SUBDIRS =  				\
 	advise				\
 	profiles			\
 	schema.d			\
 	$(NULL)
 
-appdir = $(IPA_DATA_DIR)
 dist_app_DATA =				\
 	05rfc2247.ldif			\
 	15rfc2307bis.ldif		\
@@ -100,3 +108,11 @@ dist_app_DATA =				\
 kdcproxyconfdir = $(IPA_SYSCONF_DIR)/kdcproxy
 dist_kdcproxyconf_DATA =			\
 	kdcproxy.conf
+else
+# For the client build we have a separate setup
+
+dist_app_DATA =				\
+	freeipa.template		\
+	$(NULL)
+
+endif
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to