summaryrefslogtreecommitdiffstats
path: root/mesos.spec
blob: 10f90bc1607095973de5dd97e1149f6680e030e7 (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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
%global commit      4ce5475346a0abb7ef4b7ffc9836c5836d7c7a66
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global tag         0.23.0
%global skiptests   1
%global libevver    4.15
%global py_version  2.7

# build unbundled for fedora but enable
# bundled builds for others.
%if 0%{?fedora} >= 20
%global unbundled   1
%else
%global unbundled   0
%endif

%global systemmvn   1

Name:          mesos
Version:       0.23.0
Release:       0.%{shortcommit}%{?dist}.6
Summary:       Cluster manager for sharing distributed application frameworks
License:       ASL 2.0
URL:           http://mesos.apache.org/

# missing pivot_root on builds.?.? 
ExclusiveArch: x86_64

Source0:       https://github.com/apache/mesos/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source1:       %{name}-tmpfiles.conf
Source2:       %{name}-master.service
Source3:       %{name}-slave.service
Source4:       %{name}-master
Source5:       %{name}-slave

####################################
Patch0:        mesos-0.21-integ.patch
Patch1:        mesos-0.21.0-http-parser.patch

BuildRequires: libtool
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: java-devel
BuildRequires: zlib-devel
BuildRequires: libcurl-devel
BuildRequires: python-setuptools
BuildRequires: python2-devel
BuildRequires: openssl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: cyrus-sasl-md5
BuildRequires: systemd

%if %systemmvn
BuildRequires: maven-local
BuildRequires: maven-plugin-bundle
BuildRequires: maven-gpg-plugin
BuildRequires: maven-clean-plugin
BuildRequires: maven-shade-plugin
BuildRequires: maven-dependency-plugin
BuildRequires: exec-maven-plugin
BuildRequires: maven-remote-resources-plugin
BuildRequires: maven-site-plugin
%endif

%if %unbundled
BuildRequires: boost-devel
BuildRequires: glog-devel
BuildRequires: gmock-devel
BuildRequires: gflags-devel
BuildRequires: gtest-devel
%ifnarch s390 s390x
BuildRequires: gperftools-devel
%endif
BuildRequires: libev-source
BuildRequires: leveldb-devel
BuildRequires: protobuf-python
BuildRequires: protobuf-java
BuildRequires: zookeeper-devel
BuildRequires: protobuf-devel
BuildRequires: picojson-devel
BuildRequires: python-pip
BuildRequires: python-wheel

Requires: protobuf-python
Requires: python-boto
Requires: python-pip
Requires: python-wheel
%endif

BuildRequires: apr-devel
BuildRequires: subversion-devel
BuildRequires: http-parser-devel

Requires: python-boto
Requires: cyrus-sasl-md5
Requires: docker

# The slaves will indirectly require time syncing with the master
# nodes so just call out the dependency.
Requires: ntpdate

%description
Apache Mesos is a cluster manager that provides efficient resource
isolation and sharing across distributed applications, or frameworks.
It can run Hadoop, MPI, Hypertable, Spark, and other applications on
a dynamically shared pool of nodes.

##############################################
%package devel
Summary:        Header files for Mesos development
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Provides header and development files for %{name}.

##############################################
%package java
Summary:        Java interface for %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description java
The %{name}-java package contains Java bindings for %{name}.

##############################################
%package -n python-%{name}
Summary:        Python support for %{name}
BuildRequires:  python2-devel
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       python2

%description -n python-%{name}
The python-%{name} package contains Python bindings for %{name}.

##############################################

%prep
%setup -q -n %{name}-%{commit}
%patch0 -p1 -F2
%patch1 -p1 -F2

%if %unbundled
# remove all bundled elements prior to build
rm -f `find . | grep [.]tar`

######################################
# We need to rebuild libev and bind statically
# See https://bugzilla.redhat.com/show_bug.cgi?id=1049554 for details
######################################
cp -r %{_datadir}/libev-source libev-%{libevver}
cd libev-%{libevver}
autoreconf -i
%endif

%build

echo "CXXFLAGS=$CXXFLAGS"
######################################
# We need to rebuild libev and bind statically
# See https://bugzilla.redhat.com/show_bug.cgi?id=1049554 for details
%if %unbundled
cd libev-%{libevver}
export CFLAGS="$RPM_OPT_FLAGS -DEV_CHILD_ENABLE=0 -I$PWD"
export CXXFLAGS="$RPM_OPT_FLAGS -DEV_CHILD_ENABLE=0 -I$PWD"
%configure --enable-shared=no --with-pic
make libev.la
cd ../
######################################
export M2_HOME=/usr/share/xmvn
autoreconf -vfi

%ifarch x86_64
export LDFLAGS="$RPM_LD_FLAGS -std=c++11 -L$PWD/libev-%{libevver}/.libs"
%else
export LDFLAGS="$RPM_LD_FLAGS -L$PWD/libev-%{libevver}/.libs"
%endif

ZOOKEEPER_JAR="/usr/share/java/zookeeper/zookeeper.jar:/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/log4j12.jar:/usr/share/java/log4j.jar" %configure --disable-bundled --disable-static
%else
autoreconf -vfi
%configure --disable-static
%endif

make
#%{?_smp_mflags}

%check
######################################
# NOTE: as of 0.16.0 &> there has been a change in the startup routines which
# cause a substantial number of tests to fail/hang under mock.  However, they
# run fine under a local environment so they are disabled by default at this
# time.
######################################
%if %skiptests
  echo "Skipping tests, do to mock issues"
%else
  export LD_LIBRARY_PATH=`pwd`/src/.libs
  make check
%endif

%install
%make_install

######################################
# NOTE: https://issues.apache.org/jira/browse/MESOS-899
%if %unbundled
export CFLAGS="$RPM_OPT_FLAGS -DEV_CHILD_ENABLE=0 -I$PWD -std=c++11"
export CXXFLAGS="$RPM_OPT_FLAGS -DEV_CHILD_ENABLE=0 -I$PWD -std=c++11"
export LDFLAGS="$RPM_LD_FLAGS -L$PWD/libev-%{libevver}/.libs -std=c++11"
%else
export CFLAGS="$RPM_OPT_FLAGS -std=c++11"
export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11"
export LDFLAGS="$RPM_LD_FLAGS -std=c++11"
%endif

export PYTHONPATH=%{buildroot}%{python_sitearch}
mkdir -p %{buildroot}%{python_sitearch}
pushd src/python
python setup.py install --root=%{buildroot} --prefix=/usr
popd

mkdir -p  %{buildroot}%{python_sitelib}
cp -rf %{buildroot}%{_libexecdir}/%{name}/python/%{name}/* %{buildroot}%{python_sitelib}
rm -rf %{buildroot}%{_libexecdir}/%{name}/python

pushd src/python/native
python setup.py install --root=%{buildroot} --prefix=/usr --install-lib=%{python_sitearch}
popd

rm -rf %{buildroot}%{python_sitearch}/*.pth

pushd src/python/interface
python setup.py install --root=%{buildroot} --prefix=/usr
popd
######################################

# fedora guidelines no .a|.la
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/libexamplemodule*
rm -f %{buildroot}%{_libdir}/libtest*

# Move the inclusions under mesos folder for developers
mv -f %{buildroot}%{_includedir}/stout %{buildroot}%{_includedir}/%{name}
mv -f %{buildroot}%{_includedir}/process %{buildroot}%{_includedir}/%{name}

# system integration sysconfig setting
mkdir -p %{buildroot}%{_sysconfdir}/%{name}

mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d
install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf

mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig
install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig

# NOTE: The following removes the deployment scripts and tooling.
# It's still debatable if we should use it.
rm -rf %{buildroot}%{_sysconfdir}/%{name}
rm -f  %{buildroot}%{_sbindir}/mesos-*.sh

mkdir -p -m0755 %{buildroot}/%{_var}/log/%{name}
mkdir -p -m0755 %{buildroot}/%{_var}/lib/%{name}
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE2} %{SOURCE3} %{buildroot}%{_unitdir}/

######################
# install java bindings
######################
%mvn_artifact src/java/%{name}.pom src/java/target/%{name}-%{version}.jar
%mvn_install

######################
# install the examples
######################
make clean
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -rf src/examples %{buildroot}%{_datadir}/%{name}

############################################
%files
%doc LICENSE NOTICE
%{_libdir}/libmesos.so.*
%{_libdir}/libfixed_resource_estimator-%{version}.so
%{_bindir}/mesos*
%{_sbindir}/mesos-*
%{_datadir}/%{name}/
%{_libexecdir}/%{name}/
#system integration files
%{python_sitelib}/%{name}/
%attr(0755,mesos,mesos) %{_var}/log/%{name}/
%attr(0755,mesos,mesos) %{_var}/lib/%{name}/
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}*
%{_unitdir}/%{name}*.service

######################
%files devel
%doc LICENSE NOTICE
%{_includedir}/mesos/
%{_libdir}/libmesos.so
%{_libdir}/libfixed_resource_estimator.so
%{_libdir}/pkgconfig/%{name}.pc

######################
%files java
%doc LICENSE NOTICE
%{_jnidir}/%{name}/%{name}.jar
%if 0%{?fedora} >= 21
%{_datadir}/maven-metadata/%{name}.xml
%{_datadir}/maven-poms/%{name}/%{name}.pom
%else
%{_mavenpomdir}/JPP.%{name}-%{name}.pom
%{_mavendepmapfragdir}/%{name}.xml
%endif

######################
%files -n python-%{name}
%doc LICENSE NOTICE
%{python_sitelib}/*
%{python_sitearch}/*
############################################

%pre
getent group mesos >/dev/null || groupadd -f -r mesos
if ! getent passwd mesos >/dev/null ; then
      useradd -r -g mesos -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
              -c "%{name} daemon account" mesos
fi
exit 0

%post
%systemd_post %{name}-slave.service %{name}-master.service
/sbin/ldconfig

%preun
%systemd_preun %{name}-slave.service %{name}-master.service

%postun
%systemd_postun_with_restart %{name}-slave.service %{name}-master.service
/sbin/ldconfig

%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.0-0.4ce5475.6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sun Aug 07 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.23.0-0.4ce5475.5
- Rebuild for LevelDB 1.18

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.23.0-0.4ce5475.4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.0-0.4ce5475.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Aug 28 2015 Timothy St. Clair <tstclair@redhat.com> - 0.23.0-1.4ce5475.0
- change docker-io to just docker dependency BZ1257832

* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 0.23.0-0.4ce5475.1
- Rebuilt for Boost 1.59

* Wed Aug 5 2015 Timothy St. Clair <tstclair@redhat.com> - 0.23.0-0.4ce5475.0
- Build for latest release

* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.1-0.d6309f9.3
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159

* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 0.22.1-0.d6309f9.2
- rebuild for Boost 1.58

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.1-0.d6309f9.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed May 6 2015 Timothy St. Clair <tstclair@redhat.com> - 0.22.1-0.d6309f9
- Build for latest patch release

* Wed Apr 29 2015 Kalev Lember <kalevlember@gmail.com> - 0.22.0-4.e890e24.1
- Rebuilt for protobuf soname bump

* Mon Apr 20 2015 Timothy St. Clair <tstclair@redhat.com> - 0.22.0-3.e890e24
- Fix for .so build version

* Thu Mar 19 2015 Timothy St. Clair <tstclair@redhat.com> - 0.22.0-2.e890e24
- Update to 0.22.0 official release

* Sat Feb 14 2015 Timothy St. Clair <tstclair@redhat.com> - 0.22.0-1.SNAPSHOT.033c062
- Update to track next release

* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 0.22.0-SNAPSHOT.1.c513126.1
- Rebuild for boost 1.57.0

* Tue Dec 9 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-6.ab8fa65
- Fix for python bindings

* Fri Nov 21 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-5.ab8fa65
- Update to latest build

* Thu Oct 23 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-4.SNAPSHOT.e960cdf
- Update to include examples

* Thu Oct 9 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-3.SNAPSHOT.c96ba8f6
- Update and shifting configs to latest.

* Tue Sep 30 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-2.SNAPSHOT.3133734
- Removing scripts and updating systemd settings.

* Tue Sep 23 2014 Timothy St. Clair <tstclair@redhat.com> - 0.21.0-1.SNAPSHOT.3133734
- Initial prototyping

* Wed Aug 27 2014 Timothy St. Clair <tstclair@redhat.com> - 0.20.0-2.f421ffd
- Fixes for system integration

* Wed Aug 20 2014 Timothy St. Clair <tstclair@redhat.com> - 0.20.0-1.f421ffd
- Rebase to new release 0.20

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.2-6.453b973
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.2-5.453b973
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Dennis Gilmore <dennis@ausil.us> - 0.18.2-4.453b973
- add patch to enable building on all primary and secondary arches
- remove ExcludeArch %%{arm}

* Tue May 27 2014 Timothy St. Clair <tstclair@redhat.com> - 0.18.2-3.453b973
- Fixes for systemd

* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 0.18.2-2.453b973
- Rebuild for boost 1.55.0

* Wed May 14 2014 Timothy St. Clair <tstclair@redhat.com> - 0.18.2-1.453b973
- Rebase to latest 0.18.2-rc1

* Thu Apr 3 2014 Timothy St. Clair <tstclair@redhat.com> - 0.18.0-2.185dba5
- Updated to 0.18.0-rc6
- Fixed MESOS-1126 - dlopen libjvm.so

* Wed Mar 5 2014 Timothy St. Clair <tstclair@redhat.com> - 0.18.0-1.a411a4b
- Updated to 0.18.0-rc3
- Included sub-packaging around language bindings (Java & Python)
- Improved systemd integration
- Itegration to rebuild libev-source w/-DEV_CHILD_ENABLE=0

* Mon Jan 20 2014 Timothy St. Clair <tstclair@redhat.com> - 0.16.0-3.afe9947
- Updated to 0.16.0-rc3

* Mon Jan 13 2014 Timothy St. Clair <tstclair@redhat.com> - 0.16.0-2.d0cb03f
- Updating per review

* Tue Nov 19 2013 Timothy St. Clair <tstclair@redhat.com> - 0.16.0-1.d3557e8
- Update to latest upstream tip.

* Thu Oct 31 2013 Timothy St. Clair <tstclair@redhat.com> - 0.15.0-4.42f8640
- Merge in latest upstream developments

* Fri Oct 18 2013 Timothy St. Clair <tstclair@redhat.com> - 0.15.0-4.464661f
- Package restructuring for subsuming library dependencies dependencies.

* Thu Oct 3 2013 Timothy St. Clair <tstclair@redhat.com> - 0.15.0-3.8037f97
- Cleaning package for review

* Fri Sep 20 2013 Timothy St. Clair <tstclair@redhat.com> - 0.15.0-0.2.01ccdb
- Cleanup for system integration

* Tue Sep 17 2013 Timothy St. Clair <tstclair@redhat.com> - 0.15.0-0.1.1bc2941
- Update to the latest mesos HEAD

* Wed Aug 14 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.12.1-0.4.dff92ff
- spec: cleanups and fixes
- spec: fix systemd daemon

* Mon Aug 12 2013 Timothy St. Clair <tstclair@redhat.com> - 0.12.1-0.3.dff92ff
- Update and add install targets.

* Fri Aug  9 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.12.1-0.2.cba04c1
- Update to latest
- Add python-boto as BR
- other fixes

* Thu Aug  1 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.12.1-0.1.eb17018
- Initial release