This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
mesos-glabs.spec
285 lines (230 loc) · 8.71 KB
/
mesos-glabs.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
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
%global remote_src_tar %(echo "$REMOTE_SRC_TAR")
%global remote_src_name %(echo "$REMOTE_SRC_NAME")
%global mesos_version %(echo "$MESOS_VERSION")
%global build_qualifier %(echo "$BUILD_QUALIFIER")
%global jdk_home %(echo "$JDK_HOME")
%global jdk_version %(echo "$JDK_VERSION")
%global maven_home %(echo "$MAVEN_HOME")
%define _rel_version %{?build_qualifier}%{?dist}
%define _full_ver %{mesos_version}-%{rel_version}
%define _mesos_sysconfdir %{_sysconfdir}/mesos
%define _mesos_logdir %{_localstatedir}/log/mesos
Name: mesos
Version: %{mesos_version}
Release: %{_rel_version}
Summary: Cluster manager that provides resource isolation and sharing distributed application frameworks. Build for jdk %{jdk_version} and above.
License: ASL 2.0
URL: http://mesos.apache.org
Group: Applications/System
Source0: %{remote_src_tar}
Source1: mesos-env.sh
Source2: mesos-masterd.sh
Source3: mesos-slaved.sh
Source4: mesos-locald.sh
Source5: mesos-master.conf
Source6: mesos-slave.conf
Source7: mesos-local.conf
Prefix: /usr
BuildRoot: %{_tmppath}/%{name}-%{_full_ver}-root
BuildRequires: libtool
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libcurl-devel
BuildRequires: zlib-devel
BuildRequires: http-parser-devel
BuildRequires: gmock-devel
BuildRequires: gtest-devel
BuildRequires: gperftools-devel
BuildRequires: libev-devel
BuildRequires: leveldb-devel
BuildRequires: protobuf-devel
BuildRequires: python
BuildRequires: python-boto
BuildRequires: python-setuptools
# Apparently we need protobuf-python 2.4 or above to make the test pass.
#BuildRequires: protobuf-python
#BuildRequires: protobuf-java
BuildRequires: python-devel
BuildRequires: openssl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: cyrus-sasl-md5
BuildRequires: cyrus-sasl-plain
#BuildRequires: java-devel
#BuildRequires: systemd
Requires: openssl
Requires: zlib
Requires: libcurl
Requires: cyrus-sasl
Requires: cyrus-sasl-md5
Requires: cyrus-sasl-plain
Requires: daemonize
Requires(pre): chkconfig
Requires(pre): initscripts
Requires(pre): shadow-utils
# For now we will disable checks.
# Requires: logrotate, java
# consider adding google performance tools to the build as an optional dependency. ref. http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
AutoReq: no
Provides: mesos
Packager: Bernardo Gomez Palacio <bernardo.gomezpalacio@gmail.com>
%description
Cluster manager that provides resource isolation and sharing distributed application frameworks
#@BUILD_DESCRIPTION@
%prep
%setup -q -n %{remote_src_name}
%build
./bootstrap
JAVA_HOME=%{jdk_home}; export JAVA_HOME;
MAVEN_HOME=%{maven_home}; export MAVEN_HOME;
# TODO why are we using --disable-static
%configure --disable-static
%{__make} -j 3 %{?_smp_mflags}
%clean
rm -rf %{buildroot}
%check
MESOS_VERBOSE=1; export MESOS_VERBOSE
GLOG_v=1; export GLOG;
GLOG_logtostderr=true; export GLOG_logtostderr;
# Skipping FsTest since they currently fail in a Mock (Chroot) environment since
# structure describing a mount table (e.g. /etc/mtab or /proc/mounts).
GTEST_FILTER="-FsTest.*"; export GTEST_FILTER
%{__make} check GTEST_FILTER="$GTEST_FILTER"
#TODO - systemd integration
%pre
getent group mesos >/dev/null || groupadd -r mesos
getent passwd mesos >/dev/null || /usr/sbin/useradd --comment "Mesos Daemon User" -r -g mesos -s /sbin/nologin mesos
exit 0
%install
%make_install
rm -rf %{buildroot}%{_libdir}/*.la
install -p -D -m 755 %{S:1} %{buildroot}%{_sbindir}/mesos-env.sh
install -p -D -m 755 %{S:2} %{buildroot}%{_sbindir}/mesos-masterd.sh
install -p -D -m 755 %{S:3} %{buildroot}%{_sbindir}/mesos-slaved.sh
install -p -D -m 755 %{S:4} %{buildroot}%{_sbindir}/mesos-locald.sh
install -p -D -m 444 %{S:5} %{buildroot}%{_mesos_sysconfdir}/templates/mesos-master.conf
install -p -D -m 444 %{S:6} %{buildroot}%{_mesos_sysconfdir}/templates/mesos-slave.conf
install -p -D -m 444 %{S:7} %{buildroot}%{_mesos_sysconfdir}/templates/mesos-local.conf
install -d -m 755 %{buildroot}%{_mesos_logdir}
# TODO: Determine the best home for the deployment templates.
mv -f %{buildroot}%{_var}/mesos/deploy %{buildroot}%{_datadir}/mesos/
%files
%defattr(-,root,root,-)
%doc LICENSE README.md
%{_libdir}/libmesos*.so
%{_bindir}/mesos-*
%{_bindir}/mesos-*
%{_sbindir}/mesos-*
%{_datadir}/mesos/
%{_libexecdir}/mesos/
%{_mesos_sysconfdir}/
%{_mesos_logdir}/
#===============================================================================================
# Command Tool
#===============================================================================================
%package -n mesos-cli
Summary: Mesos Command Line Utility
Group: Applications/System
Requires: mesos
%description -n mesos-cli
Mesos Command Line Utility
%files -n mesos-cli
%defattr(-, root, root, -)
%{_bindir}/mesos
#===============================================================================================
# Master
#===============================================================================================
%package -n mesos-master
Summary: mesos master
Group: Applications/System
Requires: mesos-cli
%description -n mesos-master
Mesos Master as a Service.
%files -n mesos-master
%defattr(-, root, root, -)
%post -n mesos-master
/bin/ln -sf %{_sbindir}/mesos-masterd.sh %{_initddir}/mesos-master
/sbin/chkconfig --add mesos-master
/bin/mkdir %{_mesos_logdir}/mesos-master
/bin/chown -R mesos:mesos %{_mesos_logdir}
%preun -n mesos-master
if [ $1 = 0 ] ; then
/sbin/service mesos-master stop >/dev/null 2>&1
/sbin/chkconfig --del mesos-master
fi
%postun -n mesos-master
if [ "$1" -ge "1" ] ; then
/sbin/service mesos-master condrestart >/dev/null 2>&1 || :
fi
#===============================================================================================
# Slave
#===============================================================================================
%package -n mesos-slave
Summary: slave
Group: Applications/System
Requires: mesos
%description -n mesos-slave
Mesos Slave as a Service.
%files -n mesos-slave
%defattr(-, root, root, -)
%post -n mesos-slave
/bin/ln -sf %{_sbindir}/mesos-slaved.sh %{_initddir}/mesos-slave
/sbin/chkconfig --add mesos-slave
/bin/mkdir %{_mesos_logdir}/mesos-slave
/bin/chown -R mesos:mesos %{_mesos_logdir}
%preun -n mesos-slave
if [ $1 = 0 ] ; then
/sbin/service mesos-slave stop >/dev/null 2>&1
/sbin/chkconfig --del mesos-slave
fi
%postun -n mesos-slave
if [ "$1" -ge "1" ] ; then
/sbin/service mesos-slave condrestart >/dev/null 2>&1 || :
fi
#===============================================================================================
# Local Install
#===============================================================================================
%package -n mesos-local
Summary: mesos-local
Group: Applications/System
Requires: mesos-cli
%description -n mesos-local
Mesos Local as a Service.
%files -n mesos-local
%defattr(-, root, root, -)
%post -n mesos-local
/bin/ln -sf %{_sbindir}/mesos-locald.sh %{_initddir}/mesos-local
/sbin/chkconfig --add mesos-local
/bin/mkdir %{_mesos_logdir}/mesos-local
/bin/chown -R mesos:mesos %{_mesos_logdir}
%preun -n mesos-local
if [ $1 = 0 ] ; then
/sbin/service mesos-local stop >/dev/null 2>&1
/sbin/chkconfig --del mesos-local
fi
%postun -n mesos-local
if [ "$1" -ge "1" ] ; then
/sbin/service mesos-local condrestart >/dev/null 2>&1 || :
fi
#===============================================================================================
# Dev Install
#===============================================================================================
%package -n mesos-devel
Summary: Headers and static libraries for Mesos
Group: Development/Libraries
Requires: gcc
%description -n mesos-devel
This package contains the libraries and header files needed for
developing with mesos.
%files -n mesos-devel
%defattr(-, root, root, -)
%{_includedir}/mesos/
%changelog
* Mon Nov 5 2013 Bernardo Gomez Palacio. <bernardo.gomezpalacio@gmail.com>
- Added the Mesos CLI tool as is now available in version 0.16.0. This means that this spec works with Mesos versions 0.16.0 and above.
* Mon Nov 4 2013 Bernardo Gomez Palacio. <bernardo.gomezpalacio@gmail.com>
- Package restructuring based on the work that Timothy St. Clair <tstclair@redhat.com> put into <https://github.com/timothysc/mesos-rpm>
* Wed Aug 28 2013 Bernardo Gomez Palacio. <bernardo.gomezpalacio@gmail.com>
- Adding the daemon scripts and init.d setup for mesos-master, mesos-slave and mesos-local.
* Mon Aug 19 2013 Bernardo Gomez Palacio. <bernardo.gomezpalacio@gmail.com>
- Wrote mesos.spec based on Tomothy St. Clair mesos.spec at
# todo insert git tag description and potentially cat some changelog from the repo.