File ctdb.spec of Package ctdb.openSUSE_13.1_Update
#
# spec file for package ctdb
#
# Copyright (c) 2014 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/
#
%if 0%{?suse_version} > 1140
%define build_pmda 1
%endif
Summary: Clustered TDB
License: GPL-3.0+
Group: System/Daemons
Name: ctdb
Version: 2.3
Release: 0
Url: http://ctdb.samba.org/
Source: ctdb-%{version}.tar.gz
Source1: ctdb-sysconfig-suse.template
Patch1: ctdb-socket-path.patch
%if 0%{?suse_version}
PreReq: %{?fillup_prereq}
PreReq: insserv
%else
PreReq: /sbin/chkconfig
%endif
PreReq: coreutils
PreReq: /bin/mktemp
PreReq: /usr/bin/killall
PreReq: sed
%define initdir %{_sysconfdir}/init.d
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1140
BuildRequires: autoconf
%endif
%if 0%{?suse_version} > 1020
BuildRequires: pkg-config
%else
BuildRequires: pkgconfig
%endif
%if 0%{?build_pmda}
BuildRequires: libpcp-devel
%endif
%description
ctdb is the clustered database used by Samba
%package devel
Summary: Libraries and Header Files to Develop Programs with ctdb support
Group: Development/Libraries/C and C++
%description devel
This package contains the static libraries and header files needed to
develop programs which make use of ctdb.
%if 0%{?build_pmda}
%package pcp-pmda
Summary: Performance Co-Pilot (PCP) monitoring agent
Group: System/Monitoring
%description pcp-pmda
The CTDB Performance Co-Pilot (PCP) monitoring agent allows remote PCP
clients to view and capture detailed real-time performance metrics for
one or more cluster nodes.
%endif
%prep
%setup -q
%patch1 -p1
%build
%if 0%{?suse_version} && 0%{?suse_version} < 1141
%{?suse_update_config:%{suse_update_config -f}}
%endif
autoreconf --force --install \
-I. \
-Ilib/replace \
-Ilib/popt \
-Ilib/talloc \
-Ilib/tdb \
-Ilib/tevent
export CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\""
%if 0%{?build_pmda}
%{configure} --enable-pmda
%else
%{configure}
%endif
%{__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
# sudo can be used by statd-callout, but is not needed
rm ${RPM_BUILD_ROOT}/%{_sysconfdir}/sudoers.d/ctdb
%preun
%if 0%{?suse_version} == 0
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}
%{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
%dir %{_sysconfdir}/ctdb/nfs-rpc-checks.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
%attr(775,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/00.ctdb
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/01.reclock
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/10.interface
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/11.natgw
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/11.routing
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/13.per_ip_routing
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/20.multipathd
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/31.clamd
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/40.vsftpd
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/41.httpd
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/50.samba
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/60.nfs
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/60.ganesha
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/62.cnfs
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/70.iscsi
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/91.lvs
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/40.fs_use
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/49.winbind
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/nfs-rpc-checks.d/10.statd.check
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/nfs-rpc-checks.d/20.nfsd.check
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/nfs-rpc-checks.d/30.lockd.check
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/nfs-rpc-checks.d/40.mountd.check
%attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/nfs-rpc-checks.d/50.rquotad.check
%{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
%{_sysconfdir}/ctdb/gcore_trace.sh
%{_sysconfdir}/ctdb/statd-callout
%{_sysconfdir}/ctdb/debug-hung-script.sh
%{_sbindir}/ctdbd
%{_sbindir}/ctdbd_wrapper
%{_bindir}/ctdb
%{_bindir}/smnotify
%{_bindir}/ctdb_diagnostics
%{_bindir}/ltdbtool
%{_bindir}/onnode
%{_bindir}/ping_pong
%{_bindir}/ctdb_lock_helper
%dir %{_localstatedir}/lib/ctdb
%dir %{_localstatedir}/lib/ctdb/persistent
%dir %{_localstatedir}/log/ctdb
%{_mandir}/man1/*
%files devel
%defattr(-,root,root)
%{_includedir}/ctdb.h
%{_includedir}/ctdb_client.h
%{_includedir}/ctdb_private.h
%{_includedir}/ctdb_protocol.h
%{_includedir}/ctdb_typesafe_cb.h
%attr(644,root,root) %{_libdir}/libctdb.a
%{_libdir}/pkgconfig/ctdb.pc
%if 0%{?build_pmda}
%files pcp-pmda
%defattr(-,root,root)
%dir %{_localstatedir}/lib/pcp
%dir %{_localstatedir}/lib/pcp/pmdas
%dir %{_localstatedir}/lib/pcp/pmdas/ctdb
%{_localstatedir}/lib/pcp/pmdas/ctdb/Install
%{_localstatedir}/lib/pcp/pmdas/ctdb/README
%{_localstatedir}/lib/pcp/pmdas/ctdb/Remove
%{_localstatedir}/lib/pcp/pmdas/ctdb/domain.h
%{_localstatedir}/lib/pcp/pmdas/ctdb/help
%{_localstatedir}/lib/pcp/pmdas/ctdb/pmdactdb
%{_localstatedir}/lib/pcp/pmdas/ctdb/pmns
%endif
%changelog