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
2016-09-15 09:36:33 +03:00
%define libtdb_version 1.3.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} \
2018-03-05 12:34:48 +03:00
--localstatedir=%{_localstatedir}
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
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
2016-06-28 09:11:47 +03:00
install -m644 config/ctdbd.conf $RPM_BUILD_ROOT %{_sysconfdir} /ctdb
2018-02-20 10:22:33 +03:00
install -m644 config/ctdb.tunables $RPM_BUILD_ROOT %{_sysconfdir} /ctdb
2018-04-24 09:33:20 +03:00
install -m644 config/script.options $RPM_BUILD_ROOT %{_sysconfdir} /ctdb
2013-07-10 11:19:55 +04:00
2016-08-02 23:51:57 +03:00
# Add a pointer to modern location for configuration file. Allow with
# "noreplace" in the files section, this stops RPM moving aside a
# working configuration.
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig
cat >$RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/ctdb <<EOF
# CTDB configuration is now in %{_sysconfdir}/ctdb/ctdbd.conf
EOF
chmod 644 $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
2018-03-29 07:11:04 +03:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /ctdb/notify.d
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)
2016-06-28 09:11:47 +03:00
%config (noreplace) %{_sysconfdir} /ctdb/ctdbd.conf
2018-02-20 10:22:33 +03:00
%config (noreplace) %{_sysconfdir} /ctdb/ctdb.tunables
2018-04-24 09:33:20 +03:00
%config (noreplace) %{_sysconfdir} /ctdb/script.options
2018-03-29 07:11:04 +03:00
%{_sysconfdir} /ctdb/notify.sh
%dir %{_sysconfdir} /ctdb/notify.d
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
2013-07-16 06:53:16 +04:00
%config (noreplace) %{_sysconfdir} /ctdb/debug_locks.sh
2013-07-10 11:19:55 +04:00
2016-08-02 23:51:57 +03:00
%config (noreplace, missingok) %{_sysconfdir} /sysconfig/ctdb
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
2016-03-08 08:30:41 +03:00
%doc README COPYING
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
2016-04-26 05:31:43 +03:00
%doc doc/cluster_mutex_helper.txt
2013-07-04 06:45:32 +04:00
%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
2018-02-16 06:03:07 +03:00
%dir %{_sysconfdir} /ctdb
2013-07-04 08:29:09 +04:00
%{_sysconfdir} /ctdb/functions
2018-02-16 06:03:07 +03:00
%dir %{_sysconfdir} /ctdb/events.d
2018-02-16 06:04:04 +03:00
%{_sysconfdir} /ctdb/events.d/*
2018-02-16 06:03:07 +03:00
%dir %{_sysconfdir} /ctdb/nfs-checks.d
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
2016-08-27 10:26:52 +03:00
%{_libexecdir} /ctdb/ctdb_eventd
2016-02-12 02:12:13 +03:00
%{_libexecdir} /ctdb/ctdb_lock_helper
%{_libexecdir} /ctdb/ctdb_recovery_helper
2016-11-10 08:47:38 +03:00
%{_libexecdir} /ctdb/ctdb_takeover_helper
2015-12-08 08:23:50 +03:00
%{_libexecdir} /ctdb/ctdb_mutex_fcntl_helper
2016-11-21 09:39:02 +03:00
%{_libexecdir} /ctdb/ctdb_event
2016-02-12 02:12:13 +03:00
%{_libexecdir} /ctdb/ctdb_natgw
2016-04-07 10:30:28 +03:00
%{_libexecdir} /ctdb/ctdb_lvs
2016-03-03 02:34:48 +03:00
%{_libexecdir} /ctdb/ctdb_killtcp
2016-02-12 02:12:13 +03:00
%{_libexecdir} /ctdb/smnotify
2015-06-25 07:55:23 +03:00
%dir %{_libdir}
%{_libdir} /ctdb/lib*
2007-06-09 09:28:32 +04:00
%{_mandir} /man1/ctdb.1.gz
2016-02-12 11:40:43 +03:00
%{_mandir} /man1/ctdb_diagnostics.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
2018-04-04 12:17:59 +03:00
%{_mandir} /man5/ctdb-script.options.5.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
2018-03-05 12:38:51 +03:00
%attr (0700,root,root) %dir %{_localstatedir} /lib/ctdb
%attr (0700,root,root) %dir %{_localstatedir} /run/ctdb
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)
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)
2016-10-11 03:30:37 +03:00
%dir %{_datadir} /%{name} /tests
%{_datadir} /%{name} /tests/*
2016-08-04 06:36:28 +03:00
%dir %{_libexecdir} /%{name} /tests
%{_libexecdir} /%{name} /tests/*
2012-05-03 06:12:53 +04:00
%{_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
2018-03-05 12:34:48 +03:00
%dir %{_localstatedir} /lib/pcp/pmdas/ctdb
%{_localstatedir} /lib/pcp/pmdas/ctdb/*
2013-05-28 08:19:32 +04:00
%endif