From fc810ade0a7b6240364ce526982dd89c13299a02 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Mon, 2 Feb 2009 15:21:48 -0500
Subject: [PATCH] Adding support for generating RPMS for sssd.

---
 Makefile  |   45 +++++++++++++++++++++++
 sssd.spec |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+), 0 deletions(-)
 create mode 100644 Makefile
 create mode 100644 sssd.spec

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..06d4147
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+PACKAGE_NAME = sssd
+PACKAGE_VERSION = 0.1.0
+TARGET ?= master
+SUBDIRS = server replace nss_client
+TARBALL_PREFIX = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
+TARBALL = $(TARBALL_PREFIX).tar.gz
+LIBDIR ?= /usr/lib
+
+all:
+
+archive:
+	-mkdir -p dist/$(TARBALL_PREFIX)
+	git archive --format=tar --prefix=sssd/ $(TARGET) | (cd dist && tar xf -)
+	@for subdir in $(SUBDIRS); do \
+		cp -pr dist/sssd/$$subdir dist/$(TARBALL_PREFIX)/.; \
+	done
+
+local-archive: realdistclean
+	-mkdir -p dist/$(TARBALL_PREFIX)
+	@for subdir in $(SUBDIRS); do \
+		cp -pr $$subdir dist/$(TARBALL_PREFIX)/.; \
+	done
+
+tarballs:
+	-mkdir -p dist/sources
+	rm -f dist/sources/$(TARBALL)
+	cd dist/$(TARBALL_PREFIX)/server; ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
+	cd dist; tar cfz sources/$(TARBALL) $(TARBALL_PREFIX)
+	
+
+rpmroot:
+	mkdir -p $(RPMBUILD)/BUILD
+	mkdir -p $(RPMBUILD)/RPMS
+	mkdir -p $(RPMBUILD)/SOURCES
+	mkdir -p $(RPMBUILD)/SPECS
+	mkdir -p $(RPMBUILD)/SRPMS
+
+rpmdistdir:
+	mkdir -p dist/rpms
+	mkdir -p dist/srpms
+
+rpms: tarballs rpmroot rpmdistdir
+	cp sssd.spec $(RPMBUILD)/SPECS
+	cd $(RPMBUILD); rpmbuild -ba SPECS/sssd.spec
+
diff --git a/sssd.spec b/sssd.spec
new file mode 100644
index 0000000..cc11faa
--- /dev/null
+++ b/sssd.spec
@@ -0,0 +1,118 @@
+%define main_release 1
+%define sssd_version 0.90
+%define infopipe_version %{sssd_version}
+%define spolkit_version %{sssd_version}
+
+%define pre_release alpha
+
+%define tarball_name sssd-%{sssd_version}%{pre_release}
+%define sssd_release 0%{pre_release}.%{main_release}%{?dist}
+
+# XXX What version to call this?
+Name: sssd
+Version: %{sssd_version}
+Release: %{sssd_release}
+Group: Applications/System
+Summary: System Security Services Daemon
+License: GPLv3+ and LGPLv3+
+URL: http://www.freeipa.org/
+Source: %{tarball_name}.tar.gz
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+### Patches ###
+
+### Build Dependencies ###
+
+BuildRequires: autoconf
+BuildRequires: popt-devel
+BuildRequires: libtalloc-devel
+#BuildRequires: libtevent-devel
+BuildRequires: libtdb-devel
+#BuildRequires: libldb-devel
+BuildRequires: dbus-devel
+BuildRequires: dbus-libs
+Requires: libtalloc
+Requires: libtevent
+Requires: libtdb
+Requires: libldb
+Requires: dbus
+Requires: dbus-libs
+
+%description
+Provides a set of daemons to manage access to remote directories and authentication mechanisms. It provides an NSS and PAM interface toward the system and a pluggable backend system to connect to multiple different account sources. It is also the basis to provide client auditing and policy services for projects like FreeIPA. 
+
+%package -n sssd-infopipe
+Group: Applications/System
+Summary: An interface to query extended user data
+Version: %{infopipe_version}
+Release: %{main_release}%{?dist}
+
+%description infopipe
+Provides a D-BUS interface for requesting extended user data such as the face browser image, the user's language preferences, etc.
+
+%package polkit
+Group: Applications/System
+Summary: PolicyKit back-end for SSSD integration
+Version: %{spolkit_version}
+Release: %{main_release}%{?dist}
+
+%description polkit
+Provides a backend to PolicyKit 1.0 and higher that allows for SSSD data providers to control the system policy centrally.
+
+%prep
+%setup -q -n %{tarball_name}
+
+%build
+
+# sssd
+cd server
+./autogen.sh
+%configure --prefix=/usr --sysconfdir=/etc
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+# sssd
+cd server
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%post infopipe
+/sbin/ldconfig
+
+%postun infopipe
+/sbin/ldconfig
+
+%post polkit
+/sbin/ldconfig
+
+%postun polkit
+/sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%{_sbindir}/sssd
+%{_libexecdir}/sssd/sssd_nss
+%{_libexecdir}/sssd/sssd_dp
+%{_libexecdir}/sssd/sssd_be
+%{_libdir}/libsss_proxy.so
+%{_libdir}/memberof.so
+
+%files infopipe
+%defattr(-,root,root,-)
+%{_libexecdir}/sssd/sssd_info
+%{_sysconfdir}/dbus-1/system.d/org.freeipa.sssd.infopipe.conf
+
+%files polkit
+%{_libexecdir}/sssd/sssd_pk
+
+%changelog
-- 
1.6.0.6

