2010-06-29 18:02:56 +02:00
|
|
|
#
|
2011-10-26 15:22:17 +02:00
|
|
|
# spec file for package csync2
|
2010-06-29 18:02:56 +02:00
|
|
|
#
|
2013-02-28 07:49:03 +01:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2010-06-29 18:02:56 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Summary: Cluster synchronization tool
|
2013-08-22 11:22:31 +02:00
|
|
|
License: GPL-2.0+
|
2012-02-21 03:43:46 +01:00
|
|
|
Group: Productivity/Clustering/HA
|
2010-06-29 18:02:56 +02:00
|
|
|
|
|
|
|
Name: csync2
|
2013-08-22 11:22:31 +02:00
|
|
|
Version: 2.0+git.1368794815.cf835a7
|
2012-02-21 03:43:46 +01:00
|
|
|
Release: 0
|
2010-06-29 18:02:56 +02:00
|
|
|
Url: http://oss.linbit.com/csync2/
|
2013-08-22 11:22:31 +02:00
|
|
|
#Source0: http://oss.linbit.com/csync2/%{name}-%{version}.tar.gz
|
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
2010-06-29 18:02:56 +02:00
|
|
|
Source1: csync2-README.quickstart
|
2011-10-26 15:22:17 +02:00
|
|
|
Source2: csync2-rm-ssl-cert
|
2013-08-22 11:22:31 +02:00
|
|
|
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2010-06-29 18:02:56 +02:00
|
|
|
Patch0: csync2-fix-xinetd.patch
|
2013-08-22 11:22:31 +02:00
|
|
|
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2012-04-23 13:14:02 +02:00
|
|
|
Patch3: force-debug-stderr-off-inetd.patch
|
2013-08-22 11:22:31 +02:00
|
|
|
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
2013-05-10 15:01:15 +02:00
|
|
|
Patch4: bind-to-local-hostname.patch
|
2013-08-22 11:22:31 +02:00
|
|
|
Patch10: add-ac_prog_cpp.patch
|
2013-09-02 08:59:37 +02:00
|
|
|
Patch11: fix-csync2_ssl_cert-filename.patch
|
2013-09-02 10:49:30 +02:00
|
|
|
Patch12: fix-sonames.patch
|
2013-08-22 11:22:31 +02:00
|
|
|
|
|
|
|
Requires: openssl
|
|
|
|
Requires: sqlite3
|
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2012-02-21 03:43:46 +01:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: libgnutls-devel
|
2013-08-22 11:22:31 +02:00
|
|
|
BuildRequires: libmysqlclient-devel
|
|
|
|
BuildRequires: librsync-devel
|
2012-02-21 03:43:46 +01:00
|
|
|
BuildRequires: librsync-devel
|
2013-08-22 11:22:31 +02:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: postgresql-devel
|
|
|
|
BuildRequires: sqlite3-devel
|
|
|
|
# texlive is for pdflatex to build PDF version of the manual
|
|
|
|
BuildRequires: texlive-latex
|
|
|
|
BuildRequires: texlive-nopageno
|
|
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-06-29 18:02:56 +02:00
|
|
|
|
|
|
|
%description
|
2013-08-22 11:22:31 +02:00
|
|
|
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.
|
2010-06-29 18:02:56 +02:00
|
|
|
|
|
|
|
%prep
|
2013-08-22 11:22:31 +02:00
|
|
|
%setup
|
|
|
|
# Is this next really necessary?
|
|
|
|
%{?suse_update_config:%{suse_update_config}}
|
|
|
|
|
|
|
|
#%patch0 -p1 -b .fix-xinetd
|
|
|
|
# might actually want patch3
|
|
|
|
#%patch3 -p1
|
|
|
|
# patch4 needs rewriting, presumably
|
|
|
|
#%patch4 -p1
|
2013-09-02 08:59:37 +02:00
|
|
|
%patch10 -p1
|
|
|
|
%patch11 -p1
|
2013-09-02 10:49:30 +02:00
|
|
|
%patch12 -p1
|
2010-06-29 18:02:56 +02:00
|
|
|
|
|
|
|
%build
|
2013-08-22 11:22:31 +02:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -I/usr/include/pgsql"
|
|
|
|
if ! [ -f configure ]; then ./autogen.sh; fi
|
|
|
|
%configure --enable-mysql --enable-postgres --enable-sqlite3 \
|
|
|
|
--sysconfdir=%{_sysconfdir}/csync2 --docdir=%{_docdir}/%{name}
|
|
|
|
|
|
|
|
make all
|
|
|
|
#make %{?_smp_mflags}
|
2010-06-29 18:02:56 +02:00
|
|
|
|
|
|
|
%install
|
2013-08-22 11:22:31 +02:00
|
|
|
%makeinstall
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/csync2
|
2010-06-29 18:02:56 +02:00
|
|
|
install -p -D -m 644 csync2.xinetd %{buildroot}%{_sysconfdir}/xinetd.d/csync2
|
2013-09-02 09:24:58 +02:00
|
|
|
install -p -m 644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/README.quickstart
|
2011-10-26 15:22:17 +02:00
|
|
|
install -p -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/csync2-rm-ssl-cert
|
2010-06-29 18:02:56 +02:00
|
|
|
# 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
|
|
|
|
|
|
|
|
%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
|
|
|
|
SomeOrganization
|
|
|
|
SomeName
|
|
|
|
name@example.com
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun
|
|
|
|
# Cleanup all databases upon last removal
|
|
|
|
if [ $1 -eq 0 ]; then
|
2013-08-22 11:22:31 +02:00
|
|
|
rm -f %{_localstatedir}/lib/csync2/*
|
2010-06-29 18:02:56 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
2013-08-22 11:22:31 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_sbindir}/csync2
|
|
|
|
%{_sbindir}/csync2-compare
|
|
|
|
%dir %{_localstatedir}/lib/csync2/
|
|
|
|
%{_docdir}/%{name}
|
2010-06-29 18:02:56 +02:00
|
|
|
%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
|
2011-10-26 15:22:17 +02:00
|
|
|
%{_sbindir}/csync2-rm-ssl-cert
|
2010-06-29 18:02:56 +02:00
|
|
|
%{_mandir}/man1/csync2.1*
|
|
|
|
|
|
|
|
%changelog
|