2013-07-10 17:19:55 +10:00
%define with_systemd %{?_with_systemd: 1} %{?!_with_systemd: 0}
2007-06-03 17:39:11 +10:00
%define initdir %{_sysconfdir}/init.d
2010-05-26 10:01:37 +10:00
Name : ctdb
2007-05-27 16:48:18 -04:00
Summary : Clustered TDB
Vendor : Samba Team
Packager : Samba Team <samba@samba.org>
2010-07-02 13:21:08 +10:00
Version : @VERSION@
2013-07-26 13:57:03 +10:00
Release : @RELEASE@
2007-05-27 16:48:18 -04:00
Epoch : 0
2007-07-10 15:29:31 +10:00
License : GNU GPL version 3
2007-05-27 16:48:18 -04:00
Group : System Environment/Daemons
2007-06-01 21:10:49 +10:00
URL : http://ctdb.samba.org/
2007-05-27 16:48:18 -04:00
2007-06-11 12:30:32 +10:00
Source : ctdb-%{version} .tar.gz
2007-05-27 16:48:18 -04:00
2012-05-09 17:20:27 +10:00
# Packages
2013-04-03 14:44:08 +11:00
Requires : coreutils, sed, gawk, iptables, iproute, procps, ethtool, sudo
2012-05-09 17:20:27 +10:00
# Commands - package name might vary
Requires : /usr/bin/killall, /bin/kill, /bin/netstat
2007-05-27 16:48:18 -04:00
Provides : ctdb = %{version}
Prefix : /usr
BuildRoot : %{_tmppath} /%{name} -%{version} -root
2013-07-04 15:14:10 +10:00
# Allow build with system libraries
# To enable, run rpmbuild with,
# "--with system_talloc"
# "--with system_tdb"
# "--with system_tevent"
2014-05-26 13:21:44 +10:00
#%define with_included_talloc %{?_with_system_talloc: 0} %{?!_with_system_talloc: 1}
#%define with_included_tdb %{?_with_system_tdb: 0} %{?!_with_system_tdb: 1}
#%define with_included_tevent %{?_with_system_tevent: 0} %{?!_with_system_tevent: 1}
%define with_included_talloc 0
%define with_included_tevent 0
%define with_included_tdb 0
2012-05-09 16:03:00 +10:00
2013-07-04 15:14:10 +10:00
# Required minimum library versions when building with system libraries
2013-06-13 12:55:29 +10:00
%define libtalloc_version 2.0.8
%define libtdb_version 1.2.11
2014-06-26 14:16:13 +10:00
%define libtevent_version 0.9.16
2012-05-09 16:03:00 +10:00
%if ! %with_included_talloc
BuildRequires : libtalloc-devel >= %{libtalloc_version}
2013-07-08 16:14:59 +10:00
Requires : libtalloc >= %{libtalloc_version}
2012-05-09 16:03:00 +10:00
%endif
%if ! %with_included_tdb
BuildRequires : libtdb-devel >= %{libtdb_version}
2013-07-08 16:14:59 +10:00
Requires : libtdb >= %{libtdb_version}
2012-05-09 16:03:00 +10:00
%endif
%if ! %with_included_tevent
BuildRequires : libtevent-devel >= %{libtevent_version}
2013-07-08 16:14:59 +10:00
Requires : libtevent >= %{libtevent_version}
2012-05-09 16:03:00 +10:00
%endif
2013-05-28 14:19:32 +10:00
# To build the ctdb-pcp-pmda package, run rpmbuild with "--with pmda"
%define with_pcp_pmda %{?_with_pmda: 1} %{?!_with_pmda: 0}
%if %with_pcp_pmda
BuildRequires : pcp-libs-devel
%endif
2013-07-10 17:19:55 +10:00
%if %{with_systemd}
BuildRequires : systemd-units
%endif
2007-05-27 16:48:18 -04:00
%description
ctdb is the clustered database used by samba
#######################################################################
2010-05-26 10:01:37 +10:00
2007-05-27 16:48:18 -04:00
%prep
%setup -q
# setup the init script and sysconfig file
2007-06-01 23:25:33 +10:00
%setup -T -D -n ctdb-%{version} -q
2007-05-27 16:48:18 -04:00
%build
2009-01-19 14:46:30 +01:00
## check for ccache
if ccache -h >/dev/null 2>&1 ; then
CC=" c c a c h e g c c "
else
CC=" g c c "
fi
export CC
2007-05-27 16:48:18 -04:00
2014-05-26 13:21:44 +10:00
CFLAGS=" $RPM_OPT_FLAGS $ E X T R A - D _ G N U _ S O U R C E " ./buildtools/bin/waf configure \
2015-06-25 14:55:23 +10:00
--builtin-libraries=replace,popt \
2014-05-26 13:21:44 +10:00
--bundled-libraries=!talloc,!tevent,!tdb \
--minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
2013-05-28 14:19:32 +10:00
%if %with_pcp_pmda
--enable-pmda \
2012-05-09 16:03:00 +10:00
%endif
2007-05-27 16:48:18 -04:00
--prefix=%{_prefix} \
2015-09-08 17:58:25 +10:00
--includedir=%{_includedir} /ctdb \
2014-09-02 16:18:01 +10:00
--libdir=%{_libdir} \
2016-03-01 12:20:35 +11:00
--libexecdir=%{_libexecdir} \
2007-05-29 16:23:47 +10:00
--sysconfdir=%{_sysconfdir} \
2007-06-09 15:28:32 +10:00
--mandir=%{_mandir} \
2007-05-29 16:23:47 +10:00
--localstatedir=" / v a r "
2007-05-27 16:48:18 -04:00
2014-05-26 13:21:44 +10:00
./buildtools/bin/waf build
2007-05-27 16:48:18 -04:00
%install
# Clean up in case there is trash left from a previous build
rm -rf $RPM_BUILD_ROOT
# Create the target build directory hierarchy
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig
2013-04-03 14:44:08 +11:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /sudoers.d
2007-05-27 16:48:18 -04:00
2014-05-26 13:21:44 +10:00
DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
2007-05-27 16:48:18 -04:00
2007-06-02 19:40:07 +10:00
install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/ctdb
2013-07-10 17:19:55 +10:00
%if %{with_systemd}
mkdir -p $RPM_BUILD_ROOT %{_unitdir}
install -m 755 config/ctdb.service $RPM_BUILD_ROOT %{_unitdir}
%else
mkdir -p $RPM_BUILD_ROOT %{initdir}
2007-06-02 19:40:07 +10:00
install -m755 config/ctdb.init $RPM_BUILD_ROOT %{initdir} /ctdb
2013-07-10 17:19:55 +10:00
%endif
2007-05-29 22:53:28 +10:00
2014-05-26 13:21:44 +10:00
# This is a hack. All documents should be installed in /usr/share/doc.
rm -f $RPM_BUILD_ROOT %{_sysconfdir} /ctdb/events.d/README
2013-07-04 12:45:32 +10:00
cp config/events.d/README README.eventscripts
2015-06-19 16:35:12 +10:00
rm -f $RPM_BUILD_ROOT %{_sysconfdir} /ctdb/nfs-checks.d/README
cp config/nfs-checks.d/README README.nfs-checks.d
2013-07-04 13:19:56 +10:00
cp config/notify.d.README README.notify.d
2013-07-04 12:45:32 +10:00
2007-05-27 16:48:18 -04:00
# Remove "*.old" files
find $RPM_BUILD_ROOT -name " * . o l d " -exec rm -f {} \;
%clean
rm -rf $RPM_BUILD_ROOT
#######################################################################
## Files section ##
#######################################################################
%files
%defattr (-,root,root)
%config (noreplace) %{_sysconfdir} /sysconfig/ctdb
2009-03-31 14:38:52 +11:00
%config (noreplace) %{_sysconfdir} /ctdb/notify.sh
2012-05-17 10:17:51 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/debug-hung-script.sh
2010-04-22 14:02:11 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/ctdb-crash-cleanup.sh
2012-09-06 20:22:38 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/gcore_trace.sh
2013-07-16 12:53:16 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/debug_locks.sh
2013-07-10 17:19:55 +10:00
%if %{with_systemd}
%{_unitdir} /ctdb.service
%else
2008-06-27 09:31:18 +10:00
%attr (755,root,root) %{initdir} /ctdb
2013-07-10 17:19:55 +10:00
%endif
2013-05-17 16:42:25 +10:00
%attr (755,root,root) %{_sysconfdir} /ctdb/notify.d
2007-05-27 16:48:18 -04:00
2016-03-08 16:30:41 +11:00
%doc README COPYING
2013-07-04 13:19:56 +10:00
%doc README.eventscripts README.notify.d
2013-07-04 12:45:32 +10:00
%doc doc/recovery-process.txt
2016-04-26 12:31:43 +10:00
%doc doc/cluster_mutex_helper.txt
2013-07-04 12:45:32 +10:00
%doc doc/*.html
2013-10-24 14:26:12 +11:00
%doc doc/examples
2013-04-03 14:44:08 +11:00
%{_sysconfdir} /sudoers.d/ctdb
2013-07-04 14:29:09 +10:00
%{_sysconfdir} /ctdb/functions
2007-08-15 15:01:31 +10:00
%{_sysconfdir} /ctdb/events.d/00.ctdb
2009-09-28 14:06:40 +10:00
%{_sysconfdir} /ctdb/events.d/01.reclock
2015-07-17 11:59:56 +10:00
%{_sysconfdir} /ctdb/events.d/05.system
2007-06-04 15:09:03 +10:00
%{_sysconfdir} /ctdb/events.d/10.interface
2015-05-11 15:29:34 +10:00
%{_sysconfdir} /ctdb/events.d/10.external
2009-12-19 18:26:01 +01:00
%{_sysconfdir} /ctdb/events.d/13.per_ip_routing
2009-03-31 20:00:00 +11:00
%{_sysconfdir} /ctdb/events.d/11.natgw
2009-06-23 11:29:26 +10:00
%{_sysconfdir} /ctdb/events.d/11.routing
2008-10-15 16:29:09 +11:00
%{_sysconfdir} /ctdb/events.d/20.multipathd
2009-05-25 11:46:47 +10:00
%{_sysconfdir} /ctdb/events.d/31.clamd
2007-06-05 18:14:01 +10:00
%{_sysconfdir} /ctdb/events.d/40.vsftpd
2008-01-11 10:44:16 +11:00
%{_sysconfdir} /ctdb/events.d/41.httpd
2012-08-16 14:41:11 +10:00
%{_sysconfdir} /ctdb/events.d/49.winbind
2007-06-04 15:09:03 +10:00
%{_sysconfdir} /ctdb/events.d/50.samba
%{_sysconfdir} /ctdb/events.d/60.nfs
2008-02-06 14:00:04 +11:00
%{_sysconfdir} /ctdb/events.d/70.iscsi
2008-01-07 14:31:13 +11:00
%{_sysconfdir} /ctdb/events.d/91.lvs
2013-08-15 20:23:57 +02:00
%{_sysconfdir} /ctdb/events.d/99.timeout
2015-07-13 21:00:29 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/00.portmapper.check
2015-06-19 16:35:12 +10:00
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/10.status.check
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/20.nfs.check
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/30.nlockmgr.check
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/40.mountd.check
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/50.rquotad.check
2007-05-31 11:09:45 +10:00
%{_sysconfdir} /ctdb/statd-callout
2015-06-24 21:36:14 +10:00
%{_sysconfdir} /ctdb/nfs-linux-kernel-callout
2007-05-29 15:15:00 +10:00
%{_sbindir} /ctdbd
2013-07-09 15:22:07 +10:00
%{_sbindir} /ctdbd_wrapper
2007-05-29 15:15:00 +10:00
%{_bindir} /ctdb
2009-04-29 17:58:17 +02:00
%{_bindir} /ping_pong
2011-05-04 14:28:26 +02:00
%{_bindir} /ltdbtool
2007-09-05 14:20:34 +10:00
%{_bindir} /ctdb_diagnostics
2007-05-30 11:17:52 +10:00
%{_bindir} /onnode
2016-02-12 10:12:13 +11:00
%dir %{_libexecdir} /ctdb
%{_libexecdir} /ctdb/ctdb_lock_helper
%{_libexecdir} /ctdb/ctdb_event_helper
%{_libexecdir} /ctdb/ctdb_recovery_helper
2015-12-08 16:23:50 +11:00
%{_libexecdir} /ctdb/ctdb_mutex_fcntl_helper
2016-02-12 10:12:13 +11:00
%{_libexecdir} /ctdb/ctdb_natgw
2016-04-07 17:30:28 +10:00
%{_libexecdir} /ctdb/ctdb_lvs
2016-03-03 10:34:48 +11:00
%{_libexecdir} /ctdb/ctdb_killtcp
2016-02-12 10:12:13 +11:00
%{_libexecdir} /ctdb/smnotify
2015-06-25 14:55:23 +10:00
%dir %{_libdir}
%{_libdir} /ctdb/lib*
2015-09-08 17:58:54 +10:00
%{_libdir} /libtevent-unix-util.so.0*
2007-06-09 15:28:32 +10:00
%{_mandir} /man1/ctdb.1.gz
2007-06-10 10:45:52 +10:00
%{_mandir} /man1/ctdbd.1.gz
2013-12-06 01:33:57 +01:00
%{_mandir} /man1/ctdbd_wrapper.1.gz
2007-06-12 13:44:01 +10:00
%{_mandir} /man1/onnode.1.gz
2011-05-04 14:28:26 +02:00
%{_mandir} /man1/ltdbtool.1.gz
2011-03-26 11:55:30 +01:00
%{_mandir} /man1/ping_pong.1.gz
2013-12-06 01:33:57 +01:00
%{_mandir} /man5/ctdbd.conf.5.gz
%{_mandir} /man7/ctdb.7.gz
2014-09-12 14:22:00 +10:00
%{_mandir} /man7/ctdb-statistics.7.gz
2013-12-06 01:33:57 +01:00
%{_mandir} /man7/ctdb-tunables.7.gz
2010-05-26 10:01:37 +10:00
2010-08-23 16:00:19 +10:00
%package devel
2012-05-11 10:32:26 +10:00
Summary : CTDB development libraries
Group : Development/Libraries
2010-08-23 16:00:19 +10:00
%description devel
development libraries for ctdb
2010-05-26 10:01:37 +10:00
%files devel
%defattr (-,root,root)
2015-09-08 17:58:54 +10:00
%{_includedir} /ctdb/util/*.h
%{_libdir} /libtevent-unix-util.so
2009-12-04 23:18:12 +01:00
2012-05-03 12:12:53 +10:00
%package tests
Summary : CTDB test suite
Group : Development/Tools
Requires : ctdb = %{version}
2012-05-18 12:59:41 +10:00
Requires : nc
2012-05-03 12:12:53 +10:00
%description tests
test suite for ctdb
%files tests
%defattr (-,root,root)
%dir %{_datadir} /%{name} -tests
%{_datadir} /%{name} -tests/*
%dir %{_libdir} /%{name} -tests
%{_libdir} /%{name} -tests/*
%{_bindir} /ctdb_run_tests
%{_bindir} /ctdb_run_cluster_tests
%doc tests/README
2013-05-28 14:19:32 +10:00
%if %with_pcp_pmda
%package pcp-pmda
Summary : CTDB PCP pmda support
Group : Development/Tools
Requires : ctdb = %{version}
Requires : pcp-libs
%description pcp-pmda
Performance Co-Pilot (PCP) support for CTDB
%files pcp-pmda
%dir /var/lib/pcp/pmdas/ctdb
/var/lib/pcp/pmdas/ctdb/*
%endif