2013-07-10 11:19:55 +04:00
%define with_systemd %{?_with_systemd: 1} %{?!_with_systemd: 0}
2007-06-03 11:39:11 +04:00
%define initdir %{_sysconfdir}/init.d
2010-05-26 04:01:37 +04:00
Name : ctdb
2007-05-28 00:48:18 +04:00
Summary : Clustered TDB
Vendor : Samba Team
Packager : Samba Team <samba@samba.org>
2010-07-02 07:21:08 +04:00
Version : @VERSION@
2013-07-26 07:57:03 +04:00
Release : @RELEASE@
2007-05-28 00:48:18 +04:00
Epoch : 0
2007-07-10 09:29:31 +04:00
License : GNU GPL version 3
2007-05-28 00:48:18 +04:00
Group : System Environment/Daemons
2007-06-01 15:10:49 +04:00
URL : http://ctdb.samba.org/
2007-05-28 00:48:18 +04:00
2007-06-11 06:30:32 +04:00
Source : ctdb-%{version} .tar.gz
2007-05-28 00:48:18 +04:00
2012-05-09 11:20:27 +04:00
# Packages
2013-04-03 07:44:08 +04:00
Requires : coreutils, sed, gawk, iptables, iproute, procps, ethtool, sudo
2012-05-09 11:20:27 +04:00
# Commands - package name might vary
Requires : /usr/bin/killall, /bin/kill, /bin/netstat
2007-05-28 00:48:18 +04:00
Provides : ctdb = %{version}
Prefix : /usr
BuildRoot : %{_tmppath} /%{name} -%{version} -root
2013-07-04 09:14:10 +04:00
# Allow build with system libraries
# To enable, run rpmbuild with,
# "--with system_talloc"
# "--with system_tdb"
# "--with system_tevent"
2014-05-26 07:21:44 +04: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 10:03:00 +04:00
2013-07-04 09:14:10 +04:00
# Required minimum library versions when building with system libraries
2013-06-13 06:55:29 +04:00
%define libtalloc_version 2.0.8
%define libtdb_version 1.2.11
2014-06-26 08:16:13 +04:00
%define libtevent_version 0.9.16
2012-05-09 10:03:00 +04:00
%if ! %with_included_talloc
BuildRequires : libtalloc-devel >= %{libtalloc_version}
2013-07-08 10:14:59 +04:00
Requires : libtalloc >= %{libtalloc_version}
2012-05-09 10:03:00 +04:00
%endif
%if ! %with_included_tdb
BuildRequires : libtdb-devel >= %{libtdb_version}
2013-07-08 10:14:59 +04:00
Requires : libtdb >= %{libtdb_version}
2012-05-09 10:03:00 +04:00
%endif
%if ! %with_included_tevent
BuildRequires : libtevent-devel >= %{libtevent_version}
2013-07-08 10:14:59 +04:00
Requires : libtevent >= %{libtevent_version}
2012-05-09 10:03:00 +04:00
%endif
2013-05-28 08:19:32 +04: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 11:19:55 +04:00
%if %{with_systemd}
BuildRequires : systemd-units
%endif
2007-05-28 00:48:18 +04:00
%description
ctdb is the clustered database used by samba
#######################################################################
2010-05-26 04:01:37 +04:00
2007-05-28 00:48:18 +04:00
%prep
%setup -q
# setup the init script and sysconfig file
2007-06-01 17:25:33 +04:00
%setup -T -D -n ctdb-%{version} -q
2007-05-28 00:48:18 +04:00
%build
2009-01-19 16:46:30 +03: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-28 00:48:18 +04:00
2014-05-26 07:21:44 +04: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 07:55:23 +03:00
--builtin-libraries=replace,popt \
2014-05-26 07:21:44 +04:00
--bundled-libraries=!talloc,!tevent,!tdb \
--minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
2013-05-28 08:19:32 +04:00
%if %with_pcp_pmda
--enable-pmda \
2012-05-09 10:03:00 +04:00
%endif
2007-05-28 00:48:18 +04:00
--prefix=%{_prefix} \
2015-09-08 10:58:25 +03:00
--includedir=%{_includedir} /ctdb \
2014-09-02 10:18:01 +04:00
--libdir=%{_libdir} \
2016-03-01 04:20:35 +03:00
--libexecdir=%{_libexecdir} \
2007-05-29 10:23:47 +04:00
--sysconfdir=%{_sysconfdir} \
2007-06-09 09:28:32 +04:00
--mandir=%{_mandir} \
2007-05-29 10:23:47 +04:00
--localstatedir=" / v a r "
2007-05-28 00:48:18 +04:00
2014-05-26 07:21:44 +04:00
./buildtools/bin/waf build
2007-05-28 00: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 07:44:08 +04:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /sudoers.d
2007-05-28 00:48:18 +04:00
2014-05-26 07:21:44 +04:00
DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
2007-05-28 00:48:18 +04:00
2007-06-02 13:40:07 +04:00
install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/ctdb
2013-07-10 11:19:55 +04: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 13:40:07 +04:00
install -m755 config/ctdb.init $RPM_BUILD_ROOT %{initdir} /ctdb
2013-07-10 11:19:55 +04:00
%endif
2007-05-29 16:53:28 +04:00
2014-05-26 07:21:44 +04: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 06:45:32 +04:00
cp config/events.d/README README.eventscripts
2015-06-19 09:35:12 +03: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 07:19:56 +04:00
cp config/notify.d.README README.notify.d
2013-07-04 06:45:32 +04:00
2007-05-28 00: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 07:38:52 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/notify.sh
2012-05-17 04:17:51 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/debug-hung-script.sh
2010-04-22 08:02:11 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/ctdb-crash-cleanup.sh
2012-09-06 14:22:38 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/gcore_trace.sh
2013-07-16 06:53:16 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/debug_locks.sh
2013-07-10 11:19:55 +04:00
%if %{with_systemd}
%{_unitdir} /ctdb.service
%else
2008-06-27 03:31:18 +04:00
%attr (755,root,root) %{initdir} /ctdb
2013-07-10 11:19:55 +04:00
%endif
2013-05-17 10:42:25 +04:00
%attr (755,root,root) %{_sysconfdir} /ctdb/notify.d
2007-05-28 00:48:18 +04:00
2013-07-04 06:45:32 +04:00
%doc README COPYING NEWS
2013-07-04 07:19:56 +04:00
%doc README.eventscripts README.notify.d
2013-07-04 06:45:32 +04:00
%doc doc/recovery-process.txt
%doc doc/*.html
2013-10-24 07:26:12 +04:00
%doc doc/examples
2013-04-03 07:44:08 +04:00
%{_sysconfdir} /sudoers.d/ctdb
2013-07-04 08:29:09 +04:00
%{_sysconfdir} /ctdb/functions
2007-08-15 09:01:31 +04:00
%{_sysconfdir} /ctdb/events.d/00.ctdb
2009-09-28 08:06:40 +04:00
%{_sysconfdir} /ctdb/events.d/01.reclock
2015-07-17 04:59:56 +03:00
%{_sysconfdir} /ctdb/events.d/05.system
2007-06-04 09:09:03 +04:00
%{_sysconfdir} /ctdb/events.d/10.interface
2015-05-11 08:29:34 +03:00
%{_sysconfdir} /ctdb/events.d/10.external
2009-12-19 20:26:01 +03:00
%{_sysconfdir} /ctdb/events.d/13.per_ip_routing
2009-03-31 13:00:00 +04:00
%{_sysconfdir} /ctdb/events.d/11.natgw
2009-06-23 05:29:26 +04:00
%{_sysconfdir} /ctdb/events.d/11.routing
2008-10-15 09:29:09 +04:00
%{_sysconfdir} /ctdb/events.d/20.multipathd
2009-05-25 05:46:47 +04:00
%{_sysconfdir} /ctdb/events.d/31.clamd
2007-06-05 12:14:01 +04:00
%{_sysconfdir} /ctdb/events.d/40.vsftpd
2008-01-11 02:44:16 +03:00
%{_sysconfdir} /ctdb/events.d/41.httpd
2012-08-16 08:41:11 +04:00
%{_sysconfdir} /ctdb/events.d/49.winbind
2007-06-04 09:09:03 +04:00
%{_sysconfdir} /ctdb/events.d/50.samba
%{_sysconfdir} /ctdb/events.d/60.nfs
2008-02-06 06:00:04 +03:00
%{_sysconfdir} /ctdb/events.d/70.iscsi
2008-01-07 06:31:13 +03:00
%{_sysconfdir} /ctdb/events.d/91.lvs
2013-08-15 22:23:57 +04:00
%{_sysconfdir} /ctdb/events.d/99.timeout
2015-07-13 14:00:29 +03:00
%config (noreplace) %{_sysconfdir} /ctdb/nfs-checks.d/00.portmapper.check
2015-06-19 09:35:12 +03: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 05:09:45 +04:00
%{_sysconfdir} /ctdb/statd-callout
2015-06-24 14:36:14 +03:00
%{_sysconfdir} /ctdb/nfs-linux-kernel-callout
2007-05-29 09:15:00 +04:00
%{_sbindir} /ctdbd
2013-07-09 09:22:07 +04:00
%{_sbindir} /ctdbd_wrapper
2007-05-29 09:15:00 +04:00
%{_bindir} /ctdb
2009-04-29 19:58:17 +04:00
%{_bindir} /ping_pong
2011-05-04 16:28:26 +04:00
%{_bindir} /ltdbtool
2007-09-05 08:20:34 +04:00
%{_bindir} /ctdb_diagnostics
2007-05-30 05:17:52 +04:00
%{_bindir} /onnode
2016-02-12 02:12:13 +03:00
%dir %{_libexecdir} /ctdb
%{_libexecdir} /ctdb/ctdb_lock_helper
%{_libexecdir} /ctdb/ctdb_event_helper
%{_libexecdir} /ctdb/ctdb_recovery_helper
%{_libexecdir} /ctdb/ctdb_natgw
%{_libexecdir} /ctdb/smnotify
2015-06-25 07:55:23 +03:00
%dir %{_libdir}
%{_libdir} /ctdb/lib*
2015-09-08 10:58:54 +03:00
%{_libdir} /libtevent-unix-util.so.0*
2007-06-09 09:28:32 +04:00
%{_mandir} /man1/ctdb.1.gz
2007-06-10 04:45:52 +04:00
%{_mandir} /man1/ctdbd.1.gz
2013-12-06 04:33:57 +04:00
%{_mandir} /man1/ctdbd_wrapper.1.gz
2007-06-12 07:44:01 +04:00
%{_mandir} /man1/onnode.1.gz
2011-05-04 16:28:26 +04:00
%{_mandir} /man1/ltdbtool.1.gz
2011-03-26 13:55:30 +03:00
%{_mandir} /man1/ping_pong.1.gz
2013-12-06 04:33:57 +04:00
%{_mandir} /man5/ctdbd.conf.5.gz
%{_mandir} /man7/ctdb.7.gz
2014-09-12 08:22:00 +04:00
%{_mandir} /man7/ctdb-statistics.7.gz
2013-12-06 04:33:57 +04:00
%{_mandir} /man7/ctdb-tunables.7.gz
2010-05-26 04:01:37 +04:00
2010-08-23 10:00:19 +04:00
%package devel
2012-05-11 04:32:26 +04:00
Summary : CTDB development libraries
Group : Development/Libraries
2010-08-23 10:00:19 +04:00
%description devel
development libraries for ctdb
2010-05-26 04:01:37 +04:00
%files devel
%defattr (-,root,root)
2015-09-08 10:58:54 +03:00
%{_includedir} /ctdb/util/*.h
%{_libdir} /libtevent-unix-util.so
2009-12-05 01:18:12 +03:00
2012-05-03 06:12:53 +04:00
%package tests
Summary : CTDB test suite
Group : Development/Tools
Requires : ctdb = %{version}
2012-05-18 06:59:41 +04:00
Requires : nc
2012-05-03 06:12:53 +04: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 08:19:32 +04: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