SHA256
1
0
forked from pool/csync2

Add systemd foo, get rid of some obsolete patches

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/csync2?expand=0&rev=25
This commit is contained in:
2013-09-03 12:41:16 +00:00
committed by Git OBS Bridge
parent db6645b046
commit bd7d9e9f31
6 changed files with 44 additions and 80 deletions

View File

@@ -28,29 +28,27 @@ Url: http://oss.linbit.com/csync2/
Source0: %{name}-%{version}.tar.bz2
Source1: csync2-README.quickstart
Source2: csync2-rm-ssl-cert
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Source3: csync2.socket
Source4: csync2@.service
Patch0: csync2-fix-xinetd.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch3: force-debug-stderr-off-inetd.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch4: bind-to-local-hostname.patch
Patch10: add-ac_prog_cpp.patch
Patch11: fix-csync2_ssl_cert-filename.patch
Patch12: fix-sonames.patch
Requires: openssl
Requires: sqlite3
%{?systemd_requires}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: libgnutls-devel
BuildRequires: libmysqlclient-devel
BuildRequires: librsync-devel
BuildRequires: librsync-devel
BuildRequires: pkgconfig
BuildRequires: postgresql-devel
BuildRequires: sqlite3-devel
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif
# texlive is for pdflatex to build PDF version of the manual
BuildRequires: texlive-latex
BuildRequires: texlive-nopageno
@@ -68,23 +66,18 @@ It is expedient for HA-clusters, HPC-clusters, COWs and server farms.
# 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
%patch0 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -I/usr/include/pgsql"
export CFLAGS="$RPM_OPT_FLAGS"
if ! [ -f configure ]; then ./autogen.sh; fi
%configure --enable-mysql --enable-postgres --enable-sqlite3 \
%configure --enable-sqlite3 \
--sysconfdir=%{_sysconfdir}/csync2 --docdir=%{_docdir}/%{name}
make all
#make %{?_smp_mflags}
make %{?_smp_mflags}
%install
%makeinstall
@@ -92,11 +85,18 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/csync2
install -p -D -m 644 csync2.xinetd %{buildroot}%{_sysconfdir}/xinetd.d/csync2
install -p -m 644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/README.quickstart
install -p -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/csync2-rm-ssl-cert
mkdir -p %{buildroot}%{_unitdir}
install -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/
install -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/
# 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
%pre
%service_add_pre csync2.socket
%post
%service_add_post csync2.socket
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
@@ -118,15 +118,21 @@ EOF
fi
%preun
%service_del_preun csync2.socket
# Cleanup all databases upon last removal
if [ $1 -eq 0 ]; then
rm -f %{_localstatedir}/lib/csync2/*
fi
%postun
%service_del_postun csync2.socket
%files
%defattr(-,root,root)
%{_sbindir}/csync2
%{_sbindir}/csync2-compare
%{_unitdir}/csync2.socket
%{_unitdir}/csync2@.service
%dir %{_localstatedir}/lib/csync2/
%{_docdir}/%{name}
%dir %{_sysconfdir}/csync2/