Summary: Cluster synchronization tool
Name: csync2
Version: 2.0
Release: 0.1.rc1
Group: Applications/System
License: GPLv2+
URL: http://oss.linbit.com/csync2/
Source0: csync2-%{version}.tar.gz
Source1: csync2-README.quickstart
Patch0: csync2-fix-xinetd.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): openssl
Requires: xinetd
BuildRequires: sqlite-devel sqlite librsync gnutls-devel librsync-devel
%description
Csync2 is a cluster synchronization tool. It can be used to keep files on
multiple hosts in a cluster in sync. Csync2 can handle complex setups with
much more than just 2 hosts, handle file deletions and can detect conflicts.
It is expedient for HA-clusters, HPC-clusters, COWs and server farms.
%prep
%setup -q
%patch0 -p1 -b .fix-xinetd
install -p -m 644 %{SOURCE1} README.quickstart
%build
%configure --sysconfdir=%{_sysconfdir}/csync2
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_var}/lib/csync2
install -p -D -m 644 csync2.xinetd %{buildroot}%{_sysconfdir}/xinetd.d/csync2
# We need these empty files to be able to %%ghost them
touch %{buildroot}%{_sysconfdir}/csync2/csync2_ssl_key.pem
touch %{buildroot}%{_sysconfdir}/csync2/csync2_ssl_cert.pem
%clean
rm -rf %{buildroot}
%post
umask 077
if [ ! -f %{_sysconfdir}/csync2/csync2_ssl_key.pem ]; then
/usr/bin/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %{_sysconfdir}/csync2/csync2_ssl_key.pem 2>/dev/null
fi
FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
FQDN=localhost.localdomain
fi
if [ ! -f %{_sysconfdir}/csync2/csync2_ssl_cert.pem ]; then
cat << EOF | /usr/bin/openssl req -new -key %{_sysconfdir}/csync2/csync2_ssl_key.pem -x509 -days 3000 -out %{_sysconfdir}/csync2/csync2_ssl_cert.pem 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
EOF
fi
%preun
# Cleanup all databases upon last removal
if [ $1 -eq 0 ]; then
%{__rm} -f %{_var}/lib/csync2/*
fi
%files
%defattr(-,root,root,-)
%doc README README.quickstart AUTHORS COPYING
%dir %{_sysconfdir}/csync2/
%config(noreplace) %{_sysconfdir}/csync2/csync2.cfg
%config(noreplace) %{_sysconfdir}/xinetd.d/csync2
%ghost %config %{_sysconfdir}/csync2/csync2_ssl_key.pem
%ghost %config %{_sysconfdir}/csync2/csync2_ssl_cert.pem
%{_sbindir}/csync2
%{_sbindir}/csync2-compare
%{_mandir}/man1/csync2.1*
%dir %{_var}/lib/csync2/
%changelog
* Tue Nov 13 2007 Matthias Saou 1.34-4
- Change configuration directory to be /etc/csync2/ since the program requires
quite a few files, and putting all of them in /etc/ was messy.
- Include certificate generation upon package installation, based on mod_ssl.
- Rewrite the csync2-README.quickstart file.
- Remove db files upon last removal.
* Tue Nov 13 2007 Matthias Saou 1.34-1
- Take ownership of the package.
- Update to 1.34.
* Tue Mar 27 2007 1.33-5
- Fix ownership of documentation directory (bz 233954)
* Thu Jan 25 2007 1.33-4
- Included a README.fedora with instructions on how to create a self-signed
certificate
- Included a mkcert.sh script to create a self-signed certificate
- Removed the creation of ssl certificate from the %%install section
* Wed Jan 22 2007 1.33-3
- Fixed the xinetd file so there's no need to specify the port in /etc/services
- Create ssl certificates
* Mon Jan 22 2007 1.33-2
- Some cleanups as per bz review 223633
* Sat Jan 20 2007 1.33-1
- Initial import