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 http://bugs.opensuse.org/
#


Summary:        Clustered TDB

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

%description
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.

%prep
%setup -q
%patch1 -p1

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

%install
mkdir -p \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d \
	${RPM_BUILD_ROOT}/%{_localstatedir}/lib/ctdb/persistent \
	${RPM_BUILD_ROOT}/%{_localstatedir}/log/ctdb
%{__make} install \
	DESTDIR=${RPM_BUILD_ROOT} \
	docdir=%{_docdir}
%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
%else
%{__install} -m 0644 config/ctdb.sysconfig ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/ctdb
%endif
%{__install} -m 0755 config/ctdb.init ${RPM_BUILD_ROOT}/%{initdir}/ctdb

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

%post
%if 0%{?suse_version}
%{fillup_and_insserv}
%endif

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

%files
%defattr(-,root,root)
%dir %{_sysconfdir}/ctdb
%dir %{_sysconfdir}/ctdb/events.d
%if 0%{?suse_version}
%{_var}/adm/fillup-templates/sysconfig.ctdb
%else
%config(noreplace) %{_sysconfdir}/sysconfig/ctdb
%endif
%config(noreplace) %{_sysconfdir}/ctdb/notify.sh
%config(noreplace) %{_sysconfdir}/ctdb/functions
%attr(755,root,root) %{initdir}/ctdb
%dir %{_defaultdocdir}/ctdb
%{_docdir}/ctdb/README.eventscripts
%{_docdir}/ctdb/recovery-process.txt
%{_sysconfdir}/ctdb/events.d/00.ctdb
%{_sysconfdir}/ctdb/events.d/01.reclock
%{_sysconfdir}/ctdb/events.d/10.interface
%{_sysconfdir}/ctdb/events.d/11.natgw
%{_sysconfdir}/ctdb/events.d/11.routing
%{_sysconfdir}/ctdb/events.d/13.per_ip_routing
%{_sysconfdir}/ctdb/events.d/20.multipathd
%{_sysconfdir}/ctdb/events.d/31.clamd
%{_sysconfdir}/ctdb/events.d/40.vsftpd
%{_sysconfdir}/ctdb/events.d/41.httpd
%{_sysconfdir}/ctdb/events.d/50.samba
%{_sysconfdir}/ctdb/events.d/60.nfs
%{_sysconfdir}/ctdb/events.d/61.nfstickle
%{_sysconfdir}/ctdb/events.d/70.iscsi
%{_sysconfdir}/ctdb/events.d/91.lvs
%{_sysconfdir}/ctdb/interface_modify.sh
%{_sysconfdir}/ctdb/statd-callout
%{_sbindir}/ctdbd
%{_bindir}/ctdb
%{_bindir}/smnotify
%{_bindir}/ctdb_diagnostics
%{_bindir}/onnode
%{_bindir}/ping_pong
%dir %{_localstatedir}/lib/ctdb
%dir %{_localstatedir}/lib/ctdb/persistent
%dir %{_localstatedir}/log/ctdb
%{_mandir}/man1/ctdb.1.*
%{_mandir}/man1/ctdbd.1.*
%{_mandir}/man1/onnode.1.*

%files devel
%defattr(-,root,root)
%{_includedir}/ctdb.h
%{_includedir}/ctdb_private.h
%{_libdir}/pkgconfig/ctdb.pc

%changelog
openSUSE Build Service is sponsored by