%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 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.3.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}/sudoers.d DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb # 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 <