From f5db2669075b92a636098c65d9e7acf630e87eb6 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Mon, 12 Oct 2009 17:20:22 -0400
Subject: [PATCH] Package SSSDConfig API

---
 contrib/sssd.spec.in   |    4 ++++
 server/Makefile.am     |   12 ++++++++++++
 server/config/setup.py |   34 ++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 server/config/setup.py

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 9cd657a..b3c1181 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -1,4 +1,5 @@
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name: @PACKAGE_NAME@
 Version: @PACKAGE_VERSION@
@@ -145,6 +146,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/locale/*/LC_MESSAGES/sss_client.mo
 %{_datadir}/locale/*/LC_MESSAGES/sss_daemon.mo
 %{python_sitearch}/pysss.so
+%{python_sitelib}/*.py*
+%{python_sitelib}/*.egg-info
+
 
 %files client
 /%{_lib}/libnss_sss.so.2
diff --git a/server/Makefile.am b/server/Makefile.am
index 6c08274..4ec3c34 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -100,6 +100,10 @@ pyexec_LTLIBRARIES = \
     pysss.la
 endif
 
+dist_noinst_SCRIPTS = \
+    config/setup.py \
+    config/SSSDConfig.py
+
 ###############################
 # Global compilation settings #
 ###############################
@@ -561,6 +565,14 @@ installsssddirs::
     $(DESTDIR)$(logpath)
 
 install-exec-hook: installsssddirs
+	if [ "$(DESTDIR)" = "" ]; then \
+		cd $(srcdir)/config; $(PYTHON) setup.py install; \
+	else \
+		cd $(srcdir)/config; $(PYTHON) setup.py install --root=$(DESTDIR); \
+	fi
+
+clean-local:
+	cd $(srcdir)/config; $(PYTHON) setup.py clean --all
 
 CLEANFILES = *.X */*.X */*/*.X
 
diff --git a/server/config/setup.py b/server/config/setup.py
new file mode 100644
index 0000000..7f108a3
--- /dev/null
+++ b/server/config/setup.py
@@ -0,0 +1,34 @@
+# Authors:
+#  Stephen Gallagher <sgallagh@redhat.com>
+#
+# Copyright (C) 2009  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; version 2 only
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+"""
+Python-level packaging using distutils.
+"""
+
+from distutils.core import setup
+
+setup(
+    name='SSSDConfig',
+    version='1',
+    license='GPLv3+',
+    url='http://fedorahosted.org/sssd',
+    py_modules=[
+    'SSSDConfig',
+    ],
+)
-- 
1.6.2.5

