summaryrefslogtreecommitdiffstats
path: root/geant4.spec
blob: 9ba42df610c414ee2af9fd2c7267dc8fe76f8c28 (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
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
%define         libversion 10.6.1

%define         G4NDL_version 4.6
%define         G4EMLOW_version 7.9.1
%define         G4PhotonEvaporation_version 5.5
%define         G4RadioactiveDecay_version 5.4
%define         G4PARTICLEXS_version 2.1
%define         G4PII_version 1.3
%define         G4RealSurface_version 2.1.1
%define         G4SAIDDATA_version 2.0
%define         G4ABLA_version 3.1
%define         G4INCL_version 1.0
%define         G4ENSDFSTATE_version 2.2

Name:           geant4
Version:        10.06.p01
Release:        5%{?dist}
Summary:        Toolkit for the simulation of the passage of particles through matter

License:        BSD
URL:            http://geant4.cern.ch/
Source0:        https://geant4-data.web.cern.ch/geant4-data/releases/%{name}.%{version}.tar.gz
Source1:        https://cern.ch/geant4-data/datasets/G4NDL.%{G4NDL_version}.tar.gz
Source2:        https://cern.ch/geant4-data/datasets/G4EMLOW.%{G4EMLOW_version}.tar.gz
Source3:        https://cern.ch/geant4-data/datasets/G4PhotonEvaporation.%{G4PhotonEvaporation_version}.tar.gz
Source4:        https://cern.ch/geant4-data/datasets/G4RadioactiveDecay.%{G4RadioactiveDecay_version}.tar.gz
Source5:        https://cern.ch/geant4-data/datasets/G4PARTICLEXS.%{G4PARTICLEXS_version}.tar.gz
Source6:        https://cern.ch/geant4-data/datasets/G4PII.%{G4PII_version}.tar.gz
Source7:        https://cern.ch/geant4-data/datasets/G4RealSurface.%{G4RealSurface_version}.tar.gz
Source8:        https://cern.ch/geant4-data/datasets/G4SAIDDATA.%{G4SAIDDATA_version}.tar.gz
Source9:        https://cern.ch/geant4-data/datasets/G4ABLA.%{G4ABLA_version}.tar.gz
Source10:       https://cern.ch/geant4-data/datasets/G4INCL.%{G4INCL_version}.tar.gz
Source11:       https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.%{G4ENSDFSTATE_version}.tar.gz


%if 0%{?fedora} > 23
BuildRequires:  motif-devel
# Requires:       motif
%else
BuildRequires:  lesstif-devel
# Requires:       lesstif
%endif
BuildRequires:  mesa-libGLU-devel
BuildRequires:  libXmu-devel
BuildRequires:  libXpm-devel
BuildRequires:  libXi-devel
BuildRequires:  xerces-c-devel
BuildRequires:  expat-devel
BuildRequires:  zlib-devel
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  cmake
BuildRequires:  qt5-qtbase-devel


%description
Geant4 is a toolkit for the simulation of the passage of particles through matter.
Its areas of application include high energy, nuclear and accelerator physics, as
well as studies in medical and space science.

%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Recommends:     mesa-libGLU-devel
Recommends:     libXmu-devel
Recommends:     libXpm-devel
Recommends:     libXi-devel
Recommends:     xerces-c-devel
Recommends:     expat-devel
Recommends:     zlib-devel
Recommends:     qt5-devel
Recommends:     cmake
Recommends:     make
%if 0%{?fedora} > 23
Recommends:     motif-devel
%else
Recommends:     lesstif-devel
%endif

%description    devel
Development files for %{name}.

%package examples
Summary:        Examples files for %{name}
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description    examples
Examples files for %{name}.

%package data
Summary:        Geant4 datasets
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description    data
Geant4 datasets.

%prep
%setup -q -n %{name}.%{version}

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
str='%optflags'
str=${str/-O2/-O3}
CXXFLAGS=${str}' -flto -ffat-lto-objects -DNDEBUG -fno-trapping-math -ftree-vectorize -fno-math-errno'
export CXXFLAGS
LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
export LDFLAGS
LT_SYS_LIBRARY_PATH=/usr/lib64:
export LT_SYS_LIBRARY_PATH
%{cmake} -DGEANT4_BUILD_MULTITHREADED=ON \
         -DGEANT4_INSTALL_DATA=OFF \
         -DGEANT4_USE_GDML=ON \
         -DGEANT4_USE_G3TOG4=ON \
         -DGEANT4_USE_QT=ON \
         -DOpenGL_GL_PREFERENCE=GLVND \
         -DGEANT4_USE_XM=ON \
         -DGEANT4_USE_OPENGL_X11=ON \
         -DGEANT4_USE_INVENTOR=OFF \
         -DGEANT4_USE_RAYTRACER_X11=ON \
         -DGEANT4_USE_SYSTEM_CLHEP=OFF \
         -DGEANT4_USE_SYSTEM_EXPAT=ON \
         -DGEANT4_USE_SYSTEM_ZLIB=ON \
         -DGEANT4_BUILD_CXXSTD=14 \
         ..
%make_build
popd

%install
pushd %{_target_platform}
%make_install
popd

rm -rf %{buildroot}%{_bindir}/geant4.sh %{buildroot}%{_bindir}/geant4.csh

mkdir -p %{buildroot}%{_sysconfdir}/profile.d

cat > %{buildroot}%{_sysconfdir}/profile.d/%{name}-data.sh <<EOF
export G4NEUTRONHPDATA="%{_datadir}/Geant4-%{libversion}/data/G4NDL%{G4NDL_version}"
export G4LEDATA="%{_datadir}/Geant4-%{libversion}/data/G4EMLOW%{G4EMLOW_version}"
export G4LEVELGAMMADATA="%{_datadir}/Geant4-%{libversion}/data/PhotonEvaporation%{G4PhotonEvaporation_version}"
export G4RADIOACTIVEDATA="%{_datadir}/Geant4-%{libversion}/data/RadioactiveDecay%{G4RadioactiveDecay_version}"
export G4PARTICLEXSDATA="%{_datadir}/Geant4-%{libversion}/data/G4PARTICLEXS%{G4PARTICLEXS_version}"
export G4PIIDATA="%{_datadir}/Geant4-%{libversion}/data/G4PII%{G4PII_version}"
export G4REALSURFACEDATA="%{_datadir}/Geant4-%{libversion}/data/RealSurface%{G4RealSurface_version}"
export G4SAIDXSDATA="%{_datadir}/Geant4-%{libversion}/data/G4SAIDDATA%{G4SAIDDATA_version}"
export G4ABLADATA="%{_datadir}/Geant4-%{libversion}/data/G4ABLA%{G4ABLA_version}"
export G4INCLDATA="%{_datadir}/Geant4-%{libversion}/data/G4INCL%{G4INCL_version}"
export G4ENSDFSTATEDATA="%{_datadir}/Geant4-%{libversion}/data/G4ENSDFSTATE%{G4ENSDFSTATE_version}"
EOF

cat > %{buildroot}%{_sysconfdir}/profile.d/%{name}-data.csh <<EOF
setenv G4NEUTRONHPDATA "%{_datadir}/Geant4-%{libversion}/data/G4NDL%{G4NDL_version}"
setenv G4LEDATA "%{_datadir}/Geant4-%{libversion}/data/G4EMLOW%{G4EMLOW_version}"
setenv G4LEVELGAMMADATA "%{_datadir}/Geant4-%{libversion}/data/PhotonEvaporation%{G4PhotonEvaporation_version}"
setenv G4RADIOACTIVEDATA "%{_datadir}/Geant4-%{libversion}/data/RadioactiveDecay%{G4RadioactiveDecay_version}"
setenv G4PARTICLEXSDATA "%{_datadir}/Geant4-%{libversion}/data/G4PARTICLEXS%{G4PARTICLEXS_version}"
setenv G4PIIDATA "%{_datadir}/Geant4-%{libversion}/data/G4PII%{G4PII_version}"
setenv G4REALSURFACEDATA "%{_datadir}/Geant4-%{libversion}/data/RealSurface%{G4RealSurface_version}"
setenv G4SAIDXSDATA "%{_datadir}/Geant4-%{libversion}/data/G4SAIDDATA%{G4SAIDDATA_version}"
setenv G4ABLADATA "%{_datadir}/Geant4-%{libversion}/data/G4ABLA%{G4ABLA_version}"
setenv G4INCLDATA "%{_datadir}/Geant4-%{libversion}/data/G4INCL%{G4INCL_version}"
setenv G4ENSDFSTATEDATA "%{_datadir}/Geant4-%{libversion}/data/G4ENSDFSTATE%{G4ENSDFSTATE_version}"
EOF

tar -zxf %{S:1} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:2} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:3} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:4} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:5} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:6} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:7} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:8} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:9} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:10} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data
tar -zxf %{S:11} --directory %{buildroot}%{_datadir}/Geant4-%{libversion}/data

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc LICENSE ReleaseNotes
%dir %{_datadir}/Geant4-%{libversion}
%{_libdir}/libG*.so

%files devel
%{_bindir}/geant4-config
%{_includedir}/Geant4
%{_libdir}/Geant4-%{libversion}
%{_datadir}/Geant4-%{libversion}
%exclude %{_datadir}/Geant4-%{libversion}/data
%exclude %{_datadir}/Geant4-%{libversion}/examples

%files examples
%{_datadir}/Geant4-%{libversion}/examples

%files data
%{_datadir}/Geant4-%{libversion}/data
%{_sysconfdir}/profile.d/%{name}-data.csh
%{_sysconfdir}/profile.d/%{name}-data.sh

%changelog
* Thu Apr 23 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06.p01-4
- Use O3 build 

* Fri Apr 10 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06.p01-3
- rebuilt

* Sun Mar 29 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06.p01-2
- rebuilt

* Sat Mar 14 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06-4
- rebuilt

* Wed Mar 04 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06-3
- rebuilt

* Mon Jan 27 2020 Qiyu Yan <3437889+karuboniru@users.noreply.github.com> - 10.06-2
- rebuilt

* Thu Oct 17 2019 Qiyu Yan <yanqy@ihep.ac.cn> - 10.05.p01-3
- Fix Dep

* Thu Oct 17 2019 Qiyu Yan <yanqy@ihep.ac.cn> - 10.05.p01
- geant4.10.05.p01

* Wed Jan  6 2016 Alexey Kurov <nucleo@fedoraproject.org> - 10.01.p02-1
- geant4.10.01.p02

* Wed Jan  6 2016 Alexey Kurov <nucleo@fedoraproject.org> - 10.01-1
- Initial RPM release