mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
0352224262
This will replace the ctdb CLI tool "lvs" and "lvsmaster" options. It also makes LVS daemon support unnecessary. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
273 lines
7.4 KiB
RPMSpec
273 lines
7.4 KiB
RPMSpec
%define with_systemd %{?_with_systemd: 1} %{?!_with_systemd: 0}
|
|
%define initdir %{_sysconfdir}/init.d
|
|
Name: ctdb
|
|
Summary: Clustered TDB
|
|
Vendor: Samba Team
|
|
Packager: Samba Team <samba@samba.org>
|
|
Version: @VERSION@
|
|
Release: @RELEASE@
|
|
Epoch: 0
|
|
License: GNU GPL version 3
|
|
Group: System Environment/Daemons
|
|
URL: http://ctdb.samba.org/
|
|
|
|
Source: ctdb-%{version}.tar.gz
|
|
|
|
# Packages
|
|
Requires: coreutils, sed, gawk, iptables, iproute, procps, ethtool, sudo
|
|
# Commands - package name might vary
|
|
Requires: /usr/bin/killall, /bin/kill, /bin/netstat
|
|
|
|
Provides: ctdb = %{version}
|
|
|
|
Prefix: /usr
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
|
# Allow build with system libraries
|
|
# To enable, run rpmbuild with,
|
|
# "--with system_talloc"
|
|
# "--with system_tdb"
|
|
# "--with system_tevent"
|
|
#%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
|
|
|
|
# Required minimum library versions when building with system libraries
|
|
%define libtalloc_version 2.0.8
|
|
%define libtdb_version 1.2.11
|
|
%define libtevent_version 0.9.16
|
|
|
|
%if ! %with_included_talloc
|
|
BuildRequires: libtalloc-devel >= %{libtalloc_version}
|
|
Requires: libtalloc >= %{libtalloc_version}
|
|
%endif
|
|
%if ! %with_included_tdb
|
|
BuildRequires: libtdb-devel >= %{libtdb_version}
|
|
Requires: libtdb >= %{libtdb_version}
|
|
%endif
|
|
%if ! %with_included_tevent
|
|
BuildRequires: libtevent-devel >= %{libtevent_version}
|
|
Requires: libtevent >= %{libtevent_version}
|
|
%endif
|
|
|
|
# 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
|
|
|
|
%if %{with_systemd}
|
|
BuildRequires: systemd-units
|
|
%endif
|
|
|
|
%description
|
|
ctdb is the clustered database used by samba
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
%prep
|
|
%setup -q
|
|
# setup the init script and sysconfig file
|
|
%setup -T -D -n ctdb-%{version} -q
|
|
|
|
%build
|
|
|
|
## check for ccache
|
|
if ccache -h >/dev/null 2>&1 ; then
|
|
CC="ccache gcc"
|
|
else
|
|
CC="gcc"
|
|
fi
|
|
|
|
export CC
|
|
|
|
CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./buildtools/bin/waf configure \
|
|
--builtin-libraries=replace,popt \
|
|
--bundled-libraries=!talloc,!tevent,!tdb \
|
|
--minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
|
|
%if %with_pcp_pmda
|
|
--enable-pmda \
|
|
%endif
|
|
--prefix=%{_prefix} \
|
|
--includedir=%{_includedir}/ctdb \
|
|
--libdir=%{_libdir} \
|
|
--libexecdir=%{_libexecdir} \
|
|
--sysconfdir=%{_sysconfdir} \
|
|
--mandir=%{_mandir} \
|
|
--localstatedir="/var"
|
|
|
|
./buildtools/bin/waf build
|
|
|
|
%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
|
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
|
|
|
|
DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
|
|
|
|
install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
|
|
|
|
%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}
|
|
install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
|
|
%endif
|
|
|
|
# This is a hack. All documents should be installed in /usr/share/doc.
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events.d/README
|
|
cp config/events.d/README README.eventscripts
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/nfs-checks.d/README
|
|
cp config/nfs-checks.d/README README.nfs-checks.d
|
|
cp config/notify.d.README README.notify.d
|
|
|
|
# Remove "*.old" files
|
|
find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
#######################################################################
|
|
## Files section ##
|
|
#######################################################################
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/ctdb
|
|
%config(noreplace) %{_sysconfdir}/ctdb/notify.sh
|
|
%config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
|
|
%config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
|
|
%config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh
|
|
%config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
|
|
|
|
%if %{with_systemd}
|
|
%{_unitdir}/ctdb.service
|
|
%else
|
|
%attr(755,root,root) %{initdir}/ctdb
|
|
%endif
|
|
|
|
%attr(755,root,root) %{_sysconfdir}/ctdb/notify.d
|
|
|
|
%doc README COPYING
|
|
%doc README.eventscripts README.notify.d
|
|
%doc doc/recovery-process.txt
|
|
%doc doc/*.html
|
|
%doc doc/examples
|
|
%{_sysconfdir}/sudoers.d/ctdb
|
|
%{_sysconfdir}/ctdb/functions
|
|
%{_sysconfdir}/ctdb/events.d/00.ctdb
|
|
%{_sysconfdir}/ctdb/events.d/01.reclock
|
|
%{_sysconfdir}/ctdb/events.d/05.system
|
|
%{_sysconfdir}/ctdb/events.d/10.interface
|
|
%{_sysconfdir}/ctdb/events.d/10.external
|
|
%{_sysconfdir}/ctdb/events.d/13.per_ip_routing
|
|
%{_sysconfdir}/ctdb/events.d/11.natgw
|
|
%{_sysconfdir}/ctdb/events.d/11.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/49.winbind
|
|
%{_sysconfdir}/ctdb/events.d/50.samba
|
|
%{_sysconfdir}/ctdb/events.d/60.nfs
|
|
%{_sysconfdir}/ctdb/events.d/70.iscsi
|
|
%{_sysconfdir}/ctdb/events.d/91.lvs
|
|
%{_sysconfdir}/ctdb/events.d/99.timeout
|
|
%config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/00.portmapper.check
|
|
%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
|
|
%{_sysconfdir}/ctdb/statd-callout
|
|
%{_sysconfdir}/ctdb/nfs-linux-kernel-callout
|
|
%{_sbindir}/ctdbd
|
|
%{_sbindir}/ctdbd_wrapper
|
|
%{_bindir}/ctdb
|
|
%{_bindir}/ping_pong
|
|
%{_bindir}/ltdbtool
|
|
%{_bindir}/ctdb_diagnostics
|
|
%{_bindir}/onnode
|
|
%dir %{_libexecdir}/ctdb
|
|
%{_libexecdir}/ctdb/ctdb_lock_helper
|
|
%{_libexecdir}/ctdb/ctdb_event_helper
|
|
%{_libexecdir}/ctdb/ctdb_recovery_helper
|
|
%{_libexecdir}/ctdb/ctdb_natgw
|
|
%{_libexecdir}/ctdb/ctdb_lvs
|
|
%{_libexecdir}/ctdb/ctdb_killtcp
|
|
%{_libexecdir}/ctdb/smnotify
|
|
%dir %{_libdir}
|
|
%{_libdir}/ctdb/lib*
|
|
%{_libdir}/libtevent-unix-util.so.0*
|
|
%{_mandir}/man1/ctdb.1.gz
|
|
%{_mandir}/man1/ctdbd.1.gz
|
|
%{_mandir}/man1/ctdbd_wrapper.1.gz
|
|
%{_mandir}/man1/onnode.1.gz
|
|
%{_mandir}/man1/ltdbtool.1.gz
|
|
%{_mandir}/man1/ping_pong.1.gz
|
|
%{_mandir}/man5/ctdbd.conf.5.gz
|
|
%{_mandir}/man7/ctdb.7.gz
|
|
%{_mandir}/man7/ctdb-statistics.7.gz
|
|
%{_mandir}/man7/ctdb-tunables.7.gz
|
|
|
|
|
|
%package devel
|
|
Summary: CTDB development libraries
|
|
Group: Development/Libraries
|
|
|
|
%description devel
|
|
development libraries for ctdb
|
|
|
|
%files devel
|
|
%defattr(-,root,root)
|
|
%{_includedir}/ctdb/util/*.h
|
|
%{_libdir}/libtevent-unix-util.so
|
|
|
|
%package tests
|
|
Summary: CTDB test suite
|
|
Group: Development/Tools
|
|
Requires: ctdb = %{version}
|
|
Requires: nc
|
|
|
|
%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
|
|
|
|
%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
|