File sc_ldap.spec of Package sc_ldap

#
# spec file for package sc_ldap
# 
# Copyright  (c)  2005-2011  dass IT GmbH, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
# 
# $Id: sc_ldap.spec 5703 2020-09-09 09:54:59Z joergs $
#

%if 0%{?suse_version} >= 1110
    %define rsyslog 1
%endif

%if 0%{?suse_version} > 1210
%global with_systemd  1
%else
%global with_systemd  0
%endif

BuildRequires: openldap2 openldap2-client
BuildRequires: sc_base

%if 0%{?rsyslog}
BuildRequires: rsyslog
%endif

%if 0%{?with_systemd}
BuildRequires:  pkgconfig(systemd)
%{?systemd_requires}
%else
Requires(post): %insserv_prereq
%endif

Name:         sc_ldap
License:      GPL-2.0-or-later
Group:        Applications/SmartClient
Autoreqprov:  on
Requires:     sc_base openldap2 logrotate
Requires:     sc_ldap_tools
Summary:      OpenLDAP configuration for the SmartClient Framework
Version: 1.5.5717
Release:      0
Source: sc_ldap_1.5.5717.orig.tar.gz
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
BuildArch:    noarch

%description
SmartClient configuration for OpenLDAP

Authors:
--------
        Stephan Duehr
        Jörg Steffens

%prep
%setup -c %{name}-%{version}

%build

%install
mkdir -p $RPM_BUILD_ROOT/etc/openldap/schema/
install -m 644 etc/openldap/*.conf etc/openldap/*.include etc/openldap/*.acl $RPM_BUILD_ROOT/etc/openldap/
install -m 644 etc/openldap/schema/scObjectidentifier etc/openldap/schema/*.schema $RPM_BUILD_ROOT/etc/openldap/schema/

mkdir -p $RPM_BUILD_ROOT/etc/smartclient/
install -m 644 etc/smartclient/ldap $RPM_BUILD_ROOT/etc/smartclient/

mkdir -p $RPM_BUILD_ROOT/etc/rsyslog.d/
install -m 644 etc/rsyslog.d/slapd.conf $RPM_BUILD_ROOT/etc/rsyslog.d/

mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/
install -m 644 etc/logrotate.d/slapd $RPM_BUILD_ROOT/etc/logrotate.d/

#mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/
#install -m 644 sysconfig/openldap-proxy $RPM_BUILD_ROOT/etc/sysconfig/

mkdir -p $RPM_BUILD_ROOT/usr/bin/
install -m 755 usr/bin/*.sh $RPM_BUILD_ROOT/usr/bin/

mkdir -p $RPM_BUILD_ROOT/usr/sbin/
install -m 755 usr/sbin/*.sh $RPM_BUILD_ROOT/usr/sbin/
#install -m 755 sc_ldap-proxy_restart.sh $RPM_BUILD_ROOT/usr/sbin/

mkdir -p $RPM_BUILD_ROOT/etc/init.d
#install -m 755 ldap-proxy $RPM_BUILD_ROOT/etc/init.d
install -m 755 etc/init.d/sc_ldap_check_and_restart $RPM_BUILD_ROOT/etc/init.d

mkdir -p $RPM_BUILD_ROOT/usr/sbin/
#ln -sf ../../etc/init.d/ldap-proxy $RPM_BUILD_ROOT/usr/sbin/rcldap-proxy
ln -sf ../../etc/init.d/sc_ldap_check_and_restart $RPM_BUILD_ROOT/usr/sbin/rcsc_ldap_check_and_restart


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%config(noreplace) /etc/openldap/*.conf
%config(noreplace) /etc/openldap/*.include
%config(noreplace) /etc/openldap/*.acl
%config            /etc/openldap/schema/scObjectidentifier
%config            /etc/openldap/schema/*.schema
%config(noreplace) /etc/smartclient/ldap
#%config(noreplace) /etc/sysconfig/openldap-proxy
%if 0%{?rsyslog}
%else
%dir               /etc/rsyslog.d
%endif
%config            /etc/rsyslog.d/slapd.conf
%config            /etc/logrotate.d/slapd
/usr/bin/*.sh
/usr/sbin/*.sh
/etc/init.d/sc_ldap_check_and_restart
/usr/sbin/rcsc_ldap_check_and_restart
#/etc/init.d/ldap-proxy
#/usr/sbin/rcldap-proxy
%doc README README.ldap_backup skeleton/*
#%doc %{_mandir}/man3/*

%preun
%stop_on_removal sc_ldap_check_and_restart

%postun
%if 0%{?with_systemd}
%else
%insserv_cleanup
%endif
openSUSE Build Service is sponsored by