File ctdb.spec of Package ctdb

# spec file for package ctdb (Version 1.0.114)
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Summary:        Clustered TDB

Name:           ctdb
Version:        1.0.114
Release:        2
License:        GNU GPL version 3
Group:          System/Daemons
Source:         ctdb-%{version}.tar.bz2
Source1:        ctdb-sysconfig-suse.template
Patch1:         ctdb-socket-path.patch
%if 0%{?suse_version}
PreReq:         insserv %{?fillup_prereq}
PreReq:         /sbin/chkconfig
PreReq:         fileutils /bin/mktemp /usr/bin/killall sed
%define         initdir %{_sysconfdir}/init.d
AutoReqProv:    on
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pkg-config

ctdb is the clustered database used by Samba

%package devel
License:        GNU GPL version 3
Summary:        Libraries and Header Files to Develop Programs with ctdb support
Group:          Development/Libraries/C and C++
AutoReqProv:    on

%description devel
This package contains the static libraries and header files needed to
develop programs which make use of ctdb.

%setup -q
%patch1 -p1

%{?suse_update_config:%{suse_update_config -f}}
autoreconf --force --install \
	-I. \
	-Ilib/replace \
	-Ilib/popt \
	-Ilib/talloc \
	-Ilib/tdb \
export CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\""
%{__make} %{?_smp_mflags} docdir=%{_docdir}

mkdir -p \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d \
	${RPM_BUILD_ROOT}/%{_localstatedir}/lib/ctdb/persistent \
%{__make} install \
%if 0%{?suse_version}
mkdir -p ${RPM_BUILD_ROOT}/%{_var}/adm/fillup-templates
%{__install} -m 0644 ${RPM_SOURCE_DIR}/ctdb-sysconfig-suse.template ${RPM_BUILD_ROOT}/%{_var}/adm/fillup-templates/sysconfig.ctdb
%{__install} -m 0644 config/ctdb.sysconfig ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/ctdb
%{__install} -m 0755 config/ctdb.init ${RPM_BUILD_ROOT}/%{initdir}/ctdb

%if 0%{?suse_version}
%{stop_on_removal ctdb}
if [ $1 = 0 ] ; then
	test -x /sbin/chkconfig && /sbin/chkconfig --del ctdb
exit 0

%if 0%{?suse_version}

%if 0%{?suse_version}
%{restart_on_update ctdb}
if [ "$1" -ge "1" ]; then
	%{initdir}/ctdb restart >/dev/null
exit 0

%dir %{_sysconfdir}/ctdb
%dir %{_sysconfdir}/ctdb/events.d
%if 0%{?suse_version}
%config(noreplace) %{_sysconfdir}/sysconfig/ctdb
%config(noreplace) %{_sysconfdir}/ctdb/
%config(noreplace) %{_sysconfdir}/ctdb/functions
%attr(755,root,root) %{initdir}/ctdb
%dir %{_defaultdocdir}/ctdb
%dir %{_localstatedir}/lib/ctdb
%dir %{_localstatedir}/lib/ctdb/persistent
%dir %{_localstatedir}/log/ctdb

%files devel

openSUSE Build Service is sponsored by