eos-folly.spec 3.5 KB
Newer Older
1
2
3
4
5
6
%define distribution %(/usr/lib/rpm/redhat/dist.sh --distnum)

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

10
11
Name:           eos-folly
Summary:        Facebook Folly library, packaged as EOS dependency
12

Georgios Bitzes's avatar
Georgios Bitzes committed
13
Version:        2019.11.11.00
14

15
Release:        1%{dist}%{?_with_tsan:.tsan}
16
17
License:        Apache
URL:            https://github.com/facebook/folly.git
18
Source0:        https://github.com/facebook/folly/archive/v%{version}.tar.gz
19

20
21
Patch0:         0001-Apply-SLC6-patches.patch

22
23
24
25
26
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: which
BuildRequires: zlib-static
BuildRequires: zlib-devel
27
BuildRequires: m4
28
BuildRequires: automake
29
BuildRequires: libtool
Georgios Bitzes's avatar
Georgios Bitzes committed
30
31
BuildRequires: openssl
BuildRequires: openssl-devel
32
33
BuildRequires: libevent
BuildRequires: libevent-devel
Georgios Bitzes's avatar
Georgios Bitzes committed
34
BuildRequires: cmake3
35
36
BuildRequires: eos-folly-deps = %{version}
Requires: eos-folly-deps = %{version}
37

38
%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
39
BuildRequires: devtoolset-8
40
41
%else
BuildRequires: perl-Data-Dumper
42
43
%endif

44
45
46
47
48
%if %{?_with_tsan:1}%{!?_with_tsan:0}
BuildRequires: libtsan
Requires: libtsan
%endif

49
50
51
52
53
54
55
56
57
58
59
60
61
%description
Facebook Folly, used as EOS build dependency.

%global debug_package %{nil}

%package devel
Summary: eos-folly development files
Group: Development/Libraries

%description devel
This package provides the headers and static library for eos-folly.

%prep
62
%setup -q -c -n eos-folly -a 0
63

64
65
66
67
%if 0%{distribution} == 6
%patch0 -p0
%endif

68
%build
69
%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
70
source /opt/rh/devtoolset-8/enable
71
72
%endif

73
%if %{?_with_tsan:1}%{!?_with_tsan:0}
74
export CXXFLAGS='-fsanitize=thread -g3 -fPIC'
75
%else
76
export CXXFLAGS='-g3 -fPIC'
77
78
%endif

79
80
81
mkdir TEMPROOT
TEMP_ROOT=$PWD/TEMPROOT

82
83
84
85
86
#-------------------------------------------------------------------------------
# Compile folly
#-------------------------------------------------------------------------------
pushd folly-%{version}
mkdir builddir && cd builddir
87
cmake3 .. -DCMAKE_PREFIX_PATH=/opt/eos-folly -DCMAKE_INSTALL_PREFIX=/opt/eos-folly
88
make %{?_smp_mflags}
Georgios Bitzes's avatar
Georgios Bitzes committed
89
90
popd

91
%install
Georgios Bitzes's avatar
Georgios Bitzes committed
92

93
%if 0%{distribution} == 6 || 0%{distribution} == 7
Georgios Bitzes's avatar
Georgios Bitzes committed
94
source /opt/rh/devtoolset-8/enable
Georgios Bitzes's avatar
Georgios Bitzes committed
95
96
%endif

97
%if %{?_with_tsan:1}%{!?_with_tsan:0}
98
export CXXFLAGS='-fsanitize=thread -g3 -fPIC'
99
%else
100
export CXXFLAGS='-g3 -fPIC'
101
102
%endif

103
104
105
106
107
#-------------------------------------------------------------------------------
# Install folly
#-------------------------------------------------------------------------------
pushd folly-%{version}/
cd builddir
108
make DESTDIR=%{buildroot} install %{?_smp_mflags}
109
110
popd

111
112
113
114
115
116
117
118
119
120
#-------------------------------------------------------------------------------
# Make folly shared library
#-------------------------------------------------------------------------------
%if %{?_with_tsan:1}%{!?_with_tsan:0}
export LIBTSAN='-ltsan'
%else
export LIBTSAN=''
%endif

pushd ${RPM_BUILD_ROOT}/opt/eos-folly/lib
121
g++ -shared ${CXXFLAGS} -o libfolly.so -Wl,--whole-archive libfolly.a /opt/eos-folly/lib/libdouble-conversion.a /opt/eos-folly/lib/libglog.a -Wl,-no-whole-archive -Wl,-rpath,/opt/eos-folly/lib -L/opt/eos-folly/lib -lboost_context -lboost_program_options -lssl -levent -lboost_filesystem -lboost_regex -lgflags ${LIBTSAN}
122
123
popd

124
125
126
127
128
129
%files
/opt/eos-folly/*

%changelog
* Thu Apr 12 2018 Georgios Bitzes <georgios.bitzes@cern.ch> - 0.0.1
- Initial package