File: xraylib.spec.in

package info (click to toggle)
xraylib 4.0.0%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,936 kB
  • sloc: ansic: 16,103; f90: 8,746; java: 6,766; python: 1,497; cpp: 1,305; pascal: 1,139; makefile: 809; ruby: 622; php: 594; perl: 573; cs: 193; sh: 125
file content (350 lines) | stat: -rw-r--r-- 16,998 bytes parent folder | download | duplicates (2)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
#Copyright (c) 2009-2014, Tom Schoonjans
#All rights reserved.

#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#    * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.

#THIS SOFTWARE IS PROVIDED BY Tom Schoonjans ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Tom Schoonjans BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




%define luaver @LUA_VERSION@
%define lualibdir %{_libdir}/lua/%{luaver}

%define rubydir @RUBY_EXT_LIB@
%define perldir @PERL_EXT_LIB@
%define perllibdir @PERL_EXT_LIB@/auto/xraylib

%define phpdir @PHP_DIR@
%define phpscriptdir @PHP_SCRIPT_DIR@

Name: xraylib
Version: @VERSION@	
Release:	1%{?dist}
Summary: A library for X-ray matter interactions cross sections for X-ray fluorescence applications: core C library
Group:	 Applications/Engineering and Scientific	
License: BSD 
Packager: Tom.Schoonjans <Tom.Schoonjans@me.com>
URL: http://github.com/tschoonj/xraylib
Source: xraylib-%{version}.tar.gz	
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc glibc glibc-headers glibc-devel gcc-gfortran >= 4.3.0 swig lua-devel ruby-devel perl-devel php-devel

%if 0%{?rhel}

# python 2
BuildRequires: python2-numpy python2-devel

%if 0%{?rhel} == 7
# python2-Cython is too old!
%define cython2 /usr/bin/cython3.6
# python 3
BuildRequires: python36-Cython python36-numpy python36-devel python36-setuptools
%define cython3 /usr/bin/cython3.6

%else
# Centos 8
%define cython2 /usr/bin/cython
# python 3
BuildRequires: python3-Cython python3-numpy python3-devel python3-setuptools
%define cython3 /usr/bin/cython

%endif

%else

%if 0%{?fedora}
BuildRequires: python3-Cython python3-numpy python3-devel
%define cython3 /usr/bin/cython
%if 0%{?fedora} < 31
BuildRequires: python2-numpy python2-devel
%define cython2 /usr/bin/cython
%endif
%endif

%endif

%description
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available.

This rpm package provides only the core C library.

%package devel
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: development package
Requires: glibc-devel glibc-headers pkgconfig %{name}%{?_isa} = %{version}-%{release}

%description devel
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available.

This rpm package provides the necessary libraries, headers etc to start your own xraylib based development.

%package fortran
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: fortran bindings
Requires: pkgconfig libgfortran >= 4.3.0 gcc-gfortran >= 4.3.0 %{name}%{?_isa} = %{version}-%{release}

%description fortran 
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available.

This rpm package provides the fortran 2003 bindings of xraylib.

%package python
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: python3 bindings
Requires:  %{name}%{?_isa} = %{version}-%{release}

%if 0%{?rhel} == 7
Requires: python36-numpy
%else
Requires: python3-numpy
%endif

%description python
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the python3 bindings of xraylib.

# this should also cover rhel!
%if 0%{?fedora} < 31
%package python2
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: python2 bindings
Requires:  %{name}%{?_isa} = %{version}-%{release}
Requires: python2-numpy

%description python2
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the python2 bindings of xraylib.
%endif



%package lua
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: lua bindings
Requires: lua %{name}%{?_isa} = %{version}-%{release}

%description lua
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the lua bindings of xraylib.

%package ruby
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: ruby bindings
Requires: ruby %{name}%{?_isa} = %{version}-%{release}

%description ruby
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the ruby bindings of xraylib.

%package perl
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: perl bindings
Requires: perl %{name}%{?_isa} = %{version}-%{release}

%description perl 
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the perl bindings of xraylib.

%package php
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: php bindings
Requires: php %{name}%{?_isa} = %{version}-%{release}

%description php
Quantitative estimate of elemental composition by spectroscopic and imaging techniques using X-ray fluorescence requires the availability of accurate data of X-ray interaction with matter. Although a wide number of computer codes and data sets are reported in literature, none of them is presented in the form of freely available library functions which can be easily included in software applications for X-ray fluorescence. This work presents a compilation of data sets from different published works and an xraylib interface in the form of callable functions. Although the target applications are on X-ray fluorescence, cross sections of interactions like photoionization, coherent scattering and Compton scattering, as well as form factors and anomalous scattering functions, are also available. 

This rpm package provides the PHP bindings of xraylib.


%prep

%setup -q
pushd ..
cp -a xraylib-%{version} xraylib-%{version}-python3
%if 0%{?fedora} < 31
cp -a xraylib-%{version} xraylib-%{version}-python2
%endif
popd

%build
#first run WITHOUT python
%configure --disable-java --disable-idl --enable-fortran2003 --disable-python --enable-lua --enable-ruby --enable-ruby-integration --enable-perl-integration --enable-perl --disable-python-numpy --enable-php --enable-php-integration --enable-static FC=gfortran 
#necessary to fix rpath issues during rpmbuild
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

#python3
pushd ../xraylib-%{version}-python3
%configure --disable-java --disable-idl --disable-fortran2003 --enable-python --disable-lua --disable-ruby --disable-perl --disable-php --enable-python-numpy PYTHON=%{__python3} CYTHON=%{cython3}
popd

%if 0%{?fedora} < 31
#python2
pushd ../xraylib-%{version}-python2
%configure --disable-java --disable-idl --disable-fortran2003 --enable-python --disable-lua --disable-ruby --disable-perl --disable-php --enable-python-numpy PYTHON=%{__python2} CYTHON=%{cython2}
popd
%endif

make 

mv ../xraylib-%{version}-python3/python python3
cd python3
make
cd ..
%if 0%{?fedora} < 31
mv ../xraylib-%{version}-python2/python python2
cd python2
make
cd ..
%endif


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

cd python3
make install DESTDIR=$RPM_BUILD_ROOT
cd ..
%if 0%{?fedora} < 31
cd python2
make install DESTDIR=$RPM_BUILD_ROOT
cd ..
%endif

libtool --finish $RPM_BUILD_ROOT%{_libdir}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{lualibdir}/*.la
rm -f $RPM_BUILD_ROOT%{rubydir}/*.la
rm -f $RPM_BUILD_ROOT%{perllibdir}/*.la
rm -f $RPM_BUILD_ROOT%{phpdir}/*.la
rm -f $RPM_BUILD_ROOT%{python3_sitearch}/*.la
%if 0%{?fedora} < 31
rm -f $RPM_BUILD_ROOT%{python2_sitearch}/*.la
%endif

mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/php.d
cat >$RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xraylib.ini <<EOF
extension=xraylib.so
EOF

chmod 0644 $RPM_BUILD_ROOT/%{_sysconfdir}/php.d/xraylib.ini

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)

%{_libdir}/libxrl.so.*
%{_prefix}/share/xraylib/*.txt

%files devel
%defattr(-,root,root)
%{_libdir}/libxrl.so
%{_libdir}/libxrl.a
%{_includedir}/xraylib/*.h
%{_libdir}/pkgconfig/libxrl.pc

%files fortran
%defattr(-,root,root)

%{_libdir}/libxrlf03.so.*
%{_libdir}/libxrlf03.so
%{_libdir}/libxrlf03.a
%{_includedir}/xraylib/*.mod
%{_libdir}/pkgconfig/libxrlf03.pc

%files python
%defattr(-,root,root)
%{python3_sitelib}/xraylib.py*
%{python3_sitelib}/__pycache__/*
%{python3_sitearch}/_xraylib.*
%{python3_sitearch}/xraylib_np.*

%if 0%{?fedora} < 31
%files python2
%defattr(-,root,root)
%{python2_sitelib}/xraylib.py*
%{python2_sitearch}/_xraylib.*
%{python2_sitearch}/xraylib_np.*
%endif

%files lua
%defattr(-,root,root)
%{lualibdir}/*

%files ruby
%defattr(-,root,root)
%{rubydir}/*

%files perl
%defattr(-,root,root)
%{perldir}/xraylib.pm
%{perllibdir}/xraylib.so

%files php
%defattr(-,root,root)
%{phpdir}/xraylib.so
%{phpscriptdir}/xraylib.php
%config(noreplace) %{_sysconfdir}/php.d/xraylib.ini

%changelog
* Wed Sep 4 2019 Tom Schoonjans
- Remove RHEL6 support
- Fix python packaging bugs
- Extract python2 bindings into a separate package

* Mon Jul 23 2018 Tom Schoonjans
- Fix dependencies on core package

* Fri Jul 20 2018 Tom Schoonjans
- Remove python command line executable

* Wed May 2 2018 Tom Schoonjans
- Fix Fedora python build

* Mon Feb 12 2018 Tom Schoonjans
- Add PHP bindings

* Mon Sep 18 2017 Tom Schoonjans
- Remove python bindings for RHEL6

* Wed Nov 23 2016 Tom Schoonjans
- Remove support for IDL

* Wed Dec 10 2014 Tom Schoonjans
- Support added for python3

* Tue Jun 3 2014 Tom Schoonjans
- Added python-numpy bindings

* Mon Jun 24 2013 Tom Schoonjans
- Added perl bindings
- Slight change of python bindings

* Tue Jun 18 2013 Tom Schoonjans
- Added ruby bindings

* Thu Aug 23 2012 Tom Schoonjans
- Added lua bindings

* Wed May 18 2011 Tom Schoonjans
- Added xraylib_auger.pro to idl package

* Mon Mar 22 2010 Tom Schoonjans
- Python files modified so they don't contain java files

* Mon Mar 08 2010 Tom Schoonjans
- Added IDL bindings
- ldconfig line

* Thu Aug 20 2009 Tom Schoonjans
- Initial spec file. Perl bindings not included.