summaryrefslogtreecommitdiff
path: root/xdmf.spec
blob: 3aba1ae8dc406f5db772b323a8ff6b1a935d4445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# TODO: parallel (MPI, MPI4PY, H5FDdsm)?
# - use exodusii
# - python3 module
# - system loki library?
#
# Conditional build:
%bcond_without	apidocs	# Doxygen docs
%bcond_without	fortran	# Fortran support in XdmfUtils
%bcond_without	metis	# Metis partitioner in XdmfUtils
%bcond_with	mpi	# MPI support
%bcond_without	java	# Java wrappers
%bcond_without	python	# Python wrappers
#
Summary:	eXtensible Data Model and Format library
Summary(pl.UTF-8):	Biblioteka rozszerzalnego modelu i formatu danych (XDMF)
Name:		xdmf
# see CMakeLists.txt /XDMF_VERSION
Version:	3.0.0
%define	gitref	8d9c98081d89ac77a132d56bc8bef53581db4078
%define	snap	20190115
%define	rel	1
Release:	0.%{snap}.%{rel}
License:	BSD-like
Group:		Libraries
Source0:	https://gitlab.kitware.com/xdmf/xdmf/-/archive/%{gitref}/xdmf-%{snap}.tar.bz2
# Source0-md5:	32fbbd1f6b584e27bb5a30945f6b787a
Patch0:		%{name}-swig.patch
URL:		http://www.xdmf.org/
BuildRequires:	bzip2-devel
BuildRequires:	boost-devel
BuildRequires:	cmake >= 2.4
BuildRequires:	hdf5-devel >= 1.8
%{?with_java:BuildRequires:	jdk}
BuildRequires:	libstdc++-devel
BuildRequires:	libtiff-devel
BuildRequires:	libxml2-devel >= 2
%{?with_python:BuildRequires:	python-devel >= 2}
BuildRequires:	rpm-pythonprov
BuildRequires:	rpmbuild(macros) >= 1.219
%{?with_java:BuildRequires:	swig >= 2.0.0}
%{?with_python:BuildRequires:	swig-python >= 2.0.0}
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 java-xdmf
Summary:	Java binding for Xdmf library
Summary(pl.UTF-8):	Interfejs Javy do biblioteki Xdmf
Group:		Libraries/Python
Requires:	%{name} = %{version}-%{release}

%description -n java-xdmf
Java binding for Xdmf library.

%description -n java-xdmf -l pl.UTF-8
Interfejs Javy do 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 %{name}-%{gitref}
%patch0 -p1

%build
mkdir build
cd build
%cmake .. \
	-DREQUESTED_PYTHON_VERSION=2 \
	%{?with_apidocs:-DXDMF_BUILD_DOCUMENTATION=ON} \
	%{?with_fortran:-DXDMF_BUILD_FORTRAN=ON} \
	%{!?with_mpi:-DXDMF_BUILD_MPI=OFF} \
	%{?with_metis:-DXDMF_BUILD_PARTITIONER=ON} \
	-DXDMF_BUILD_UTILS=ON \
	-DXDMF_SYSTEM_HDF5=ON \
	-DXDMF_SYSTEM_LIBXML2=ON \
	-DXDMF_SYSTEM_ZLIB=ON \
	-DXDMF_USE_RPATH=OFF \
	%{?with_java:-DXDMF_WRAP_JAVA=ON} \
	%{?with_python:-DXDMF_WRAP_PYTHON=ON}
# TODO: -DXDMF_BUILD_EXODUS_IO=ON BR: Exodus-devel

%{__make}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} -C build install \
	DESTDIR=$RPM_BUILD_ROOT

%if %{with python}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc Copyright.txt README.md
%if %{with metis}
%attr(755,root,root) %{_bindir}/XdmfPartitioner
%endif
%attr(755,root,root) %{_libdir}/libXdmf.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libXdmf.so.3
%attr(755,root,root) %{_libdir}/libXdmfCore.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libXdmfCore.so.3
%attr(755,root,root) %{_libdir}/libXdmfUtils.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libXdmfUtils.so.3

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libXdmf.so
%attr(755,root,root) %{_libdir}/libXdmfCore.so
%attr(755,root,root) %{_libdir}/libXdmfUtils.so
%{_libdir}/cmake/Xdmf
%{_includedir}/ProjectVersion.hpp
%{_includedir}/Xdmf*.hpp
%{_includedir}/Xdmf*.i
%{_includedir}/XdmfArray.tpp
%{_includedir}/loki
%if %{with fortran}
%{_includedir}/Xdmf.f
%endif

%if %{with java}
%files -n java-xdmf
%defattr(644,root,root,755)
%{_libdir}/java/Xdmf.jar
%{_libdir}/java/XdmfCore.jar
%{_libdir}/java/XdmfUtils.jar
%attr(755,root,root) %{_libdir}/java/libXdmfJava.so
%attr(755,root,root) %{_libdir}/java/libXdmfCoreJava.so
%attr(755,root,root) %{_libdir}/java/libXdmfUtilsJava.so
%endif

%if %{with python}
%files -n python-xdmf
%defattr(644,root,root,755)
%dir %{py_sitedir}/xdmf
%attr(755,root,root) %{py_sitedir}/xdmf/_Xdmf.so
%attr(755,root,root) %{py_sitedir}/xdmf/_XdmfCore.so
%attr(755,root,root) %{py_sitedir}/xdmf/_XdmfUtils.so
%{py_sitedir}/xdmf/Xdmf.py[co]
%{py_sitedir}/xdmf/XdmfCore.py[co]
%{py_sitedir}/xdmf/XdmfUtils.py[co]
%endif