-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
xraylib.spec
278 lines (202 loc) · 14.5 KB
/
xraylib.spec
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
#Copyright (c) 2009-2021, 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.
# this is necessary for CentOS 7
# for compiled modules
%{!?lua_libdir: %global lua_libdir %{_libdir}/lua/%{lua_version}}
# and for Perl, for all distros...
%define perl_vendor_archlib %(eval "`%__perl -V:installvendorarch`"; echo "$installvendorarch")
%define perl_vendor_autolib %{perl_vendor_archlib}/auto
Name: xraylib
Version: 4.1.5
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}
%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
%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.
%package lua
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: lua bindings
Requires: lua(abi) = %{lua_version}
Requires: %{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(release)
Requires: %{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
%build
%configure --disable-java --disable-idl --enable-fortran2003 --enable-python --enable-lua --enable-ruby --enable-ruby-integration --enable-perl-integration --enable-perl --enable-python-numpy --enable-php --enable-php-integration --enable-static FC=gfortran PYTHON=%{__python3} PERL=%{__perl} CYTHON=%{cython3}
#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
make
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
libtool --finish $RPM_BUILD_ROOT%{_libdir}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{lua_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{ruby_vendorarchdir}/*.la
rm -f $RPM_BUILD_ROOT%{perl_vendor_autolib}/xraylib/*.la
rm -f $RPM_BUILD_ROOT%{php_extdir}/*.la
rm -f $RPM_BUILD_ROOT%{python3_sitearch}/*.la
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.*
%files lua
%defattr(-,root,root)
%{lua_libdir}/*
%files ruby
%defattr(-,root,root)
%{ruby_vendorarchdir}/*
%files perl
%defattr(-,root,root)
%{perl_vendor_archlib}/xraylib.pm
%{perl_vendor_autolib}/xraylib/xraylib.so
%files php
%defattr(-,root,root)
%{php_extdir}/xraylib.so
%{_datadir}/php/xraylib.php
%config(noreplace) %{_sysconfdir}/php.d/xraylib.ini
%changelog
* Sun May 16 2021 Tom Schoonjans
- Remove python2 support
- Do not use automake variables, switch to RPM macros
* 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.