From 0d35a34e549a66ad25c58e410c53f0836262c9f847af3a3df59ae31cd748dfac Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 19 Oct 2011 14:17:34 +0000 Subject: [PATCH] Accepting request 88733 from home:rhafer:branches:network:ldap bnc#724157 OBS-URL: https://build.opensuse.org/request/show/88733 OBS-URL: https://build.opensuse.org/package/show/network:ldap/sssd?expand=0&rev=60 --- sssd.changes | 6 ++++++ sssd.spec | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/sssd.changes b/sssd.changes index b3992db..1c89c43 100644 --- a/sssd.changes +++ b/sssd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 19 13:56:57 UTC 2011 - rhafer@suse.de + +- Fixed systemd related packaging issues (bnc#724157) +- fixed build on older openSUSE releases + ------------------------------------------------------------------- Mon Sep 19 17:07:24 UTC 2011 - jengelh@medozas.de diff --git a/sssd.spec b/sssd.spec index 388f8ae..eb156cd 100644 --- a/sssd.spec +++ b/sssd.spec @@ -30,6 +30,9 @@ Patch1: 0001-sss_client-avoid-leaking-file-descriptors.patch Patch2: 0002-Request-password-control-unconditionally-during-bind.patch Patch3: 0003-Allow-LDAP-to-decide-when-an-expiration-warning-is-w.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %suse_version > 1140 +%{?systemd_requires} +%endif %define servicename sssd %define sssdstatedir %{_localstatedir}/lib/sss @@ -56,7 +59,6 @@ BuildRequires: libldb-devel BuildRequires: libxslt BuildRequires: libxml2 BuildRequires: libcares-devel -BuildRequires: libnl-1_1-devel BuildRequires: dbus-1-devel BuildRequires: openldap2-devel BuildRequires: pam-devel @@ -72,6 +74,12 @@ BuildRequires: libdhash-devel BuildRequires: libini_config-devel BuildRequires: libcollection-devel BuildRequires: libref_array-devel +%if %suse_version > 1140 +BuildRequires: systemd +BuildRequires: libnl-1_1-devel +%else +BuildRequires: libnl-devel +%endif %description Provides a set of daemons to manage access to remote directories and @@ -143,8 +151,10 @@ make install DESTDIR=$RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/%{_sysconfdir}/sssd install -m600 src/examples/sssd.conf $RPM_BUILD_ROOT%{_sysconfdir}/sssd/sssd.conf install src/sysv/SUSE/sssd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/sssd -install -d $RPM_BUILD_ROOT/%{_sysconfdir}/systemd/system -install src/sysv/systemd/sssd.service $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/sssd.service +%if %suse_version > 1140 +install -d $RPM_BUILD_ROOT/%{_unitdir} +install src/sysv/systemd/sssd.service $RPM_BUILD_ROOT/%{_unitdir}/sssd.service +%endif ln -sf ../../etc/init.d/sssd $RPM_BUILD_ROOT/usr/sbin/rcsssd # Remove .la files created by libtool @@ -166,23 +176,39 @@ rm -rf \ %clean rm -rf $RPM_BUILD_ROOT -%post -p /sbin/ldconfig +%if %suse_version > 1140 + +%pre +%service_add_pre sssd.service +%endif + +%post +/sbin/ldconfig +%if %suse_version > 1140 +%service_add_post sssd.service +%endif %preun %stop_on_removal sssd +%if %suse_version > 1140 +%service_del_preun sssd.service +%endif %postun /sbin/ldconfig %restart_on_update sssd %insserv_cleanup +%if %suse_version > 1140 +%service_del_postun sssd.service +%endif %files -f sssd.lang %defattr(-,root,root,-) %doc COPYING %{_initrddir}/%{name} -%dir %{_sysconfdir}/systemd -%dir %{_sysconfdir}/systemd/system -%config %{_sysconfdir}/systemd/system/sssd.service +%if %suse_version > 1140 +%{_unitdir}/sssd.service +%endif %{_sbindir}/sssd %{_sbindir}/rcsssd %dir %{_libdir}/%{name}