[packages/libopensync02] - added swig patch (fix swig 2+ detection) - added memset patch (fix for invalid usage of sizeof det

qboosh qboosh at pld-linux.org
Sat Jan 31 18:31:22 CET 2015


commit 4d038e8a9437ac311a20e9a950554c18c763dcc3
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Jan 31 18:33:33 2015 +0100

    - added swig patch (fix swig 2+ detection)
    - added memset patch (fix for invalid usage of sizeof detected by gcc)
    - added link patch (libopensync-xml linking fix)
    - general cleanups

 libopensync02-link.patch   |  8 +++++
 libopensync02-memset.patch | 11 +++++++
 libopensync02-swig.patch   | 15 ++++++++++
 libopensync02.spec         | 75 ++++++++++++++++++++++++++++++++--------------
 4 files changed, 86 insertions(+), 23 deletions(-)
---
diff --git a/libopensync02.spec b/libopensync02.spec
index 61ead8b..175ad63 100644
--- a/libopensync02.spec
+++ b/libopensync02.spec
@@ -14,17 +14,23 @@ Group:		Libraries
 Source0:	http://opensync.org/download/releases/%{version}/libopensync-%{version}.tar.bz2
 # Source0-md5:	f563ce2543312937a9afb4f8445ef932
 Patch0:		%{name}-py-m4.patch
+Patch1:		%{name}-swig.patch
+Patch2:		%{name}-memset.patch
+Patch3:		%{name}-link.patch
 URL:		http://www.opensync.org/
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.58
 BuildRequires:	automake
+BuildRequires:	check-devel >= 0.9.0
+BuildRequires:	glib2-devel >= 2.0
 BuildRequires:	libtool
-BuildRequires:	libxml2-devel
+BuildRequires:	libxml2-devel >= 2.0
+BuildRequires:	pkgconfig
 BuildRequires:	sed >= 4.0
 BuildRequires:	sqlite3-devel
 %if %{with python}
-BuildRequires:	python-devel
-BuildRequires:	python-modules
-BuildRequires:	swig-python
+BuildRequires:	python-devel >= 2.2
+BuildRequires:	python-modules >= 2.2
+BuildRequires:	swig-python >= 1.3.17
 %endif
 # no such opensync plugins (yet?)
 Obsoletes:	multisync-ldap
@@ -100,10 +106,14 @@ Wiązania Pythona do biblioteki opensync.
 %prep
 %setup -q -n libopensync-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 [ -x "%{_bindir}/python%{py_ver}-config" ] && sed -i -e 's#python-config#%{_bindir}/python%{py_ver}-config#g' acinclude.m4
 
-sed -i -e 's#-Werror##g' opensync/Makefile.am
+# avoid errors on glib deprecation warnings
+%{__sed} -i -e 's#-Werror##g' opensync/Makefile.am osengine/Makefile.am tools/Makefile.am
 
 %build
 %{__libtoolize}
@@ -113,14 +123,13 @@ sed -i -e 's#-Werror##g' opensync/Makefile.am
 %{__automake}
 %configure \
 	%{!?debug:--disable-debug --disable-tracing} \
-	--%{?with_static_libs:en}%{!?with_static_libs:dis}able-static \
-	--%{?with_python:en}%{!?with_python:dis}able-python
+	%{?with_static_libs:--enable-static} \
+	--enable-python%{!?with_python:=no}
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 install -d $RPM_BUILD_ROOT%{_libdir}/opensync/plugins \
 	$RPM_BUILD_ROOT%{_datadir}/opensync/defaults
 
@@ -128,11 +137,16 @@ install -d $RPM_BUILD_ROOT%{_libdir}/opensync/plugins \
 	DESTDIR=$RPM_BUILD_ROOT
 
 for bin in osyncbinary osyncdump osyncplugin osyncstress osynctest; do
-	mv $RPM_BUILD_ROOT%{_bindir}/${bin}{,02}
+	%{__mv} $RPM_BUILD_ROOT%{_bindir}/${bin}{,02}
 done
 
-rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.{py,la,a}
-rm -f $RPM_BUILD_ROOT%{_libdir}/opensync/formats/*.a
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/opensync/formats/*.la
+%{?with_static_libs:%{__rm} $RPM_BUILD_ROOT%{_libdir}/opensync/formats/*.a}
+%if %{with python}
+%py_postclean
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
+%{?with_static_libs:%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.a}
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -143,33 +157,48 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README TODO
-%attr(755,root,root) %{_bindir}/*02
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+%attr(755,root,root) %{_bindir}/osyncbinary02
+%attr(755,root,root) %{_bindir}/osyncdump02
+%attr(755,root,root) %{_bindir}/osyncplugin02
+%attr(755,root,root) %{_bindir}/osyncstress02
+%attr(755,root,root) %{_bindir}/osynctest02
+%attr(755,root,root) %{_libdir}/libopensync.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libopensync.so.0
+%attr(755,root,root) %{_libdir}/libopensync-xml.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libopensync-xml.so.0
+%attr(755,root,root) %{_libdir}/libosengine.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libosengine.so.0
 %attr(755,root,root) %{_libdir}/osplugin
 %dir %{_libdir}/opensync
 %dir %{_libdir}/opensync/formats
+%attr(755,root,root) %{_libdir}/opensync/formats/*.so
 %dir %{_libdir}/opensync/plugins
 %dir %{_datadir}/opensync
 %dir %{_datadir}/opensync/defaults
-%attr(755,root,root) %{_libdir}/opensync/formats/*.so
-%{_libdir}/opensync/formats/*.la
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
-%{_includedir}/opensync*
-%{_pkgconfigdir}/*.pc
+%attr(755,root,root) %{_libdir}/libopensync.so
+%attr(755,root,root) %{_libdir}/libopensync-xml.so
+%attr(755,root,root) %{_libdir}/libosengine.so
+%{_libdir}/libopensync.la
+%{_libdir}/libopensync-xml.la
+%{_libdir}/libosengine.la
+%{_includedir}/opensync-1.0
+%{_pkgconfigdir}/opensync-1.0.pc
+%{_pkgconfigdir}/osengine-1.0.pc
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/lib*.a
+%{_libdir}/libopensync.a
+%{_libdir}/libopensync-xml.a
+%{_libdir}/libosengine.a
 %endif
 
 %if %{with python}
 %files -n python-opensync02
 %defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/*.so
-%{py_sitedir}/*.py[co]
+%attr(755,root,root) %{py_sitedir}/_opensync.so
+%{py_sitedir}/opensync.py[co]
 %endif
diff --git a/libopensync02-link.patch b/libopensync02-link.patch
new file mode 100644
index 0000000..3bf5ded
--- /dev/null
+++ b/libopensync02-link.patch
@@ -0,0 +1,8 @@
+--- libopensync-0.22/formats/vformats-xml/Makefile.am.orig	2007-03-27 13:49:27.000000000 +0200
++++ libopensync-0.22/formats/vformats-xml/Makefile.am	2015-01-31 17:15:59.660032499 +0100
+@@ -47,4 +47,4 @@
+ 
+ libopensync_xml_la_SOURCES = xml-support.c
+ libopensync_xml_la_LDFLAGS = @GCOV_LDFLAGS@
+-libopensync_xml_la_LIBADD = @PACKAGE_LIBS@ @LIBS@
++libopensync_xml_la_LIBADD = $(top_builddir)/opensync/libopensync.la @PACKAGE_LIBS@ @LIBS@
diff --git a/libopensync02-memset.patch b/libopensync02-memset.patch
new file mode 100644
index 0000000..8849a3d
--- /dev/null
+++ b/libopensync02-memset.patch
@@ -0,0 +1,11 @@
+--- libopensync-0.22/formats/vformats-xml/vformat.c.orig	2007-03-27 13:49:27.000000000 +0200
++++ libopensync-0.22/formats/vformats-xml/vformat.c	2015-01-31 17:01:46.123401652 +0100
+@@ -1755,7 +1755,7 @@
+ {
+ 	int i;
+ 
+-	memset(rank, 0xff, sizeof(rank));
++	memset(rank, 0xff, 256);
+ 	for (i=0;i<64;i++) {
+ 		rank[(unsigned int)base64_alphabet[i]] = i;
+ 	}
diff --git a/libopensync02-swig.patch b/libopensync02-swig.patch
new file mode 100644
index 0000000..f05dd67
--- /dev/null
+++ b/libopensync02-swig.patch
@@ -0,0 +1,15 @@
+--- libopensync-0.22/acinclude.m4.orig	2015-01-31 16:03:17.056882247 +0100
++++ libopensync-0.22/acinclude.m4	2015-01-31 16:17:02.206847619 +0100
+@@ -1008,9 +1008,9 @@
+                         if test -z "$available_patch" ; then
+                                 [available_patch=0]
+                         fi
+-                        if test $available_major -ne $required_major \
+-                                -o $available_minor -ne $required_minor \
+-                                -o $available_patch -lt $required_patch ; then
++                        if test $available_major -lt $required_major || \
++                                test $available_major -eq $required_major -a $available_minor -lt $required_minor || \
++                                test $availablr_major -eq $required_major -a $available_minor -eq $required_minor -a $available_patch -lt $required_patch ; then
+                                 AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
+                                 SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                         else
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libopensync02.git/commitdiff/4d038e8a9437ac311a20e9a950554c18c763dcc3



More information about the pld-cvs-commit mailing list