eos-folly-deps.spec 7.49 KB
Newer Older
1
%define distribution %(/usr/lib/rpm/redhat/dist.sh --distnum)
Mihai Patrascoiu's avatar
Mihai Patrascoiu committed
2
3
4
5
6
7
8
%define scons_package scons
%define scons scons

%if 0%{distribution} == 8
%define scons_package python3-scons
%define scons scons-3
%endif
9
10
11
12
13

#-------------------------------------------------------------------------------
# Custom strip command for SLC6, CC7
#-------------------------------------------------------------------------------
%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
14
%global __strip /opt/rh/devtoolset-8/root/usr/bin/strip
15
16
%endif

17
18
%define boost_ver 1_71_0
%define boost_ver_dots 1.71.0
19

20
Name:           eos-folly-deps
21
22
Summary:        Boost library, packaged as EOS dependency

Georgios Bitzes's avatar
Georgios Bitzes committed
23
Version:        2019.11.11.00
24
25
26
27
28

Release:        1%{dist}%{?_with_tsan:.tsan}
License:        Apache
URL:            https://github.com/boostorg/boost
Source0:        https://dl.bintray.com/boostorg/release/%{boost_ver_dots}/source/boost_%{boost_ver}.tar.gz
29
Source1:        https://github.com/google/glog/archive/v0.4.0.tar.gz
30
Source2:        https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
31
32
Source3:        https://github.com/google/double-conversion/archive/v1.1.6.tar.gz
Source4:        SConstruct.double-conversion
33
34
35
36
37
38
39
40
41

BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: which
BuildRequires: zlib-static
BuildRequires: zlib-devel
BuildRequires: m4
BuildRequires: automake
BuildRequires: libtool
Mihai Patrascoiu's avatar
Mihai Patrascoiu committed
42
BuildRequires: %{scons_package}
43
44
45
46
47
BuildRequires: openssl
BuildRequires: openssl-devel
BuildRequires: libevent
BuildRequires: libevent-devel
BuildRequires: cmake
Georgios Bitzes's avatar
Georgios Bitzes committed
48
BuildRequires: cmake3
49
50

%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
51
BuildRequires: devtoolset-8
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
%else
BuildRequires: perl-Data-Dumper
%endif

%if %{?_with_tsan:1}%{!?_with_tsan:0}
BuildRequires: libtsan
Requires: libtsan
%endif

%description
Boost used as EOS build dependency.

%global debug_package %{nil}

%package devel
67
Summary: eos-folly-deps development files
68
69
70
Group: Development/Libraries

%description devel
71
This package provides headers and libraries for eos-folly-deps.
72
73

%prep
74
%setup -q -c -n eos-folly-deps -a 0 -a 1 -a 2 -a 3
75
76
77

%build
%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
78
source /opt/rh/devtoolset-8/enable
79
80
81
%endif

%if %{?_with_tsan:1}%{!?_with_tsan:0}
82
export CXXFLAGS='-fsanitize=thread -g3 -fPIC'
83
%else
84
export CXXFLAGS='-g3 -fPIC'
85
86
87
88
89
%endif

mkdir TEMPROOT
TEMP_ROOT=$PWD/TEMPROOT

90
91
92
#-------------------------------------------------------------------------------
# Compile boost
#-------------------------------------------------------------------------------
93
pushd boost_%{boost_ver}
94
./bootstrap.sh --prefix=${RPM_BUILD_ROOT}/opt/eos-folly --with-libraries=context,thread,program_options,regex,system,chrono,filesystem,date_time
95
96
97
./b2 %{?_smp_mflags}
popd

98
99
100
#-------------------------------------------------------------------------------
# Compile gflags
#-------------------------------------------------------------------------------
101
pushd gflags-2.2.2
102
mkdir build && cd build
103
104
CXXFLAGS="-fPIC" cmake3 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/eos-folly -DCMAKE_INSTALL_LIBDIR=lib ..
make %{?_smp_mflags}
105
106
107
108
109
popd

#-------------------------------------------------------------------------------
# Compile glog
#-------------------------------------------------------------------------------
110
111
pushd glog-0.4.0
mkdir build && cd build
112
CXXFLAGS="-fPIC" cmake3 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/eos-folly -DCMAKE_INSTALL_LIBDIR=lib ..
113
make %{?_smp_mflags}
114
115
popd

116
117
118
119
#-------------------------------------------------------------------------------
# Compile double-conversion
#-------------------------------------------------------------------------------
pushd double-conversion-1.1.6
Mihai Patrascoiu's avatar
Mihai Patrascoiu committed
120
%{scons} -f %{SOURCE4}
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

%{__install} -D -m 755 ./libdouble_conversion.a ${TEMP_ROOT}/lib/libdouble-conversion.a
%{__install} -D -m 755 ./libdouble_conversion_pic.a ${TEMP_ROOT}/lib/libdouble-conversion_pic.a

%{__install} -D -m 755 ./src/double-conversion.h ${TEMP_ROOT}/include/double-conversion/double-conversion.h
%{__install} -D -m 755 ./src/bignum.h  ${TEMP_ROOT}/include/double-conversion/bignum.h
%{__install} -D -m 755 ./src/bignum-dtoa.h ${TEMP_ROOT}/include/double-conversion/bignum-dtoa.h
%{__install} -D -m 755 ./src/cached-powers.h ${TEMP_ROOT}/include/double-conversion/cached-powers.h
%{__install} -D -m 755 ./src/diy-fp.h ${TEMP_ROOT}/include/double-conversion/diy-fp.h
%{__install} -D -m 755 ./src/fast-dtoa.h ${TEMP_ROOT}/include/double-conversion/fast-dtoa.h
%{__install} -D -m 755 ./src/fixed-dtoa.h ${TEMP_ROOT}/include/double-conversion/fixed-dtoa.h
%{__install} -D -m 755 ./src/ieee.h ${TEMP_ROOT}/include/double-conversion/ieee.h
%{__install} -D -m 755 ./src/strtod.h ${TEMP_ROOT}/include/double-conversion/strtod.h
%{__install} -D -m 755 ./src/utils.h ${TEMP_ROOT}/include/double-conversion/utils.h

popd


139

140
141
142
%install

%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
143
source /opt/rh/devtoolset-8/enable
144
145
146
147
148
149
150
151
%endif

%if %{?_with_tsan:1}%{!?_with_tsan:0}
export CXXFLAGS='-fsanitize=thread -g3'
%else
export CXXFLAGS='-g3'
%endif

152
153
154
#-------------------------------------------------------------------------------
# Install boost
#-------------------------------------------------------------------------------
155
156
157
158
pushd boost_%{boost_ver}
./b2 install %{?_smp_mflags}
popd

159
160
161
#-------------------------------------------------------------------------------
# Install gflags
#-------------------------------------------------------------------------------
162
163
164
pushd gflags-2.2.2
cd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
165
166
167
168
169
popd

#-------------------------------------------------------------------------------
# Install glog
#-------------------------------------------------------------------------------
Georgios Bitzes's avatar
Georgios Bitzes committed
170
pushd glog-0.4.0
171
cd build
Georgios Bitzes's avatar
Georgios Bitzes committed
172
make DESTDIR=%{buildroot} install %{?_smp_mflags}
173
174
popd

175
176
177
178
179
#-------------------------------------------------------------------------------
# Clean up /root/.cmake
#-------------------------------------------------------------------------------
rm -rf %{buildroot}/root/

180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#-------------------------------------------------------------------------------
# Install double-conversion
#-------------------------------------------------------------------------------
pushd double-conversion-1.1.6
%{__install} -D -m 755 ./libdouble_conversion_pic.a ${RPM_BUILD_ROOT}/opt/eos-folly/lib/libdouble-conversion.a

%{__install} -D -m 755 ./src/double-conversion.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/double-conversion.h
%{__install} -D -m 755 ./src/bignum.h  ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/bignum.h
%{__install} -D -m 755 ./src/bignum-dtoa.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/bignum-dtoa.h
%{__install} -D -m 755 ./src/cached-powers.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/cached-powers.h
%{__install} -D -m 755 ./src/diy-fp.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/diy-fp.h
%{__install} -D -m 755 ./src/fast-dtoa.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/fast-dtoa.h
%{__install} -D -m 755 ./src/fixed-dtoa.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/fixed-dtoa.h
%{__install} -D -m 755 ./src/ieee.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/ieee.h
%{__install} -D -m 755 ./src/strtod.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/strtod.h
%{__install} -D -m 755 ./src/utils.h ${RPM_BUILD_ROOT}/opt/eos-folly/include/double-conversion/utils.h
popd

198
%files
199
/opt/eos-folly/*
200
201

%changelog
Mihai Patrascoiu's avatar
Mihai Patrascoiu committed
202
203
* Wed Jan 15 2020 Mihai Patrascoiu <mihai.patrascoiu@cern.ch> - 0.0.2
- Accommodate CentOS 8 build
204
* Wed Nov 27 2019 Georgios Bitzes <georgios.bitzes@cern.ch> - 0.0.1
205
- Initial package