rpms/csync2/devel csync2-1.34-cfg.patch, NONE, 1.1 csync2-README.quickstart, NONE, 1.1 .cvsignore, 1.2, 1.3 csync2.spec, 1.3, 1.4 sources, 1.2, 1.3 csync2-README.fedora, 1.1, NONE csync2-mkcert.sh, 1.1, NONE

Matthias Saou (thias) fedora-extras-commits at redhat.com
Wed Nov 28 10:05:25 UTC 2007


Author: thias

Update of /cvs/extras/rpms/csync2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22531

Modified Files:
	.cvsignore csync2.spec sources 
Added Files:
	csync2-1.34-cfg.patch csync2-README.quickstart 
Removed Files:
	csync2-README.fedora csync2-mkcert.sh 
Log Message:
Update to 1.34 and major spec file cleanup and changes.


csync2-1.34-cfg.patch:

--- NEW FILE csync2-1.34-cfg.patch ---
diff -Naupr csync2-1.34.orig/csync2.cfg csync2-1.34/csync2.cfg
--- csync2-1.34.orig/csync2.cfg	2007-07-24 23:04:18.000000000 +0200
+++ csync2-1.34/csync2.cfg	2007-11-28 10:59:43.000000000 +0100
@@ -3,15 +3,18 @@
 # ---------------------------------
 #
 # Please read the documentation:
-# http://oss.linbit.com/csync2/paper.pdf
+# /usr/share/doc/csync2-*/README.quickstart
+# /usr/share/doc/csync2-*/paper.pdf
+# csync2(1) man page
 
 # group mygroup
 # {
 # 	host host1 host2 (host3);
 # 	host host4 at host4-eth2;
 #
-# 	key /etc/csync2.key_mygroup;
+# 	key /etc/csync2/csync2.key_mygroup;
 #
+# 	include /etc/csync2/csync2.cfg;
 # 	include /etc/apache;
 # 	include %homedir%/bob;
 # 	exclude %homedir%/bob/temp;


--- NEW FILE csync2-README.quickstart ---
Getting started with csync2 :

There's no need to define the port for csync2 in /etc/services, although the
manual says so. Port 30865/tcp is defined in /etc/xinetd.d/csync2. All commands
detailed here need to be executed as root, so be extra careful.

The config file for csync2 is /etc/csync2/csync2.cfg. Here is an example :

mygroup {
  host host1;
  host host2;
  key     /etc/csync2/mygroup.key;
  include /etc/csync2/csync2.cfg;
  include /etc/testfile;
}

This will sync the csync2 configuration and /etc/testfile between host1 and
host2. Create the file on host1. Note that hostnames need to be the FQDN
returned by "hostname".

Generate the pre-shared key used for authentication :
  csync2 -k /etc/csync2/mygroup.key

Copy the configuration file and the pre-shared key to host2:
  scp /etc/csync2/csync2.cfg /etc/csync2/mygroup.key host2:/etc/csync2/

The SSL key and certificate are generated upon package installation, but you
can replace them with your own if you like. The files are :
  /etc/csync2/csync2_ssl_key.pem
  /etc/csync2/csync2_ssl_cert.pem

The csync2 service is disabled by default. To start it on both your hosts :
  chkconfig csync2 on
  chkconfig --level 345 xinetd on
  service xinetd restart

If you are running iptables, you need to open tcp port 30865 on both hosts so
that the other host can connect.

Now you should be able to run and initial verbose sync on both hosts :
    csync2 -xv

Once everything looks good, you can add a file with the following line as
/etc/cron.d/csync2 or add it to /etc/crontab :

*/5 * * * * root csync2 -x

Happy syncing!



Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/csync2/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	26 Jan 2007 19:10:46 -0000	1.2
+++ .cvsignore	28 Nov 2007 10:04:52 -0000	1.3
@@ -1 +1 @@
-csync2-1.33.tar.gz
+csync2-1.34.tar.gz


Index: csync2.spec
===================================================================
RCS file: /cvs/extras/rpms/csync2/devel/csync2.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- csync2.spec	27 Mar 2007 21:09:42 -0000	1.3
+++ csync2.spec	28 Nov 2007 10:04:52 -0000	1.4
@@ -1,75 +1,132 @@
-Summary:        A cluster synchronization tool
-Name:           csync2
-Version:        1.33 
-Release:        5%{?dist}
-Group:          Applications/System
-License:        GPL
-URL:            http://oss.linbit.com/csync2 
-Source0:        http://oss.linbit.com/csync2/%{name}-%{version}.tar.gz
-Source1:        csync2-README.fedora
-Source2:        csync2-mkcert.sh
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Requires:       xinetd
-BuildRequires:  sqlite2-devel, librsync-devel, bison, flex, gnutls-devel, libtasn1-devel
-
-Patch0:         csync2-fix-xinetd.patch
+Summary: Cluster synchronization tool
+Name: csync2
+Version: 1.34
+Release: 5%{?dist}
+License: GPLv2+
+Group: Applications/System
+URL: http://oss.linbit.com/csync2/
+Source0: http://oss.linbit.com/csync2/%{name}-%{version}.tar.gz
+Source1: csync2-README.quickstart
+Patch0: csync2-fix-xinetd.patch
+Patch1: csync2-1.34-cfg.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Requires: xinetd
+Requires(post): openssl
+BuildRequires: sqlite2-devel
+BuildRequires: librsync-devel
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gnutls-devel
+BuildRequires: libtasn1-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 
+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} -m 644 %{SOURCE1} README.fedora
-%{__install} -m 644 -D %{SOURCE2} examples/mkcert.sh
+%patch1 -p1 -b .cfg
+install -p -m 0644 %{SOURCE1} README.quickstart
 
 
 %build
-%configure
+%configure --sysconfdir=%{_sysconfdir}/csync2
 make %{?_smp_mflags}
 
 
 %install
 rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
-%{__install} -d %{buildroot}%{_localstatedir}/lib/%{name}
-%{__install} -p -D -m 644 csync2.xinetd %{buildroot}%{_sysconfdir}/xinetd.d/%{name}
+mkdir -p %{buildroot}%{_var}/lib/csync2
+install -D -p -m 0644 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 AUTHORS COPYING README README.quickstart paper.pdf
+%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.gz
-%config(noreplace) %{_sysconfdir}/csync2.cfg 
-%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
-
-%dir %{_localstatedir}/lib/%{name}
+%{_mandir}/man1/csync2.1*
+%dir %{_var}/lib/csync2/
 
-%doc README README.fedora AUTHORS COPYING paper.pdf
-%doc examples
 
+%changelog
+* Wed Nov 28 2007 Matthias Saou <http://freshrpms.net/> 1.34-5
+- Include cfg patch to include pointers to local doc and better defaults.
 
+* Tue Nov 13 2007 Matthias Saou <http://freshrpms.net/> 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 <http://freshrpms.net/> 1.34-1
+- Take ownership of the package.
+- Update to 1.34.
 
-%changelog
 * Tue Mar 27 2007 <ruben at rubenkerkhof.com> 1.33-5
 - Fix ownership of documentation directory (bz 233954)
+
 * Thu Jan 25 2007 <ruben at rubenkerkhof.com> 1.33-4
-- Included a README.fedora with instructions on how to create a self-signed certificate
+- 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 <ruben at rubenkerkhof.com> 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 <ruben at rubenkerkhof.com> 1.33-2
 - Some cleanups as per bz review 223633
+
 * Sat Jan 20 2007 <ruben at rubenkerkhof.com> 1.33-1
 - Initial import
+


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/csync2/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	26 Jan 2007 19:10:46 -0000	1.2
+++ sources	28 Nov 2007 10:04:52 -0000	1.3
@@ -1 +1 @@
-e16e3c0f4285439cef09a6b63319a0b0  csync2-1.33.tar.gz
+efc8a3548996b79cef2ad76af5e93cd8  csync2-1.34.tar.gz


--- csync2-README.fedora DELETED ---


--- csync2-mkcert.sh DELETED ---




More information about the fedora-extras-commits mailing list