1 %define initdir %{_sysconfdir}/rc.d/init.d
5 Packager: Samba Team <samba@samba.org>
10 License: GNU GPL version 2
11 Group: System Environment/Daemons
12 URL: bzr://www.samba.org/~tridge/ctdb/
14 Source: ctdb-%{version}.tar.bz2
15 Source999: ctdb-setup.tar.bz2
17 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
18 Prereq: fileutils sed /etc/init.d
20 Requires: initscripts >= 5.54-1
21 Provides: ctdb = %{version}
24 BuildRoot: %{_tmppath}/%{name}-%{version}-root
27 ctdb is the clustered database used by samba
30 #######################################################################
34 # setup the init script and sysconfig file
35 %setup -T -D -a 999 -n ctdb-%{version} -q
41 ## always run autogen.sh
44 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
46 --sysconfdir=%{_sysconfdir} \
47 --localstatedir="/var"
53 # Clean up in case there is trash left from a previous build
54 rm -rf $RPM_BUILD_ROOT
56 # Create the target build directory hierarchy
57 mkdir -p $RPM_BUILD_ROOT%{_includedir}
58 mkdir -p $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
59 mkdir -p $RPM_BUILD_ROOT%{_prefix}/{bin,sbin}
60 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
61 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
62 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
64 make DESTDIR=$RPM_BUILD_ROOT install
66 install -m644 setup/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
67 install -m755 setup/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
68 install -m755 tools/events $RPM_BUILD_ROOT%{_sysconfdir}/ctdb/events
69 install -m755 tools/onnode.ssh $RPM_BUILD_ROOT%{_bindir}
70 install -m755 tools/onnode.rsh $RPM_BUILD_ROOT%{_bindir}
71 ln -sf %{_bindir}/onnode.ssh $RPM_BUILD_ROOT%{_bindir}/onnode
73 # unfortunately samba3 needs ctdb_private.h too
74 install -m644 include/ctdb_private.h $RPM_BUILD_ROOT%{_includedir}/ctdb_private.h
77 # Remove "*.old" files
78 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
81 rm -rf $RPM_BUILD_ROOT
84 /sbin/chkconfig --add ctdb
88 /sbin/chkconfig --del ctdb
89 /sbin/service ctdb stop >/dev/null 2>&1
94 if [ "$1" -ge "1" ]; then
95 %{initdir}/ctdb restart >/dev/null 2>&1
99 #######################################################################
101 #######################################################################
104 %defattr(-,root,root)
106 %config(noreplace) %{_sysconfdir}/sysconfig/ctdb
107 %attr(755,root,root) %config %{initdir}/ctdb
109 %{_sysconfdir}/ctdb/events
112 %{_bindir}/onnode.ssh
113 %{_bindir}/onnode.rsh
115 %{_includedir}/ctdb.h
116 %{_includedir}/ctdb_private.h