-
Notifications
You must be signed in to change notification settings - Fork 176
/
geant4.spec
79 lines (66 loc) · 2.02 KB
/
geant4.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
### RPM external geant4 11.0.1
## INCLUDE compilation_flags
%define tag 271d2ffb2bd0a2aa26c4d15bc5e99e50f49cd232
%define branch cms/v%{realversion}
%define github_user cms-externals
Source: git+https://github.com/%github_user/%{n}.git?obj=%{branch}/%{tag}&export=%{n}.%{realversion}&output=/%{n}.%{realversion}-%{tag}.tgz
BuildRequires: cmake gmake
Requires: clhep
Requires: expat
Requires: xerces-c
Requires: vecgeom
Requires: zlib
%define keep_archives true
%prep
%setup -n %{n}.%{realversion}
%build
SOEXT=so
if [ $(uname) = Darwin ]; then
SOEXT=dylib
fi
rm -rf ../build
mkdir ../build
cd ../build
export VecGeom_DIR=${VECGEOM_ROOT}/lib/cmake/VecGeom
cmake ../%{n}.%{realversion} \
-DCMAKE_CXX_COMPILER="g++" \
%if "%{?arch_build_flags}"
-DCMAKE_CXX_FLAGS="-fPIC %{arch_build_flags}" \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC %{arch_build_flags}" \
-DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC %{arch_build_flags}" \
%else
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC" \
%endif
-DCMAKE_INSTALL_PREFIX:PATH="%i" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_BUILD_TYPE=Release \
-DGEANT4_USE_GDML=ON \
-DGEANT4_BUILD_CXXSTD:STRING="17" \
-DGEANT4_BUILD_TLS_MODEL:STRING="global-dynamic" \
-DGEANT4_ENABLE_TESTING=OFF \
-DGEANT4_BUILD_VERBOSE_CODE=OFF \
-DGEANT4_USE_USOLIDS="all" \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DGEANT4_INSTALL_EXAMPLES=OFF \
-DGEANT4_USE_SYSTEM_CLHEP=ON \
-DGEANT4_USE_SYSTEM_EXPAT=ON \
-DCMAKE_PREFIX_PATH="${XERCES_C_ROOT};${CLHEP_ROOT};${EXPAT_ROOT};${ZLIB_ROOT};${VECGEOM_ROOT}" \
-DGEANT4_USE_SYSTEM_ZLIB=ON \
-DGEANT4_BUILD_MULTITHREADED=ON
make %makeprocesses VERBOSE=1
%install
cd ../build
make install
mkdir -p %i/lib/archive
cd %i/lib/archive
find %i/lib -name "*.a" -exec ar x {} \;
ar rcs libgeant4-static.a *.o
find . -name "*.o" -delete
%post
%{relocateConfig}lib/Geant4-*/*.cmake
%{relocateConfig}bin/geant4-config
%{relocateConfig}bin/geant4.*
%{relocateConfig}share/Geant4-*/geant4make/geant4make.*