-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
xmimsim.spec.in
213 lines (182 loc) · 7.02 KB
/
xmimsim.spec.in
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
Name: xmimsim
Version: @VERSION@
Release: 1%{?dist}
Summary: a general Monte-Carlo simulation software package for ED-XRF spectrometers
Group: Applications/Engineering and Scientific
License: GPL
Packager: Tom Schoonjans <[email protected]>
URL: http://github.com/tschoonj/xmimsim
Source: xmimsim-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc gcc-gfortran >= 4.4.0 xraylib-fortran >= 3.99.0 xraylib-devel >= 3.99.0 hdf5-devel libxml2-devel libxslt-devel desktop-file-utils gobject-introspection-devel libpeas-devel ocl-icd-devel opencl-headers
Requires: libgfortran >= 4.4.0 xraylib >= 3.99.0 hdf5 libxml2 libxslt xraylib-fortran >= 3.99.0 desktop-file-utils libpeas
%if 0%{?rhel} == 7
BuildRequires: python36
%else
BuildRequires: python3
%endif
# RHEL 7 is the last release to use gtkmm-plplot and fgsl
# Newer releases will use gtkmm-plplot and easyrng
%if 0%{?rhel} == 7
BuildRequires: fgsl-devel
Requires: fgsl
%else
BuildRequires: easyRNG-devel
Requires: easyRNG
%endif
BuildRequires: gtkmm-plplot-devel >= 2.4
Requires: gtkmm-plplot
%if 0%{?fedora} >= 26 || 0%{?rhel} >= 7
BuildRequires: libsoup-devel
Requires: libsoup
%endif
%description
XMI MSIM is designed to predict the spectral X-ray fluorescence response of a sample when irradiated with an X-ray beam.
%package devel
Summary: a general Monte-Carlo simulation software package for ED-XRF spectrometers: development package
Requires: gcc gcc-gfortran >= 4.4.0 xraylib-devel >= 3.99.0 libxml2-devel xraylib-fortran >= 3.99.0
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: gtkmm-plplot-devel
Requires: libpeas-devel
%if 0%{?rhel} == 7
Requires: fgsl-devel
%else
Requires: easyRNG-devel
%endif
%description devel
XMI-MSIM is designed to predict the spectral X-ray fluorescence response of a sample when irradiated with an X-ray beam.
%package opencl
Summary: a general Monte-Carlo simulation software package for ED-XRF spectrometers: opencl plugin
Requires: %{name}%{?_isa} = %{version}-%{release}
%description opencl
XMI-MSIM is designed to predict the spectral X-ray fluorescence response of a sample when irradiated with an X-ray beam.
%prep
%setup -q
%build
export CFLAGS="$RPM_OPT_FLAGS"
export CPPFLAGS="$RPM_OPT_FLAGS"
%configure --disable-static --enable-gui --disable-mpi --disable-updater --disable-opencl --enable-introspection CPPFLAGS="-DRPM_BUILD" --enable-opencl
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
export LD_LIBRARY_PATH=`pwd`/src/.libs:`pwd`/bin/.libs
make
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
libtool --finish $RPM_BUILD_ROOT%{_libdir}
find $RPM_BUILD_ROOT -name '*.la' | xargs rm
#create database file
export LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir}
$RPM_BUILD_ROOT/%{_bindir}/xmimsim-db $RPM_BUILD_ROOT/%{_prefix}/share/xmimsim/xmimsimdata.h5
desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
--delete-original \
--mode 644 \
$RPM_BUILD_ROOT%{_datadir}/applications/com.github.tschoonj.xmimsim.gui.desktop
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages/
#mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -p -m644 icons/applications-x-xmimsim.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/
#install -p -m644 icons/Logo_xmi_msim*.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null || :
%{_bindir}/update-mime-database %{_datadir}/mime &>/dev/null || :
%postun
/sbin/ldconfig
%{_bindir}/update-mime-database %{_datadir}/mime&>/dev/null || :
%{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi || :
%files
%defattr(-,root,root)
%{_libdir}/libxmimsim.so.*
%{_libdir}/libxmimsim-gui.so.*
%{_bindir}/xmimsim
%{_bindir}/xmimsim-pymca
%{_bindir}/xmimsim-gui
%{_bindir}/xmimsim-harvester
%{_bindir}/xmimsim-db
%{_bindir}/xmimsim-conv
%{_bindir}/xmso2xmsi
%{_bindir}/xmso2spe
%{_bindir}/xmso2csv
%{_bindir}/xmso2htm
%{_bindir}/xmsi2xrmc
%{_bindir}/xmsa2xmso
%{_datadir}/xmimsim/xmimsim-1.0.dtd
%{_datadir}/xmimsim/xmimsim_cat.xml
%{_datadir}/xmimsim/examples/*xmsi
%{_datadir}/xmimsim/examples/*xmso
%{_datadir}/xmimsim/examples/mendeljev.py*
%{_prefix}/share/xmimsim/xmimsimdata.h5
%{_datadir}/applications/com.github.tschoonj.xmimsim.gui.desktop
%{_datadir}/mime/packages/applications-x-xmimsim.xml
%{_datadir}/icons/hicolor/*/apps/Logo_xmi_msim*.png
%{_datadir}/icons/hicolor/*/apps/Radiation_warning_symbol.png
#init script for harvester should come here...
%files devel
%defattr(-,root,root)
%{_includedir}/xmimsim/*.h
%{_includedir}/xmimsim-gui/*.h
%{_includedir}/xmimsim/*.mod
%{_libdir}/libxmimsim.so
%{_libdir}/pkgconfig/libxmimsim.pc
%{_libdir}/libxmimsim-gui.so
%{_libdir}/pkgconfig/libxmimsim-gui.pc
%{_datadir}/gir-1.0/XmiMsim-1.0.gir
%{_datadir}/gir-1.0/XmiMsimGui-1.0.gir
%{_datadir}/xmimsim/examples/test-source.p*
%{_datadir}/xmimsim/examples/mendeljev.py
%{_libdir}/girepository-1.0/XmiMsim-1.0.typelib
%{_libdir}/girepository-1.0/XmiMsimGui-1.0.typelib
%files opencl
%{_libdir}/xmimsim/xmimsim-cl.so
%changelog
* Fri Jan 24 2020 Tom Schoonjans
- Add mendeljev.py example
* Fri Dec 13 2019 Tom Schoonjans
- Add OpenCL ICD build dependency and create opencl subpackage
* Wed May 1 2019 Tom Schoonjans
- Improve devel dependency on base package according to guidelines at https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package
* Wed Mar 27 2019 Tom Schoonjans
- Add preliminary support for RHEL8
- Add gobject-introspection support
- Bump xraylib version requirement to 3.99.0
* Wed Jul 25 2018 Tom Schoonjans
- Drop support for RHEL6
* Wed Sep 20 2017 Tom Schoonjans
- Add support for xraylib 3.3.0
- Add support for google analytics event tracking
* Fri Mar 31 2017 Tom Schoonjans
- Add support for libxmimsim-gui
- Add support for X-ray source dlms
- Enable gtkmm-plplot and easyRNG for all builds except RHEL6
* Thu Sep 8 2016 Tom Schoonjans
- gtkextra dependency bumped to 3.2.0
* Sun Apr 24 2016 Tom Schoonjans
- xraylib dependency bumped to 3.2.0
* Thu Feb 12 2015 Tom Schoonjans
- xmsa2xmso added
* Tue Sep 9 2014 Tom Schoonjans
- xraylib version requirement updated
- added examples
* Thu Feb 13 2014 Tom Schoonjans
- OpenCL disabled: too complicated for now as I need to install cuda on every vm for this...
- xraylib and gtkextra version requirements updated
* Wed Apr 10 2013 Tom Schoonjans
- gtkextra3-devel dependency added to xmimsim-devel
* Thu Jan 10 2013 Tom Schoonjans
- Added opencl support
* Wed May 9 2012 Tom Schoonjans
- Getting ready for first real release
* Mon Jun 20 2011 Tom Schoonjans
- added escape ratios hdf5 file
* Tue May 17 2011 Tom Schoonjans
- First version of spec file