Fixes https://fedorahosted.org/sssd/ticket/1158

From 5ae7edbfde35ced059a7cf8115ca5c42bd32a887 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <[email protected]>
Date: Mon, 30 Jan 2012 09:56:52 -0500
Subject: [PATCH] SSSDConfigAPI: Move sssd.api.* to /usr/share/sssd

https://fedorahosted.org/sssd/ticket/1158
---
 Makefile.am              |    6 ++++--
 contrib/sssd.spec.in     |    9 +++------
 src/config/SSSDConfig.py |    8 ++++----
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index db00f98b5d1d0b91c20aac3063154565eda99a49..839c608d16f9d294610263a01806668145de1639 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,8 @@ if BUILD_KRB5_LOCATOR_PLUGIN
 krb5plugindir = @krb5pluginpath@
 endif
 sssdconfdir = $(sysconfdir)/sssd
-sssdapiplugindir = $(sssdconfdir)/sssd.api.d
+sssddatadir = $(datadir)/sssd
+sssdapiplugindir = $(sssddatadir)/sssd.api.d
 dbusintrospectdir = $(datarootdir)/sssd/introspect
 localedir = @localedir@
 nsslibdir = @nsslibdir@
@@ -1203,7 +1204,7 @@ endif
 endif
 
 
-dist_sssdconf_DATA = \
+dist_sssddata_DATA = \
     src/config/etc/sssd.api.conf
 dist_sssdapiplugin_DATA = \
     src/config/etc/sssd.api.d/sssd-ipa.conf \
@@ -1225,6 +1226,7 @@ installsssddirs::
     $(DESTDIR)$(pipepath)/private \
     $(DESTDIR)$(sssdlibdir) \
     $(DESTDIR)$(sssdconfdir) \
+    $(DESTDIR)$(sssddatadir) \
     $(DESTDIR)$(dbpath) \
     $(DESTDIR)$(pidpath) \
     $(DESTDIR)$(logpath) \
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 65a787bf55d238aa74c46867e35184cd84254378..a36e707ce0f93701f3fdfd9f17e140711995713c 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -237,11 +237,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
 # Prepare language files
 /usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT sssd
 
-# Copy SSSDConfig API files
+# Prepare empty config file (needed for RHEL 5)
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sssd
 touch $RPM_BUILD_ROOT/%{_sysconfdir}/sssd/sssd.conf
-install -m444 src/config/etc/sssd.api.conf $RPM_BUILD_ROOT%{_sysconfdir}/sssd/sssd.api.conf
-install -m444 src/config/etc/sssd.api.d/* $RPM_BUILD_ROOT%{_sysconfdir}/sssd/sssd.api.d/
 
 # Copy default logrotate file
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d
@@ -301,9 +299,8 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sssd/sssd.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/sssd
 %config(noreplace) %{_sysconfdir}/rwtab.d/sssd
-%config %{_sysconfdir}/sssd/sssd.api.conf
-%attr(755,root,root) %dir %{_sysconfdir}/sssd/sssd.api.d
-%config %{_sysconfdir}/sssd/sssd.api.d/*
+%{_datadir}/sssd/sssd.api.conf
+%{_datadir}/sssd/sssd.api.d
 %{_mandir}/man5/sssd.conf.5*
 %{_mandir}/man5/sssd-ipa.5*
 %{_mandir}/man5/sssd-krb5.5*
diff --git a/src/config/SSSDConfig.py b/src/config/SSSDConfig.py
index e3a5a446467d48d3f809e1671df0a1b0abea78f8..a26c42534c553167ab5d5fc5068fc82fc2e059b2 100644
--- a/src/config/SSSDConfig.py
+++ b/src/config/SSSDConfig.py
@@ -293,9 +293,9 @@ class SSSDConfigSchema(SSSDChangeConf):
         SSSDChangeConf.__init__(self)
         #TODO: get these from a global setting
         if not schemafile:
-            schemafile = '/etc/sssd/sssd.api.conf'
+            schemafile = '/usr/share/sssd/sssd.api.conf'
         if not schemaplugindir:
-            schemaplugindir = '/etc/sssd/sssd.api.d'
+            schemaplugindir = '/usr/share/sssd/sssd.api.d'
 
         try:
             #Read the primary config file
@@ -1197,10 +1197,10 @@ class SSSDConfig(SSSDChangeConf):
 
         schemafile:
           The path to the api schema config file. Usually
-          /etc/sssd/sssd.api.conf
+          /usr/share/sssd/sssd.api.conf
         schemaplugindir:
           The path the directory containing the provider schema config files.
-          Usually /etc/sssd/sssd.api.d
+          Usually /usr/share/sssd/sssd.api.d
 
         === Returns ===
         The newly-created SSSDConfig object.
-- 
1.7.7.6

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
sssd-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to