[packages/xdmf] - new - include patch adds missing C++ includes - soname patch (from Debian) sets libXdmf soname - l

qboosh qboosh at pld-linux.org
Fri Sep 13 19:24:27 CEST 2013


commit 8a4756ae4af6b3a21069f8681b653bed02fe9a8d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Sep 13 19:24:26 2013 +0200

    - new
    - include patch adds missing C++ includes
    - soname patch (from Debian) sets libXdmf soname
    - log2 patch fixes log2() conflict with libc (in metis sources)
    - destdir patch fixes python module install wrt. DESTDIR

 xdmf-destdir.patch |  11 ++++
 xdmf-include.patch |  30 +++++++++++
 xdmf-log2.patch    |  55 +++++++++++++++++++
 xdmf-soname.patch  |  16 ++++++
 xdmf.spec          | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 266 insertions(+)
---
diff --git a/xdmf.spec b/xdmf.spec
new file mode 100644
index 0000000..dc5fc92
--- /dev/null
+++ b/xdmf.spec
@@ -0,0 +1,154 @@
+# TODO: MPI
+# fix utils:
+# - installs libmetis conflicting with system metis
+# - wants preinstalled libvtk{NetCDF,exoIIc} or installs own versions
+# - installs headers to /usr/include/utils/Xdmf* (too generic dir name)
+#
+# Conditional build:
+%bcond_with	mpi	# MPI support
+%bcond_with	utils	# build XdmfUtils (see TODO above)
+#
+Summary:	eXtensible Data Model and Format library
+Summary(pl.UTF-8):	Biblioteka rozszerzalnego modelu i formatu danych (XDMF)
+Name:		xdmf
+# Debian says 2.1, but no version information anywhere in sources/CVS
+Version:	0
+%define	snap	20100330
+Release:	0.%{snap}.1
+# specified in libsrc/{gzstream,bz2stream}.*
+License:	LGPL v2.1+
+Group:		Libraries
+# cvs -d :pserver:anonymous:xdmf at public.kitware.com:/cvsroot/Xdmf co Xdmf
+Source0:	%{name}.tar.xz
+# Source0-md5:	63f99d11bea8d56d4185cb8facd44ca2
+Patch0:		%{name}-include.patch
+Patch1:		%{name}-soname.patch
+Patch2:		%{name}-log2.patch
+Patch3:		%{name}-destdir.patch
+URL:		http://www.xdmf.org/
+BuildRequires:	bzip2-devel
+BuildRequires:	cmake >= 2.4
+BuildRequires:	hdf5-devel >= 1.8
+BuildRequires:	libstdc++-devel
+BuildRequires:	libxml2-devel >= 2
+BuildRequires:	python-devel >= 2
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	xz
+BuildRequires:	zlib-devel
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+eXtensible Data Model and Format library.
+
+%description -l pl.UTF-8
+Biblioteka rozszerzalnego modelu i formatu danych (XDMF - eXtensible
+Data Model and Format).
+
+%package devel
+Summary:	Header files for Xdmf library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki Xdmf
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	libstdc++-devel
+Requires:	bzip2-devel
+Requires:	zlib-devel
+
+%description devel
+Header files for Xdmf library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki Xdmf.
+
+%package -n python-xdmf
+Summary:	Python binding for Xdmf library
+Summary(pl.UTF-8):	Pythonowy interfejs do biblioteki Xdmf
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description -n python-xdmf
+Python binding for Xdmf library.
+
+%description -n python-xdmf -l pl.UTF-8
+Pythonowy interfejs do biblioteki Xdmf.
+
+%prep
+%setup -q -n Xdmf
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+mkdir build
+cd build
+%cmake .. \
+	-DPythonLibs_FIND_VERSION=%{py_ver} \
+	%{!?with_mpi:-DXDMF_BUILD_MPI=OFF} \
+	%{?with_utils:-DXDMF_BUILD_UTILS=ON} \
+	-DXDMF_SYSTEM_HDF5=ON \
+	-DXDMF_SYSTEM_LIBXML2=ON \
+	-DXDMF_SYSTEM_ZLIB=ON \
+	-DXDMF_USE_RPATH=OFF \
+	-DXDMF_WRAP_PYTHON=ON
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# cmake compiles only to .pyc
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libXdmf.so.2
+%if %{with utils}
+%attr(755,root,root) %{_libdir}/libXdmfUtils.so
+%attr(755,root,root) %{_libdir}/libmetis.so
+%attr(755,root,root) %{_libdir}/libvtkNetCDF.so
+%attr(755,root,root) %{_libdir}/libvtkexoIIc.so
+%attr(755,root,root) %{_bindir}/XdmfDiff
+%attr(755,root,root) %{_bindir}/XdmfExodusConverter
+%attr(755,root,root) %{_bindir}/XdmfPartitioner
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libXdmf.so
+%{_libdir}/XdmfCMake
+%{_includedir}/Xdmf*.h
+%{_includedir}/bz2stream.h
+%{_includedir}/gzstream.h
+%if %{with utils}
+%{_includedir}/XdmfSTLConverter.txx
+# FIXME: too generic dir
+%dir %{_includedir}/utils
+%{_includedir}/utils/Xdmf*.h
+# FIXME: conflict with system metis
+%{_includedir}/metis
+%{_includedir}/vtkexodus2
+%{_includedir}/vtknetcdf
+%endif
+
+%files -n python-xdmf
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/Xdmf
+%attr(755,root,root) %{py_sitedir}/Xdmf/_Xdmf.so
+%{py_sitedir}/Xdmf/Xdmf.py[co]
+%{py_sitedir}/Xdmf/__init__.py[co]
+%if %{with utils}
+%attr(755,root,root) %{py_sitedir}/Xdmf/_XdmfUtils.so
+%{py_sitedir}/Xdmf/XdmfUtils.py[co]
+%endif
diff --git a/xdmf-destdir.patch b/xdmf-destdir.patch
new file mode 100644
index 0000000..15a3f01
--- /dev/null
+++ b/xdmf-destdir.patch
@@ -0,0 +1,11 @@
+--- Xdmf/libsrc/CMakeLists.txt.orig	2013-09-13 18:11:14.450878952 +0200
++++ Xdmf/libsrc/CMakeLists.txt	2013-09-13 18:24:45.464178361 +0200
+@@ -506,7 +506,7 @@
+ 
+   # Compile Byte Code
+   INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${Xdmf_SOURCE_DIR}/CMake/CompileXdmfByteCode.py 
+-    ${CMAKE_INSTALL_PREFIX}/${XDMF_WRAP_PYTHON_INSTALL_PY_DIR})")
++  \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${XDMF_WRAP_PYTHON_INSTALL_PY_DIR})")
+   
+ ENDIF(XDMF_WRAP_PYTHON)
+ 
diff --git a/xdmf-include.patch b/xdmf-include.patch
new file mode 100644
index 0000000..9dd1289
--- /dev/null
+++ b/xdmf-include.patch
@@ -0,0 +1,30 @@
+--- Xdmf/libsrc/XdmfArray.h.orig	2010-03-24 21:03:48.000000000 +0100
++++ Xdmf/libsrc/XdmfArray.h	2013-09-13 16:09:37.644518551 +0200
+@@ -46,6 +46,7 @@ accomplished directly thru XdmfArrays by
+ 
+ #ifndef SWIG
+ #include <stdlib.h>
++#include <string.h>
+ #endif
+ 
+ class XDMF_EXPORT XdmfArray : public XdmfDataDesc {
+--- Xdmf/libsrc/XdmfObject.h.orig	2009-12-23 18:23:49.000000000 +0100
++++ Xdmf/libsrc/XdmfObject.h	2013-09-13 16:13:03.814509766 +0200
+@@ -81,6 +81,7 @@
+ 
+ # ifdef UNIX
+ #  include "sys/file.h"
++#  include <string.h>
+ #  include "strings.h"
+ #  define STRCASECMP strcasecmp
+ #  define STRNCASECMP strncasecmp
+--- Xdmf/libsrc/utils/XdmfExodusReader.cxx.orig	2010-03-18 16:24:25.000000000 +0100
++++ Xdmf/libsrc/utils/XdmfExodusReader.cxx	2013-09-13 17:25:22.130994452 +0200
+@@ -24,6 +24,7 @@
+ /*******************************************************************/
+ 
+ #include "XdmfExodusReader.h"
++#include <algorithm>
+ #include <exodusII.h>
+ 
+ //
diff --git a/xdmf-log2.patch b/xdmf-log2.patch
new file mode 100644
index 0000000..08110cc
--- /dev/null
+++ b/xdmf-log2.patch
@@ -0,0 +1,55 @@
+--- Xdmf/Utilities/metis/util.c.orig	2010-03-24 21:03:47.000000000 +0100
++++ Xdmf/Utilities/metis/util.c	2013-09-13 17:11:43.511029060 +0200
+@@ -509,7 +509,7 @@ void InitRandom(int seed)
+ /*************************************************************************
+ * This function returns the log2(x)
+ **************************************************************************/
+-int log2(int a)
++int intlog2(int a)
+ {
+   int i;
+ 
+--- Xdmf/Utilities/metis/rename.h.orig	2010-03-24 21:03:47.000000000 +0100
++++ Xdmf/Utilities/metis/rename.h	2013-09-13 17:12:24.884360419 +0200
+@@ -410,7 +410,7 @@
+ #define RandomPermute			__RandomPermute
+ #define ispow2				__ispow2
+ #define InitRandom			__InitRandom
+-#define log2				__log2
++#define intlog2				__intlog2
+ 
+ 
+ 
+--- Xdmf/Utilities/metis/kmetis.c.orig	2010-03-24 21:03:47.000000000 +0100
++++ Xdmf/Utilities/metis/kmetis.c	2013-09-13 17:12:59.174358871 +0200
+@@ -66,7 +66,7 @@ void METIS_WPartGraphKway(int *nvtxs, id
+     ctrl.dbglvl = options[OPTION_DBGLVL];
+   }
+   ctrl.optype = OP_KMETIS;
+-  ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
++  ctrl.CoarsenTo = amax((*nvtxs)/(40*intlog2(*nparts)), 20*(*nparts));
+   ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
+ 
+   InitRandom(-1);
+--- Xdmf/Utilities/metis/kvmetis.c.orig	2010-03-24 21:03:47.000000000 +0100
++++ Xdmf/Utilities/metis/kvmetis.c	2013-09-13 17:13:06.084358658 +0200
+@@ -66,7 +66,7 @@ void METIS_WPartGraphVKway(int *nvtxs, i
+     ctrl.dbglvl = options[OPTION_DBGLVL];
+   }
+   ctrl.optype = OP_KVMETIS;
+-  ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
++  ctrl.CoarsenTo = amax((*nvtxs)/(40*intlog2(*nparts)), 20*(*nparts));
+   ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
+ 
+   InitRandom(-1);
+--- Xdmf/Utilities/metis/mkmetis.c.orig	2010-03-24 21:03:47.000000000 +0100
++++ Xdmf/Utilities/metis/mkmetis.c	2013-09-13 17:13:17.037691588 +0200
+@@ -47,7 +47,7 @@ void METIS_mCPartGraphKway(int *nvtxs, i
+     ctrl.dbglvl = options[OPTION_DBGLVL];
+   }
+   ctrl.optype = OP_KMETIS;
+-  ctrl.CoarsenTo = amax((*nvtxs)/(20*log2(*nparts)), 30*(*nparts));
++  ctrl.CoarsenTo = amax((*nvtxs)/(20*intlog2(*nparts)), 30*(*nparts));
+ 
+   ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
+ 
diff --git a/xdmf-soname.patch b/xdmf-soname.patch
new file mode 100644
index 0000000..ba4b483
--- /dev/null
+++ b/xdmf-soname.patch
@@ -0,0 +1,16 @@
+Description: Add a soname to the libXdmf.so.2.1 library
+Author: Alastair McKinstry <mckinstry at debian.org>
+Last-Updated: 2011-06-20
+Forwarded: not-needed
+
+--- xdmf-2.1.orig/libsrc/CMakeLists.txt
++++ xdmf-2.1/libsrc/CMakeLists.txt
+@@ -417,6 +417,8 @@ ENDIF(VTK_BUILD_SHARED_LIBS OR BUILD_SHA
+ 
+ ADD_LIBRARY(Xdmf ${LIBTYPE} ${XdmfSources})
+ 
++SET_TARGET_PROPERTIES(Xdmf PROPERTIES  SOVERSION 2)
++
+ IF(XDMF_USE_MYSQL)
+     ADD_DEFINITIONS("-DXDMF_USE_MYSQL")
+     INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_PATH})
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xdmf.git/commitdiff/8a4756ae4af6b3a21069f8681b653bed02fe9a8d



More information about the pld-cvs-commit mailing list