1 %define with_systemd %{?_with_systemd: 1} %{?!_with_systemd: 0}
2 %define initdir %{_sysconfdir}/init.d
6 Packager: Samba Team <samba@samba.org>
10 License: GNU GPL version 3
11 Group: System Environment/Daemons
12 URL: http://ctdb.samba.org/
14 Source: ctdb-%{version}.tar.gz
17 Requires: coreutils, sed, gawk, iptables, iproute, procps, ethtool, sudo
18 # Commands - package name might vary
19 Requires: /usr/bin/killall, /bin/kill, /bin/netstat
21 Provides: ctdb = %{version}
24 BuildRoot: %{_tmppath}/%{name}-%{version}-root
26 # Allow build with system libraries
27 # To enable, run rpmbuild with,
28 # "--with system_talloc"
30 # "--with system_tevent"
31 #%define with_included_talloc %{?_with_system_talloc: 0} %{?!_with_system_talloc: 1}
32 #%define with_included_tdb %{?_with_system_tdb: 0} %{?!_with_system_tdb: 1}
33 #%define with_included_tevent %{?_with_system_tevent: 0} %{?!_with_system_tevent: 1}
35 %define with_included_talloc 0
36 %define with_included_tevent 0
37 %define with_included_tdb 0
39 # Required minimum library versions when building with system libraries
40 %define libtalloc_version 2.0.8
41 %define libtdb_version 1.3.11
42 %define libtevent_version 0.9.16
44 %if ! %with_included_talloc
45 BuildRequires: libtalloc-devel >= %{libtalloc_version}
46 Requires: libtalloc >= %{libtalloc_version}
48 %if ! %with_included_tdb
49 BuildRequires: libtdb-devel >= %{libtdb_version}
50 Requires: libtdb >= %{libtdb_version}
52 %if ! %with_included_tevent
53 BuildRequires: libtevent-devel >= %{libtevent_version}
54 Requires: libtevent >= %{libtevent_version}
57 # To build the ctdb-pcp-pmda package, run rpmbuild with "--with pmda"
58 %define with_pcp_pmda %{?_with_pmda: 1} %{?!_with_pmda: 0}
60 BuildRequires: pcp-libs-devel
64 BuildRequires: systemd-units
68 ctdb is the clustered database used by samba
70 #######################################################################
76 # setup the init script and sysconfig file
77 %setup -T -D -n ctdb-%{version} -q
82 if ccache -h >/dev/null 2>&1 ; then
90 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./buildtools/bin/waf configure \
91 --builtin-libraries=replace,popt \
92 --bundled-libraries=!talloc,!tevent,!tdb \
93 --minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
98 --includedir=%{_includedir}/ctdb \
100 --libexecdir=%{_libexecdir} \
101 --sysconfdir=%{_sysconfdir} \
102 --mandir=%{_mandir} \
103 --localstatedir=%{_localstatedir}
105 ./buildtools/bin/waf build
108 # Clean up in case there is trash left from a previous build
109 rm -rf $RPM_BUILD_ROOT
111 # Create the target build directory hierarchy
112 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
114 DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
116 install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
117 install -m644 config/ctdb.tunables $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
118 install -m644 config/script.options $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
120 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
121 install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
124 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
125 install -m 755 config/ctdb.service $RPM_BUILD_ROOT%{_unitdir}
127 mkdir -p $RPM_BUILD_ROOT%{initdir}
128 install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
131 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/notify.d
133 # This is a hack. All documents should be installed in /usr/share/doc.
134 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events.d/README
135 cp config/events.d/README README.eventscripts
136 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/nfs-checks.d/README
137 cp config/nfs-checks.d/README README.nfs-checks.d
138 cp config/notify.d.README README.notify.d
140 # Remove "*.old" files
141 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
144 rm -rf $RPM_BUILD_ROOT
147 #######################################################################
149 #######################################################################
152 %defattr(-,root,root)
154 %config(noreplace) %{_sysconfdir}/ctdb/ctdbd.conf
155 %config(noreplace) %{_sysconfdir}/ctdb/ctdb.tunables
156 %config(noreplace) %{_sysconfdir}/ctdb/script.options
157 %{_sysconfdir}/ctdb/notify.sh
158 %dir %{_sysconfdir}/ctdb/notify.d
159 %config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
160 %config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
161 %config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
163 %config(noreplace, missingok) %{_sysconfdir}/sysconfig/ctdb
166 %{_unitdir}/ctdb.service
168 %attr(755,root,root) %{initdir}/ctdb
171 %attr(755,root,root) %{_sysconfdir}/ctdb/notify.d
174 %doc README.eventscripts README.notify.d
175 %doc doc/recovery-process.txt
176 %doc doc/cluster_mutex_helper.txt
179 %{_sysconfdir}/sudoers.d/ctdb
180 %dir %{_sysconfdir}/ctdb
181 %{_sysconfdir}/ctdb/functions
182 %dir %{_sysconfdir}/ctdb/events.d
183 %{_sysconfdir}/ctdb/events.d/*
184 %dir %{_sysconfdir}/ctdb/nfs-checks.d
185 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/00.portmapper.check
186 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/10.status.check
187 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/20.nfs.check
188 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/30.nlockmgr.check
189 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/40.mountd.check
190 %config(noreplace) %{_sysconfdir}/ctdb/nfs-checks.d/50.rquotad.check
191 %{_sysconfdir}/ctdb/statd-callout
192 %{_sysconfdir}/ctdb/nfs-linux-kernel-callout
194 %{_sbindir}/ctdbd_wrapper
198 %{_bindir}/ctdb_diagnostics
200 %dir %{_libexecdir}/ctdb
201 %{_libexecdir}/ctdb/*
204 %{_mandir}/man1/ctdb.1.gz
205 %{_mandir}/man1/ctdb_diagnostics.1.gz
206 %{_mandir}/man1/ctdbd.1.gz
207 %{_mandir}/man1/ctdbd_wrapper.1.gz
208 %{_mandir}/man1/onnode.1.gz
209 %{_mandir}/man1/ltdbtool.1.gz
210 %{_mandir}/man1/ping_pong.1.gz
211 %{_mandir}/man5/ctdb.conf.5.gz
212 %{_mandir}/man5/ctdb-script.options.5.gz
213 %{_mandir}/man5/ctdb.sysconfig.5.gz
214 %{_mandir}/man5/ctdbd.conf.5.gz
215 %{_mandir}/man7/ctdb.7.gz
216 %{_mandir}/man7/ctdb-statistics.7.gz
217 %{_mandir}/man7/ctdb-tunables.7.gz
218 %attr(0700,root,root) %dir %{_localstatedir}/lib/ctdb
219 %attr(0700,root,root) %dir %{_localstatedir}/lib/ctdb/*
220 %attr(0700,root,root) %dir %{_localstatedir}/run/ctdb
224 Summary: CTDB development libraries
225 Group: Development/Libraries
228 development libraries for ctdb
231 %defattr(-,root,root)
234 Summary: CTDB test suite
235 Group: Development/Tools
236 Requires: ctdb = %{version}
243 %defattr(-,root,root)
244 %dir %{_datadir}/%{name}/tests
245 %{_datadir}/%{name}/tests/*
246 %dir %{_libexecdir}/%{name}/tests
247 %{_libexecdir}/%{name}/tests/*
248 %{_bindir}/ctdb_run_tests
249 %{_bindir}/ctdb_run_cluster_tests
255 Summary: CTDB PCP pmda support
256 Group: Development/Tools
257 Requires: ctdb = %{version}
260 %description pcp-pmda
261 Performance Co-Pilot (PCP) support for CTDB
264 %dir %{_localstatedir}/lib/pcp/pmdas/ctdb
265 %{_localstatedir}/lib/pcp/pmdas/ctdb/*