Summary: Cluster sync tool
-Summary(pl): Narzêdzie do synchronizacji klastra
+Summary(pl.UTF-8): Narzędzie do synchronizacji klastra
Name: csync2
-Version: 1.22
-Release: 0.1
-License: GPL
+Version: 2.0
+Release: 1
+License: GPL v2+
Group: Daemons
Source0: http://oss.linbit.com/csync2/%{name}-%{version}.tar.gz
-# Source0-md5: 6504aba35683d1663fb530b50f4c1dfd
+# Source0-md5: 4e189ff02af441e588ceaa7791732162
+Source1: %{name}.init
+Source2: %{name}.inet
+Source3: %{name}.sysconfig
+Patch0: %{name}-fix-sonames.patch
URL: http://oss.linbit.com/csync2/
BuildRequires: bison
BuildRequires: flex
+BuildRequires: gnutls-devel
BuildRequires: librsync-devel
BuildRequires: openssl-devel
-BuildRequires: sqlite-devel
+BuildRequires: sqlite3-devel
+BuildRequires: texlive-format-pdflatex
+Requires: setup > 2.4.10-4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _sysconfdir /etc/%{name}
+
%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
detect conflicts. It is expedient for HA-clusters, HPC-clusters, COWs
and server farms.
-%description -l pl
-Csync2 to narzêdzie do synchronizacji klastra. Mo¿e byæ u¿ywane do
-utrzymywania zgodno¶ci plików na wielu hostach w klastrze. Csync2 jest
-w stanie obs³u¿yæ z³o¿one konfiguracje z wiêcej ni¿ 2 hostami,
-obs³ugiwaæ usuwanie plików i wykrywaæ konflikty. Jest praktyczne dla
-klastrów HA, HPC, COW oraz farm serwerów.
+%description -l pl.UTF-8
+Csync2 to narzędzie do synchronizacji klastra. Może być używane do
+utrzymywania zgodności plików na wielu hostach w klastrze. Csync2 jest
+w stanie obsłużyć złożone konfiguracje z więcej niż 2 hostami,
+obsługiwać usuwanie plików i wykrywać konflikty. Jest praktyczne dla
+klastrów HA, HPC, COW oraz farm serwerów.
+
+%package -n csync2-inetd
+Summary: Files necessary to run csync2 in inetd service mode
+Summary(pl.UTF-8): Pliki niezbędne do uruchomienia csync2 w trybie usługi inetd
+Group: Networking/Daemons
+Requires: %{name} = %{version}-%{release}
+Requires: rc-inetd
+Provides: csyncd
+Provides: csyncd-inetd
+Obsoletes: csyncd
+Obsoletes: csync2-standalone
+Obsoletes: csyncd-standalone
+
+%description -n csync2-inetd
+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.
+
+%description -n csync2-inetd -l pl.UTF-8
+Csync2 to narzędzie do synchronizacji klastra. Może być używane do
+utrzymywania zgodności plików na wielu hostach w klastrze. Csync2 jest
+w stanie obsłużyć złożone konfiguracje z więcej niż 2 hostami,
+obsługiwać usuwanie plików i wykrywać konflikty. Jest praktyczne dla
+klastrów HA, HPC, COW oraz farm serwerów.
+
+%package -n csync2-standalone
+Summary: Files necessary to run csync2 in standalone daemon mode
+Summary(pl.UTF-8): Pliki niezbędne do uruchomienia csync2 w trybie samodzielnego serwera
+Group: Networking/Daemons
+Requires(post,preun): /sbin/chkconfig
+Requires: %{name} = %{version}-%{release}
+Provides: csyncd
+Provides: csyncd-standalone
+Obsoletes: csyncd
+Obsoletes: csync2-inetd
+Obsoletes: csyncd-inetd
+
+%description -n csync2-standalone
+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.
+
+%description -n csync2-standalone -l pl.UTF-8
+Csync2 to narzędzie do synchronizacji klastra. Może być używane do
+utrzymywania zgodności plików na wielu hostach w klastrze. Csync2 jest
+w stanie obsłużyć złożone konfiguracje z więcej niż 2 hostami,
+obsługiwać usuwanie plików i wykrywać konflikty. Jest praktyczne dla
+klastrów HA, HPC, COW oraz farm serwerów.
%prep
%setup -q
+%patch0 -p1
%build
-%configure
-%{__make} all
+%configure \
+ --disable-gnutls
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sbindir}
-install csync2 $RPM_BUILD_ROOT%{_sbindir}
-install -d $RPM_BUILD_ROOT%{_var}/lib/csync2
+install -d $RPM_BUILD_ROOT{%{_var}/lib/csync2,/etc/{sysconfig/rc-inetd,rc.d/init.d}}
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/%{name}
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
-%post
-if ! grep -q "^csync2" /etc/services ; then
- echo -e "csync2\t\t30865/tcp\t\t# Cluster sync" >> /etc/services
+%post -n csync2-inetd
+%service -q rc-inetd reload
+
+%postun -n csync2-inetd
+if [ "$1" = "0" ]; then
+ %service -q rc-inetd reload
+fi
+
+%post -n csync2-standalone
+/sbin/chkconfig --add csync2
+%service csync2 restart "csync2 server"
+
+%preun -n csync2-standalone
+if [ "$1" = "0" ]; then
+ %service csync2 stop
+ /sbin/chkconfig --del csync2
fi
%files
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README TODO
+%doc AUTHORS ChangeLog README csync2.xinetd doc/csync2_paper.pdf
+%dir %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/csync2.cfg
%attr(755,root,root) %{_sbindir}/csync2
+%attr(755,root,root) %{_sbindir}/csync2-compare
%dir %{_var}/lib/csync2
+%{_mandir}/man1/*.1*
+
+%files -n csync2-inetd
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/%{name}
+
+%files -n csync2-standalone
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%attr(754,root,root) /etc/rc.d/init.d/%{name}