2007-05-28 00:48:18 +04:00
%define initdir %{_sysconfdir}/rc.d/init.d
Summary : Clustered TDB
Vendor : Samba Team
Packager : Samba Team <samba@samba.org>
Name : ctdb
Version : 1.0
Release : 1
Epoch : 0
License : GNU GPL version 2
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
Source : ctdb-%{version} .tar.bz2
2007-05-29 09:15:00 +04:00
Source999 : ctdb-setup.tar.bz2
2007-05-28 00:48:18 +04:00
2007-06-01 15:10:49 +04:00
Prereq : /sbin/chkconfig /bin/mktemp /usr/bin/killall /usr/bin/nc
2007-05-28 00:48:18 +04:00
Prereq : fileutils sed /etc/init.d
Requires : initscripts >= 5.54-1
Provides : ctdb = %{version}
Prefix : /usr
BuildRoot : %{_tmppath} /%{name} -%{version} -root
%description
ctdb is the clustered database used by samba
#######################################################################
%prep
%setup -q
# setup the init script and sysconfig file
%setup -T -D -a 999 -n ctdb-%{version} -q
%build
2007-05-29 09:15:00 +04:00
CC=" g c c "
2007-05-28 00:48:18 +04:00
## always run autogen.sh
./autogen.sh
CFLAGS=" $RPM_OPT_FLAGS $ E X T R A - D _ G N U _ S O U R C E " ./configure \
--prefix=%{_prefix} \
2007-05-29 10:23:47 +04:00
--sysconfdir=%{_sysconfdir} \
--localstatedir=" / v a r "
2007-05-28 00:48:18 +04:00
2007-05-29 09:52:03 +04:00
make showflags
2007-05-28 00:48:18 +04:00
make
%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 %{_includedir}
mkdir -p $RPM_BUILD_ROOT {%{_libdir} ,%{_includedir} }
mkdir -p $RPM_BUILD_ROOT %{_prefix} /{bin,sbin}
2007-05-29 09:15:00 +04:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /ctdb
2007-06-01 14:54:26 +04:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /ctdb/events.d
2007-05-28 00:48:18 +04:00
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig
mkdir -p $RPM_BUILD_ROOT %{_sysconfdir} /rc.d/init.d
2007-05-29 09:15:00 +04:00
make DESTDIR=$RPM_BUILD_ROOT install
2007-05-28 00:48:18 +04:00
install -m644 setup/ctdb.sysconfig $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/ctdb
install -m755 setup/ctdb.init $RPM_BUILD_ROOT %{initdir} /ctdb
2007-05-29 16:53:28 +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
%post
2007-05-29 10:02:02 +04:00
/sbin/chkconfig --add ctdb
2007-05-28 00:48:18 +04:00
%preun
if [ $1 = 0 ] ; then
/sbin/chkconfig --del ctdb
/sbin/service ctdb stop >/dev/null 2>&1
fi
exit 0
%postun
if [ " $ 1 " -ge " 1 " ]; then
%{initdir} /ctdb restart >/dev/null 2>&1
fi
#######################################################################
## Files section ##
#######################################################################
%files
%defattr (-,root,root)
%config (noreplace) %{_sysconfdir} /sysconfig/ctdb
%attr (755,root,root) %config %{initdir} /ctdb
2007-05-29 09:15:00 +04:00
%{_sysconfdir} /ctdb/events
2007-06-01 14:54:26 +04:00
%{_sysconfdir} /ctdb/functions
%{_sysconfdir} /ctdb/events.d/samba
%{_sysconfdir} /ctdb/events.d/nfslock
2007-05-31 05:09:45 +04:00
%{_sysconfdir} /ctdb/statd-callout
2007-05-29 09:15:00 +04:00
%{_sbindir} /ctdbd
%{_bindir} /ctdb
2007-05-30 05:17:52 +04:00
%{_bindir} /onnode.ssh
%{_bindir} /onnode.rsh
%{_bindir} /onnode
2007-05-28 00:48:18 +04:00
%{_includedir} /ctdb.h
2007-05-29 16:53:28 +04:00
%{_includedir} /ctdb_private.h