forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clhep.spec
60 lines (48 loc) · 1.36 KB
/
clhep.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
### RPM external clhep 2.1.3.1
Source: http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/distributions/%n-%realversion.tgz
Patch0: clhep-2.1.1.0-no-virtual-inline
Patch1: clhep-2.1.3.1-diagnostic-ignore-unused-variable
BuildRequires: cmake ninja
%if "%{?cms_cxx:set}" != "set"
%define cms_cxx g++
%endif
%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -std=c++0x
%endif
%prep
%setup -n %realversion/CLHEP
case %cmsplatf in
osx*|*gcc4[789]*)
%patch0 -p2
;;
esac
%patch1 -p2
%build
mkdir ../build
cd ../build
cmake ../CLHEP \
-G Ninja \
-DCMAKE_CXX_COMPILER="%cms_cxx" \
-DCMAKE_CXX_FLAGS="%{cms_cxxflags}" \
-DCMAKE_INSTALL_PREFIX:PATH="%i" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN)
%install
cd ../build
ninja install
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
rm %i/lib/libCLHEP-[A-Z]*-%realversion.$so
%post
%{relocateConfig}bin/Evaluator-config
%{relocateConfig}bin/Cast-config
%{relocateConfig}bin/GenericFunctions-config
%{relocateConfig}bin/Exceptions-config
%{relocateConfig}bin/RandomObjects-config
%{relocateConfig}bin/Geometry-config
%{relocateConfig}bin/Matrix-config
%{relocateConfig}bin/Random-config
%{relocateConfig}bin/RefCount-config
%{relocateConfig}bin/Units-config
%{relocateConfig}bin/Utility-config
%{relocateConfig}bin/Vector-config
%{relocateConfig}bin/clhep-config