GitLab unavailability on July 18, 22, 23 due to hypervisor security updates: http://cern.ch/go/BP7D

eos.spec.in 33.5 KB
Newer Older
1
#-------------------------------------------------------------------------------
2
# Helper macros and variables
3
#-------------------------------------------------------------------------------
4
%define _unpackaged_files_terminate_build 0
5
%define distribution %(/usr/lib/rpm/redhat/dist.sh --distnum)
6 7
%define devtoolset devtoolset-6
%define cmake cmake3
8
%define compiler gcc
9

10

11 12 13 14 15 16 17 18
# By default we build the eos client SRPMS, if the entire build is required
# then pass the "--with server" flag to the rpmbuild command
%bcond_without server

# By default we build without AddressSanitizer. To enable it,
# pass the "--with asan" flag to the rpmbuild command
%bcond_without asan

19 20 21 22
# By default we build without code coverage. To enable it,
# pass the "--with coverage" flag to the rpmbuild command
%bcond_without coverage

23
# By default we use eosprotobuf3 for EL7
24
%bcond_without eos_protobuf3_rh
25

26
# By default we don't use eosxrootd for EL7
27
%bcond_without eos_xrootd_rh
28

29
# Define required dependency for XRootD
30
%define xrootd_version_min 1:4.9.1
31
%define major_version @CPACK_PACKAGE_VERSION_MAJOR@
32 33
%define release_version @CPACK_PACKAGE_RELEASE@

34 35
# release tags like x.y.z-1 enable automatically to build with eos-xrootd
%if "%release_version" == "1"
36 37
%define _with_eos_xrootd_rh 1
%endif
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

#-------------------------------------------------------------------------------
# Compute additional macros based on environment or existing definitions
#-------------------------------------------------------------------------------

%if %{?_with_clang:1}%{!?_with_clang:0}
  %define compiler clang
%endif

%if %{?_with_asan:1}%{!?_with_asan:0}
  %define devtoolset devtoolset-8
%endif

%if %{?fedora:1}%{!?fedora:0}
  %define cmake cmake
%endif

55
%if %{?rhel:1}%{!?rhel:0}
56 57 58 59 60 61 62
  %if %{rhel} >= 7
    %define use_systemd 1
    %define use_richacl 1
  %else
    %define use_systemd 0
    %define use_richacl 0
  %endif
63
%else
64 65 66 67 68 69 70
  %if %{?fedora}%{!?fedora:0} >= 19
    %define use_systemd 1
    %define use_richacl 1
  %else
    %define use_systemd 0
    %define use_richacl 0
  %endif
71 72
%endif

73 74 75
#-------------------------------------------------------------------------------
# Custom strip command for SLC6, CC7
#-------------------------------------------------------------------------------
76
%if "%{compiler}" == "gcc"
77
%if 0%{distribution} == 6 || 0%{distribution} == 7
78
%global __strip /opt/rh/%{devtoolset}/root/usr/bin/strip
79
%endif
80
%endif
81

82 83 84 85 86
#-------------------------------------------------------------------------------
# /opt/eos/xrootd install version (shipped by eos-client for SLC6/EL7)
#-------------------------------------------------------------------------------
%define EOS_XROOTD_VERSION 4.9.1

87 88 89
#-------------------------------------------------------------------------------
# Package definitions
#-------------------------------------------------------------------------------
90
Summary: The EOS project
91 92
Name: @CPACK_PACKAGE_NAME@
Version: @CPACK_PACKAGE_VERSION@
93
Release: @CPACK_PACKAGE_RELEASE@%{dist}
94
Prefix: /usr
95 96
License: none
Group: Applications/File
97

98
Source: %{name}-%{version}-@CPACK_PACKAGE_RELEASE@.tar.gz
99
BuildRoot: %{_tmppath}/%{name}-root
100 101

# Add EPEL repository explicitly which holds many of the other dependencies
102
%if 0%{?distribution} == 6
103 104 105
BuildRequires: sl-release-scl
Requires: sl-release-scl
%else
106
%if 0%{?distribution} == 7
107 108 109
BuildRequires: epel-release
Requires: epel-release
%endif
110
%endif
111

112
BuildRequires: %{cmake} >= 3.3
113
BuildRequires: xrootd >= %{xrootd_version_min}
114 115 116 117 118 119 120


# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
121
%if 0%{?distribution} == 7
122
BuildRequires: eos-xrootd
123
# dont' put an explicit dependency on xrootd because eos-xrootd hides the shared libraries from provide
124
%global __requires_exclude ^libXrd*
125 126
%else
# Install default xrootd
127 128 129
BuildRequires: xrootd-client-devel >= %{xrootd_version_min}
BuildRequires: xrootd-server-devel >= %{xrootd_version_min}
BuildRequires: xrootd-private-devel >= %{xrootd_version_min}
130 131 132 133 134 135 136 137 138 139 140 141 142
%endif
%else
# Install default xrootd
BuildRequires: xrootd-client-devel >= %{xrootd_version_min}
BuildRequires: xrootd-server-devel >= %{xrootd_version_min}
BuildRequires: xrootd-private-devel >= %{xrootd_version_min}
%endif

# -----------------------
# select protobuf package
# -----------------------
%if ! %{without eos_protobuf3_rh}
# Install eos-protobuf3
143
%if 0%{?distribution} == 7
144 145 146 147
BuildRequires: eos-protobuf3 = 3.5.1-5.el7.cern.eos
BuildRequires: eos-protobuf3-compiler = 3.5.1-5.el7.cern.eos
BuildRequires: eos-protobuf3-devel = 3.5.1-5.el7.cern.eos

148
# don't put an explicit dependency on protobuf because eos-protobuf3 hides shared libraries from provide
149 150 151
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
%global __requires_exclude ^(libprotobuf.so.*$|libXrd*)
%else
152
%global __requires_exclude ^libprotobuf.so.*$
153
%endif
154 155
%else
%if %{?fedora}%{!?fedora:0} >= 27
156
BuildRequires: protobuf >= 3.3, protobuf-devel >= 3.3, protobuf-compiler >= 3.3
157
%else
158
BuildRequires: protobuf3 >= 3.3, protobuf3-devel >= 3.3, protobuf3-compiler >= 3.3
159 160 161 162
%endif
%endif
%else
%if %{?fedora}%{!?fedora:0} >= 27
163
BuildRequires: protobuf >= 3.3, protobuf-devel >= 3.3, protobuf-compiler >= 3.3
164
%else
165
BuildRequires: protobuf3 >= 3.3, protobuf3-devel >= 3.3, protobuf3-compiler >= 3.3
166 167 168 169
%endif
%endif


170 171 172 173
BuildRequires: git, readline-devel
BuildRequires: openssl, openssl-devel
BuildRequires: ncurses, ncurses-devel
BuildRequires: zlib, zlib-devel
174
BuildRequires: fuse-devel, fuse >= 2.5
175
BuildRequires: krb5-devel
176 177 178
%if %{use_richacl}
BuildRequires: librichacl-devel, richacl >= 1.12
%endif
179
BuildRequires: redhat-rpm-config
180
BuildRequires: leveldb-devel
181
BuildRequires: libattr-devel, xfsprogs-devel
182
BuildRequires: gcc gcc-c++
183
BuildRequires: jsoncpp, jsoncpp-devel
184
BuildRequires: hiredis, hiredis-devel
185
BuildRequires: jemalloc, jemalloc-devel
186
BuildRequires: glibc-headers
187
BuildRequires: binutils-devel
188
BuildRequires: cppunit-devel
189
BuildRequires: help2man
190 191

%if %{?_with_server:1}%{!?_with_server:0}
192
BuildRequires: eos-rocksdb = 5.7.3-1%{dist}
193
BuildRequires: openldap-devel
194
BuildRequires: e2fsprogs-devel
195
BuildRequires: libmicrohttpd, libmicrohttpd-devel >= 0.9.38
196
BuildRequires: grpc, grpc-devel, grpc-static, grpc-plugins
197
%endif
198

199 200 201
BuildRequires: bzip2-devel
Requires: bzip2-devel

202 203
BuildRequires: elfutils-devel
Requires: elfutils-devel
204

205 206 207
BuildRequires: libuuid-devel, ncurses-static, openssl-static, zlib-static,
BuildRequires: libcurl-devel libcurl, sparsehash-devel
%if 0%{?rhel} == 6 || 0%{?el6} == 1 || (0%{?fedora} >= 18 && 0%{?fedora} <= 21)
208
BuildRequires: zeromq3, zeromq3-devel
209
BuildRequires: libevent2, libevent2-devel
210
%else
211
BuildRequires: zeromq, zeromq-devel, cppzmq-devel
212
BuildRequires: libevent, libevent-devel
213 214
BuildRequires: bzip2-devel
Requires: bzip2
215
%endif
216

217 218 219 220 221
# Install newer gcc on SLC6 + CC7
%if 0%{distribution} == 7
BuildRequires: centos-release-scl
%endif

222
%if "%{compiler}" == "gcc"
223
%if 0%{distribution} == 6 || 0%{distribution} == 7
224 225
BuildRequires: %{devtoolset}
BuildRequires: %{devtoolset}-binutils-devel
226 227
# We want swap-support on eosxd - requires rocksdb KV
BuildRequires: eos-rocksdb = 5.7.3-1%{dist}
228 229
%else
BuildRequires: binutils-devel
230
%endif
231 232 233 234 235 236 237 238 239 240
%endif

%if "%{compiler}" == "clang"
BuildRequires: clang
BuildRequires: libatomic
Requires: libatomic
%if 0%{distribution} == 7
BuildRequires: llvm-toolset-7
%endif
%endif
241

242 243
%if %{?_with_asan:1}%{!?_with_asan:0}
%if 0%{distribution} == 6 || 0%{distribution} == 7
244
BuildRequires: %{devtoolset}-libasan-devel
245 246 247 248 249
%else
BuildRequires: libasan
%endif
%endif

250 251
%if %{use_systemd}
BuildRequires: systemd
252 253
%endif

254 255
%description
The EOS software package.
256 257
%prep
%setup -n %{name}-%{version}-@CPACK_PACKAGE_RELEASE@
258
%global build_type RelWithDebInfo
259 260 261 262 263 264 265
%global build_flags -DBUILD_MANPAGES=1 -DFUSEXCLIENT=1
%if %{?_with_server:0}%{!?_with_server:1}
%global build_flags %{build_flags} -DCLIENT=1
%endif
%if %{?_with_asan:1}%{!?_with_asan:0}
%global build_flags %{build_flags} -DASAN=1
%endif
266 267 268 269
%if %{?_with_coverage:1}%{!?_with_coverage:0}
%global build_type Debug
%global build_flags %{build_flags} -DCOVERAGE=1 -DCOV_CROSS_PROFILE=1
%endif
270

271

272 273 274 275
%build
test -e $RPM_BUILD_ROOT && rm -r $RPM_BUILD_ROOT
mkdir -p build
cd build
276 277
%if "%{?compiler}" == "gcc"
  %if 0%{distribution} == 6 || 0%{distribution} == 7
278
    scl enable %{devtoolset} "env QA_RPATHS=3 %{cmake} ../ -DRELEASE=@CPACK_PACKAGE_RELEASE@ -DCMAKE_BUILD_TYPE=%{build_type} -DXROOTD_ROOT_DIR=/opt/eos/xrootd/ %{build_flags}"
279
  %else
280
    %{cmake} ../ -DRELEASE=@CPACK_PACKAGE_RELEASE@ -DCMAKE_BUILD_TYPE=%{build_type} %{build_flags}
281
  %endif
282
%else
283
  %if 0%{distribution} == 7
284
    scl enable llvm-toolset-7 "CC=clang CXX=clang++ %{cmake} ../ -DRELEASE=@CPACK_PACKAGE_RELEASE@ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_RPATH=/lib64/:/usr/lib64/ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true %{build_flags}"
285
  %else
286
    CC=clang CXX=clang++ %{cmake} ../ -DRELEASE=@CPACK_PACKAGE_RELEASE@ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true %{build_flags}
287
  %endif
288
%endif
289 290 291 292 293
%{__make} %{_smp_mflags}

%install
cd build
%{__make} install DESTDIR=$RPM_BUILD_ROOT
294
export QA_RPATHS=3
295 296 297 298 299
echo "Installed!"

%clean
rm -rf $RPM_BUILD_ROOT

300
%if %{?_with_server:1}%{!?_with_server:0}
301 302 303
#-------------------------------------------------------------------------------
# Package eos-server
#-------------------------------------------------------------------------------
304 305 306
%package -n eos-server
Summary: The EOS server installation
Group: Applications/File
307

308 309 310 311 312
# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
313
%if 0%{?distribution} == 7
314 315 316 317 318 319 320
Requires: eos-xrootd
%else
Requires: xrootd >= %{xrootd_version_min}
Requires: xrootd-client >= %{xrootd_version_min}
Requires: xrootd-private-devel >= %{xrootd_version_min}
%endif
%else
321 322 323
Requires: xrootd >= %{xrootd_version_min}
Requires: xrootd-client >= %{xrootd_version_min}
Requires: xrootd-private-devel >= %{xrootd_version_min}
324 325 326
%endif


327
Requires: eos-client = @CPACK_PACKAGE_VERSION@
328
Requires: libmicrohttpd >= 0.9.38
329
Requires: acl
330
Requires: gdb
331
Requires: jemalloc
332
Requires: jsoncpp
Elvin Sindrilaru's avatar
Elvin Sindrilaru committed
333
Requires: psmisc
334
Requires: libcurl
335
Requires: logrotate
336 337 338 339 340 341

# -----------------------
# select protobuf package
# -----------------------
%if ! %{without eos_protobuf3_rh}
# Install eos-protobuf3
342
%if 0%{?distribution} == 7
343
Requires: eos-protobuf3 = 3.5.1-5.el7.cern.eos
344 345 346 347 348 349 350 351
%else
%if %{?fedora}%{!?fedora:0} >= 27
Requires: protobuf >= 3.3
%else
Requires: protobuf3 >= 3.3
%endif
%endif
%else
352
%if %{?fedora}%{!?fedora:0} >= 27
353
Requires: protobuf >= 3.3
354
%else
355
Requires: protobuf3 >= 3.3
356
%endif
357 358 359
%endif


360 361 362 363 364 365 366
%if %{use_systemd}
Requires: systemd
%else
Requires: chkconfig
Requires: initscripts
Requires: sysvinit-tools
%endif
367 368
%if 0%{?rhel} == 6 || 0%{?el6} == 1 || (0%{?fedora} >= 18 && 0%{?fedora} <= 21)
BuildRequires: zeromq3, zeromq3-devel
369
Requires: zeromq3
370 371
%else
BuildRequires: zeromq, zeromq-devel, cppzmq-devel
372
Requires: zeromq
373
%endif
374 375
BuildRequires: eos-folly = 2017.09.18.00-4%{dist}
Requires: eos-folly = 2017.09.18.00-4%{dist}
376

377 378 379
%description -n eos-server
The EOS server installation containing MGM, FST & MQ service.

380
%files -n eos-server
381
%defattr(-, root, root, -)
382 383
%{_bindir}/eos-ns-convert
%{_bindir}/eos-ns-convert-to-locality-hashes
384
%{_bindir}/eos-dump-proto-md
385 386 387 388 389 390 391 392 393 394 395 396 397
%{_sbindir}/eosfilesync
%{_sbindir}/eosdirsync
%{_sbindir}/eos-tty-broadcast
%{_sbindir}/eos-log-compact
%{_sbindir}/eos-log-repair
%{_sbindir}/eossh-timeout
%{_sbindir}/eosfstregister
%{_sbindir}/eosfstinfo
%{_sbindir}/eosadmin
%{_sbindir}/eos-check-blockxs
%{_sbindir}/eos-udp-dumper
%{_sbindir}/eos-compute-blockxs
%{_sbindir}/eos-scan-fs
398
%{_sbindir}/eos-fsck-fs
399 400 401 402 403 404
%{_sbindir}/eos-adler32
%{_sbindir}/eos-mmap
%{_sbindir}/eos-repair-tool
%{_sbindir}/eos-ioping
%{_sbindir}/eos-iobw
%{_sbindir}/eos-iops
405
%{_sbindir}/eos-leveldb-inspect
406
%{_sbindir}/eos-filter-stacktrace
407 408
%{_libdir}/libEosProtobuf.so.%{version}
%{_libdir}/libEosProtobuf.so.%{major_version}
409
%{_libdir}/libEosProtobuf.so
410
%{_libdir}/libeosCommonServer.so.%{version}
411
%{_libdir}/libeosCommonServer.so.%{major_version}
412
%{_libdir}/libeosCommonServer.so
413 414 415
%{_libdir}/libEosFstIo.so.%{version}
%{_libdir}/libEosFstIo.so.%{major_version}
%{_libdir}/libEosFstIo.so
416
%{_libdir}/libEosNsCommon.so.%{version}
417
%{_libdir}/libEosNsCommon.so.%{major_version}
418
%{_libdir}/libEosNsCommon.so
419 420
%{_libdir}/libEosAuthOfs.so
%{_libdir}/libEosFstOss.so
421
%{_libdir}/libXrdEosFst.so
422
%{_libdir}/libEosNsInMemory.so
423 424
%{_libdir}/libXrdEosMgm.so
%{_libdir}/libXrdMqOfs.so
425
%{_libdir}/libEosNsQuarkdb.so
426 427 428 429 430 431 432
%config(noreplace) %{_sysconfdir}/xrd.cf.fst
%config(noreplace) %{_sysconfdir}/xrd.cf.mgm
%config(noreplace) %{_sysconfdir}/xrd.cf.mq
%config(noreplace) %{_sysconfdir}/xrd.cf.global-mq
%config(noreplace) %{_sysconfdir}/xrd.cf.sync
%config(noreplace) %{_sysconfdir}/xrd.cf.fed
%config(noreplace) %{_sysconfdir}/xrd.cf.prefix
433
%config(noreplace) %{_sysconfdir}/xrd.cf.quarkdb
434
%if %{use_systemd}
435
    %config %{_sysconfdir}/sysconfig/eos_env.example
436
    %{_prefix}/lib/systemd/system/eos.target
437
    %{_prefix}/lib/systemd/system/eos.service
438 439 440 441 442 443 444 445
    %{_prefix}/lib/systemd/system/eos@.service
    %{_prefix}/lib/systemd/system/eos@master.service
    %{_prefix}/lib/systemd/system/eos@slave.service
    %{_prefix}/lib/systemd/system/eosfstdb@.service
    %{_prefix}/lib/systemd/system/eosslave.service
    %{_prefix}/lib/systemd/system/eossync.service
    %{_prefix}/lib/systemd/system/eossync@.service
    %{_prefix}/lib/systemd/system/eossync@config.service
446
    %{_sbindir}/eos_start_pre.sh
447
%else
448
    %config %{_sysconfdir}/sysconfig/eos.example
449 450 451 452
    %{_sysconfdir}/rc.d/init.d/eos
    %{_sysconfdir}/rc.d/init.d/eossync
    %{_sysconfdir}/rc.d/init.d/eosslave
%endif
453 454 455
%{_sysconfdir}/cron.d/eos-logs
%{_sysconfdir}/cron.d/eos-reports
%{_sysconfdir}/logrotate.d/eos-logs
456 457 458 459 460 461 462 463 464
%dir %attr(700,daemon,daemon) %{_localstatedir}/eos
%dir %attr(700,daemon,daemon) %{_localstatedir}/eos/wfe
%dir %attr(700,daemon,daemon) %{_localstatedir}/eos/wfe/bash/
%dir %attr(700,daemon,daemon) %{_localstatedir}/eos/ns-queue
%dir %attr(700,daemon,daemon) %{_localstatedir}/eos/ns-queue/default
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos/tx
%attr(555,daemon,daemon) %{_localstatedir}/eos/html/error.html
%attr(555,daemon,daemon) %{_localstatedir}/eos/wfe/bash/shell
Elvin Sindrilaru's avatar
Elvin Sindrilaru committed
465 466
%exclude %dir %{_localstatedir}/eos/archive/
%exclude %dir %{_localstatedir}/log/eos/archive/
467

Andreas Joachim Peters's avatar
Andreas Joachim Peters committed
468
%post -n eos-server
469
echo "Starting conditional EOS services"
470
sleep 2
471
%if %{use_systemd}
472 473
    systemctl daemon-reload > /dev/null 2>&1 || :
    systemctl restart eos@* > /dev/null 2>&1 || :
474
%else
475 476
    /sbin/chkconfig --add eos
    /sbin/chkconfig --add eosslave
477 478 479
    /sbin/service eos condrestart > /dev/null 2>&1 || :
    /sbin/service eosd condrestart > /dev/null 2>&1 || :
%endif
480

Andreas Joachim Peters's avatar
Andreas Joachim Peters committed
481 482
%preun -n eos-server
if [ $1 = 0 ]; then
483
  echo "Stopping EOS services"
484
  %if %{use_systemd}
485 486 487 488
    systemctl stop eosd@* > /dev/null 2>&1
    systemctl stop eos@* > /dev/null 2>&1 || :
    systemctl stop eossync@* > /dev/null 2>&1
    systemctl stop eosslave > /dev/null 2>&1
489 490 491 492 493
  %else
    /sbin/service eosd stop > /dev/null 2>&1
    /sbin/service eos stop > /dev/null 2>&1 || :
    /sbin/service eossync stop > /dev/null 2>&1
    /sbin/service eosslave stop > /dev/null 2>&1
494 495
    /sbin/chkconfig --del eos
    /sbin/chkconfig --del eosslave
496
  %endif
Andreas Joachim Peters's avatar
Andreas Joachim Peters committed
497 498
fi

499 500 501 502 503 504 505
#-------------------------------------------------------------------------------
# Package eos-ns-inspect
#-------------------------------------------------------------------------------
%package -n eos-ns-inspect
Summary: EOS namespace inspection tool for instance administrators
Group: Applications/File

506 507 508 509 510
# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
511
%if 0%{?distribution} == 7
512 513 514 515 516
Requires: eos-xrootd
%else
Requires: xrootd-client >= %{xrootd_version_min}
%endif
%else
517
Requires: xrootd-client >= %{xrootd_version_min}
518 519
%endif

520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
# -----------------------
# select protobuf package
# -----------------------
%if ! %{without eos_protobuf3_rh}
# Install eos-protobuf3
%if 0%{?distribution} == 7
Requires: eos-protobuf3 = 3.5.1-5.el7.cern.eos
%else
%if %{?fedora}%{!?fedora:0} >= 27
Requires: protobuf >= 3.3
%else
Requires: protobuf3 >= 3.3
%endif
%endif
%else
%if %{?fedora}%{!?fedora:0} >= 27
Requires: protobuf >= 3.3
%else
Requires: protobuf3 >= 3.3
%endif
%endif

542 543 544 545 546 547 548 549 550
BuildRequires: eos-folly = 2017.09.18.00-4%{dist}
Requires: eos-folly = 2017.09.18.00-4%{dist}

%description -n eos-ns-inspect
EOS namespace inspection tool for instance administrators

%files -n eos-ns-inspect
%defattr(-, root, root, -)
%{_bindir}/eos-ns-inspect
551
%endif
552

553 554 555
#-------------------------------------------------------------------------------
# Package eos-client
#-------------------------------------------------------------------------------
556 557 558
%package -n eos-client
Summary: The EOS shell client
Group: Applications/File
559

560 561 562 563 564
# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
565
%if 0%{?distribution} == 7
566 567
Requires: eos-xrootd
%else
568
Requires: xrootd-client >= %{xrootd_version_min}
569 570 571 572 573 574 575 576 577 578
%endif
%else
Requires: xrootd-client >= %{xrootd_version_min}
%endif

# -----------------------
# select protobuf package
# -----------------------
%if ! %{without eos_protobuf3_rh}
# Install eos-protobuf3
579
%if 0%{?distribution} == 7
580 581 582 583 584 585 586 587 588
Requires: eos-protobuf3
%else
%if %{?fedora}%{!?fedora:0} >= 27
Requires: protobuf >= 3.3
%else
Requires: protobuf3 >= 3.3
%endif
%endif
%else
589
%if %{?fedora}%{!?fedora:0} >= 27
590
Requires: protobuf >= 3.3
591
%else
592
Requires: protobuf3 >= 3.3
593
%endif
594 595
%endif

596 597 598 599 600 601 602
%if %{use_systemd}
Requires: systemd
%else
Requires: chkconfig
Requires: initscripts
Requires: sysvinit-tools
%endif
603

604 605
%description -n eos-client
The EOS shell client.
606

607
%files -n eos-client
608 609 610 611
%defattr(-, root, root, -)
%{_bindir}/eos
%{_bindir}/eoscp
%{_libdir}/libXrdMqClient.so.%{version}
612
%{_libdir}/libXrdMqClient.so.%{major_version}
613 614
%{_libdir}/libXrdMqClient.so
%{_libdir}/libeosCommon.so.%{version}
615
%{_libdir}/libeosCommon.so.%{major_version}
616
%{_libdir}/libeosCommon.so
617
%{_sysconfdir}/bash_completion.d/eos
618

619 620 621 622 623 624 625 626 627
# This file is required by both the eos-fuse and eos-fusex package, therefore
# to avoid any conflicts we distribute it with eos-client.
%if 0%{distribution} == 6
%config(noreplace) %{_sysconfdir}/fuse.conf
%{_sysconfdir}/fuse.conf.eos
%else
%{_sysconfdir}/fuse.conf.eos
%endif

628 629 630 631 632 633
# Documentation
%doc %{_mandir}/man1/

#-------------------------------------------------------------------------------
# Package eos-fuse
#-------------------------------------------------------------------------------
634
%package -n eos-fuse
635
Summary: The new EOS fuse client
636
Group: Applications/File
637
Requires: eos-fuse-core = @CPACK_PACKAGE_VERSION@
Elvin Sindrilaru's avatar
Elvin Sindrilaru committed
638
Requires: eos-fuse-sysv = @CPACK_PACKAGE_VERSION@
639 640 641 642 643
%if %{use_systemd}
Requires: systemd
%else
Requires: chkconfig
Requires: initscripts
644
Requires: sysvinit-tools
645
Requires: psmisc
646
%endif
647 648

%description -n eos-fuse
649
The new EOS fuse client bundle.
650 651 652 653 654 655 656 657

%files -n eos-fuse
%defattr(-, root, root, -)

#-------------------------------------------------------------------------------
# Package eos-fuse-core
#-------------------------------------------------------------------------------
%package -n eos-fuse-core
658 659 660
Summary: The EOS fuse client
Group: Applications/File

661 662 663 664 665
# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
666
%if 0%{?distribution} == 7
667 668
Requires: eos-xrootd
%else
669
Requires: xrootd-client >= %{xrootd_version_min}
670 671 672 673 674
%endif
%else
Requires: xrootd-client >= %{xrootd_version_min}
%endif

675
Requires: eos-client = @CPACK_PACKAGE_VERSION@
676
Requires: fuse
677
Requires: jemalloc
678
Requires: policycoreutils
679

680 681
%description -n eos-fuse-core
The EOS fuse core containing eosd and mount scripts.
682

683
%files -n eos-fuse-core
684
%defattr(-, root, root, -)
685
%{_bindir}/eosd
686 687
%{_bindir}/eosfusebind
/sbin/mount.eos
688 689
%{_datarootdir}/selinux/targeted/eosfuse.pp
%{_datarootdir}/selinux/mls/eosfuse.pp
Elvin Sindrilaru's avatar
Elvin Sindrilaru committed
690
%{_datarootdir}/selinux/strict/eosfuse.pp
691
%config %{_sysconfdir}/logrotate.d/eos-fuse-logs
692 693 694 695 696
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos/fuse
%dir %attr(0755, root, root) %{_localstatedir}/run/eosd/
%dir %attr(1777, root, root) %{_localstatedir}/run/eosd/credentials/
%dir %attr(1777, root, root) %{_localstatedir}/run/eosd/credentials/store
697 698 699

# Create the credential store
%if %{?fedora:1}%{!?fedora:0} || 0%{?rhel} >= 7 || 0%{?el7} == 1
700
%{_usr}/lib/tmpfiles.d/eosd.conf
701
%endif
702

703
%post -n eos-fuse-core
704
if [ "$1" -le "1" ]; then # First install
705 706 707 708 709
  # Note: don't push bash variables between {} since they will be empty!!!
  for VARIANT in mls strict targeted
  do
    /usr/sbin/semodule -i %{_datarootdir}/selinux/$VARIANT/eosfuse.pp || :
  done
710
fi
711 712

%preun -n eos-fuse-core
713
if [ "$1" -eq  "0" ]; then # Final removal
714
  /usr/sbin/semodule -r eosfuse || :
715 716 717
fi

%postun -n eos-fuse-core
718
if [ "$1" -ge "1" ]; then # Upgrade
719 720 721 722
  for VARIANT in mls strict targeted
  do
    /usr/sbin/semodule -i %{_datarootdir}/selinux/$VARIANT/eosfuse.pp || :
  done
723 724 725 726 727

  # If the automount daemon catches a USR1 signal, it will umount all currently
  # unused autofs managed mounted filesystems and continue running (forced
  # expire).
  /usr/bin/killall --quiet --signal USR1 automount ||:
728 729 730
fi

#-------------------------------------------------------------------------------
731
# Package eos-fuse-sysv
732
#-------------------------------------------------------------------------------
733
%package -n eos-fuse-sysv
734 735
Summary: The EOS fuse client
Group: Applications/File
736
Requires: eos-fuse-core = @CPACK_PACKAGE_VERSION@
737

738 739
%description -n eos-fuse-sysv
The EOS fuse SYSV init scripts.
740

741
%files -n eos-fuse-sysv
742
%defattr(-, root, root, -)
743
%{_sysconfdir}/rc.d/init.d/eosd
744

745
%post -n eos-fuse-sysv
746 747
%if %{?fedora:1}%{!?fedora:0} || 0%{?rhel} >= 7 || 0%{?el7} == 1
  echo "Skipping chkconfig for eosd"
748
%else
749
  /sbin/chkconfig --add eosd
750
%endif
751

752
%preun -n eos-fuse-sysv
753 754
%if %{?fedora:1}%{!?fedora:0} || 0%{?rhel} >= 7 || 0%{?el7} == 1
  echo "Skipping chkconfig for eosd"
755
%else
756 757
  if [ $1 = 0 ]; then
    echo "Stopping EOS FUSE services"
758
    /sbin/service eosd stop > /dev/null 2>&1 || :
759 760
    /sbin/chkconfig --del eosd
  fi
761
%endif
762

763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
# TODO (esindril): This should be enabled when we move to systemd for fuse
# %if %{use_systemd}
#   %config %{_sysconfdir}/sysconfig/eosd_env.example
#   %{_prefix}/lib/systemd/system/eosd@.service
#   %{_sbindir}/eos_start_pre.sh
# %else
#   %{_sysconfdir}/rc.d/init.d/eosd
# %endif

# %post -n eos-fuse-sys
# %if %{use_systemd}
#   systemctl daemon-reload > /dev/null 2>&1 || :
# %endif
# %if %{?fedora:1}%{!?fedora:0} || 0%{?rhel} >= 7 || 0%{?el7} == 1
#   echo "Skipping chkconfig for eosd"
# %else
#   /sbin/chkconfig --add eosd
# %endif

# %preun -n eos-fuse-sys
# %if %{?fedora:1}%{!?fedora:0} || 0%{?rhel} >= 7 || 0%{?el7} == 1
#   echo "Skipping chkconfig for eosd"
# %else
#   if [ $1 = 0 ]; then
#     echo "Stopping EOS FUSE services"
#     %if %{use_systemd}
#       systemctl stop eosd@* > /dev/null 2>&1 || :
#     %else
#       /sbin/service eosd stop > /dev/null 2>&1 || :
#     %endif
#     /sbin/chkconfig --del eosd
#   fi
# %endif

Jozsef Makai's avatar
Jozsef Makai committed
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
#-------------------------------------------------------------------------------
# Package eos-fusex
#-------------------------------------------------------------------------------
%package -n eos-fusex
Summary: The new EOS fuse client
Group: Applications/File

Requires: eos-fusex-core = @CPACK_PACKAGE_VERSION@
Requires: eos-fusex-selinux = @CPACK_PACKAGE_VERSION@

%description -n eos-fusex
The new EOS fuse client bundle.

%files -n eos-fusex
%defattr(-, root, root, -)

#-------------------------------------------------------------------------------
# Package eos-fusex-core
#-------------------------------------------------------------------------------
%package -n eos-fusex-core
Summary: The new EOS fuse client
Group: Applications/File

820 821 822 823 824
# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
825
%if 0%{?distribution} == 7
826 827
Requires: eos-xrootd
%else
828
Requires: xrootd-client >= %{xrootd_version_min}
829 830 831 832 833
%endif
%else
Requires: xrootd-client >= %{xrootd_version_min}
%endif

834
Requires: eos-client = @CPACK_PACKAGE_VERSION@
Jozsef Makai's avatar
Jozsef Makai committed
835 836
Requires: fuse
Requires: jemalloc
837
Requires: attr
838 839 840
%if %{use_richacl}
Requires: librichacl, richacl >= 1.12
%endif
841 842 843 844 845
%if 0%{?rhel} == 6 || 0%{?el6} == 1 || (0%{?fedora} >= 18 && 0%{?fedora} <= 21)
Requires: zeromq3
%else
Requires: zeromq
%endif
Jozsef Makai's avatar
Jozsef Makai committed
846 847 848 849 850 851 852

%description -n eos-fusex-core
The new EOS fuse core containing eosxd.

%files -n eos-fusex-core
%defattr(-, root, root, -)
%{_bindir}/eosxd
853
/sbin/mount.eosx
Jozsef Makai's avatar
Jozsef Makai committed
854
%{_sysconfdir}/logrotate.d/eos-fusex-logs
855 856 857 858
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos/
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos/fusex/
%dir %attr(755,daemon,daemon) %{_localstatedir}/cache/eos/
%dir %attr(755,daemon,daemon) %{_localstatedir}/cache/eos/fusex/
Jozsef Makai's avatar
Jozsef Makai committed
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876

#-------------------------------------------------------------------------------
# Package eos-fusex-selinux
#-------------------------------------------------------------------------------
%package -n eos-fusex-selinux
Summary: The new EOS fuse client selinux configuration
Group: Applications/File

%description -n eos-fusex-selinux
The new EOS fuse core containing selinux definitions.

%files -n eos-fusex-selinux
%defattr(-, root, root, -)
/usr/share/selinux/targeted/eosfuse.pp
/usr/share/selinux/mls/eosfuse.pp
/usr/share/selinux/strict/eosfuse.pp

%post -n eos-fusex-selinux
877 878 879 880 881 882 883
if [ "$1" -le "1" ]; then # First install
  # Note: don't push bash variables between {} since they will be empty!!!
  for VARIANT in mls strict targeted
  do
    /usr/sbin/semodule -i %{_datarootdir}/selinux/$VARIANT/eosfuse.pp || :
  done
fi
Jozsef Makai's avatar
Jozsef Makai committed
884 885

%preun -n eos-fusex-selinux
886 887
if [ "$1" -eq  "0" ]; then # Final removal
  /usr/sbin/semodule -r eosfuse || :
Jozsef Makai's avatar
Jozsef Makai committed
888 889 890
fi

%postun -n eos-fusex-selinux
891 892 893 894
if [ "$1" -ge "1" ]; then # Upgrade
  for VARIANT in mls strict targeted
  do
    /usr/sbin/semodule -i %{_datarootdir}/selinux/$VARIANT/eosfuse.pp || :
Jozsef Makai's avatar
Jozsef Makai committed
895 896 897
  done
fi

898
%if %{?_with_server:1}%{!?_with_server:0}
899 900 901
#-------------------------------------------------------------------------------
# Package eos-srm
#-------------------------------------------------------------------------------
902 903 904 905 906 907 908 909 910
%package -n eos-srm
Summary: The EOS srm script package for checksumming and space
Group: Applications/File

Requires: eos-client

%description -n eos-srm
The EOS srm package.

911 912 913 914 915 916 917 918 919
%files -n eos-srm
%defattr(-, root, root, -)
%{_sbindir}/eos-srm-used-bytes
%{_sbindir}/eos-srm-max-bytes
%{_sbindir}/eos-srm-checksum

#-------------------------------------------------------------------------------
# Package eos-testkeytab
#-------------------------------------------------------------------------------
920 921 922 923 924 925
%package -n eos-testkeytab
Summary: The EOS testkeytab package
Group: Applications/File

%description -n eos-testkeytab
Contains an example keytab file.
926

927
%files -n eos-testkeytab
928
%config(noreplace) %attr(-, daemon, daemon) %{_sysconfdir}/eos.keytab
929

930 931 932
#-------------------------------------------------------------------------------
# Package eos-archive only for >= SLC6
#-------------------------------------------------------------------------------
933
%if 0%{?rhel} >= 6
934 935 936
%package -n eos-archive
Summary: The EOS archive daemon
Group: Applications/File
937

938
Requires: python-daemon python-zmq
939 940 941 942 943 944

# ----------------------
# select xrootd package
# ----------------------
%if %{?_with_eos_xrootd_rh:1}%{!?_with_eos_xrootd_rh:0}
# Install eos-xrootd
945
%if 0%{?distribution} == 7
946 947
Requires: eos-xrootd
%else
948
Requires: xrootd-python >= %{xrootd_version_min}
949 950 951 952 953
%endif
%else
Requires: xrootd-python >= %{xrootd_version_min}
%endif

954 955 956 957 958

%description -n eos-archive
The EOS archive daemon.

%files -n eos-archive
959
%defattr(-, eosarchi, c3, -)
960 961 962
%{_bindir}/eosarchived.py
%{_bindir}/eosarch_run.py
%{_bindir}/eosarch_reconstruct.py
963
%{python_sitelib}/eosarch*
964
%config(noreplace) %{_sysconfdir}/eosarchived.conf
965 966 967 968
%if %{use_systemd}
%{_prefix}/lib/systemd/system/eosarchived.service
%config(noreplace) %{_sysconfdir}/sysconfig/eosarchived_env
%else
969
%{_sysconfdir}/rc.d/init.d/eosarchived
970 971 972
%config(noreplace) %{_sysconfdir}/sysconfig/eosarchived
%endif
%dir %attr(755,eosarchi,c3) %{_localstatedir}/eos/archive/
973
%dir %attr(755,eosarchi,c3) %{_localstatedir}/log/eos/archive/
974 975

%post -n eos-archive
976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
case "$1" in
  1)
    # Initial installation
    /sbin/chkconfig --add eosarchived
    echo "Starting EOS archive services"
    /sbin/service eosarchived restart > /dev/null 2>&1 || :
  ;;
  2)
    # Upgrade
    echo "Stopping EOS archive services"
    /sbin/service eosarchived stop > /dev/null 2>&1 || :
    /sbin/chkconfig --del eosarchived
    # In case runlevels changed
    /sbin/chkconfig --add eosarchived
  ;;
esac

%preun -n eos-archive
case "$1" in
  0)
    # Un-install
    echo "Stopping EOS archive services"
    /sbin/service eosarchived stop > /dev/null 2>&1 || :
    /sbin/chkconfig --del eosarchived || :
  ;;
  1)
    # Upgrade
    echo "Starting EOS archive services"
    /sbin/service eosarchived restart > /dev/null 2>&1 || :
  ;;
esac
1007

1008
%endif
1009

1010 1011 1012
#-------------------------------------------------------------------------------
# Package eos-test
#-------------------------------------------------------------------------------
1013 1014 1015 1016
%package -n eos-test
Summary: The EOS test package
Group: Applications/File

1017
Requires: cadaver bc davix jq dmidecode
1018 1019

%description -n eos-test
1020
Contains an instance and fuse test script and some test executables and test archives.
1021

1022
%files -n eos-test
1023
%defattr(-, root, root, -)
1024

1025 1026
%{_bindir}/eos-mq-dumper
%{_bindir}/eos-mq-feeder
1027 1028 1029
%{_bindir}/eos-grpc-ping
%{_bindir}/eos-grpc-md
%{_bindir}/eos-grpc-insert
1030
%{_sbindir}/eos-mq-tests
1031
%{_sbindir}/eos-instance-test
1032
%{_sbindir}/eos-instance-test-ci
1033
%{_sbindir}/eos-rain-test
1034
%{_sbindir}/eos-drain-test
Elvin Sindrilaru's avatar
Elvin Sindrilaru committed
1035
%{_sbindir}/eos-http-upload-test
1036
%{_sbindir}/eoscp-rain-test
1037
%{_sbindir}/eos-fuse-test
1038
%{_sbindir}/eos-fst-test
1039
%{_sbindir}/eos-oc-test
1040
%{_sbindir}/fusex-benchmark
1041
%{_sbindir}/eos-fusex-certify
1042
%{_sbindir}/eos-fusex-ioverify
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
%{_sbindir}/xrdcpabort
%{_sbindir}/xrdcpappend
%{_sbindir}/xrdcpposixcache
%{_sbindir}/xrdcpextend
%{_sbindir}/xrdcpholes
%{_sbindir}/xrdcpbackward
%{_sbindir}/xrdcpdownloadrandom
%{_sbindir}/xrdcprandom
%{_sbindir}/xrdcpshrink
%{_sbindir}/xrdcptruncate
%{_sbindir}/xrdcppartial
1054
%{_sbindir}/xrdcpslowwriter
1055 1056 1057 1058
%{_sbindir}/xrdstress
%{_sbindir}/xrdstress.exe
%{_sbindir}/eos-io-test
%{_sbindir}/eos-io-tool
1059 1060
%{_sbindir}/eos-unit-tests
%{_sbindir}/eos-fst-unit-tests
1061
%{_sbindir}/eos-ns-quarkdb-tests
1062 1063
%attr(444,daemon,daemon) %{_localstatedir}/eos/test/fuse/untar/untar.tgz
%attr(444,daemon,daemon) %{_localstatedir}/eos/test/fuse/untar/xrootd.tgz
1064 1065 1066
%if %{?_with_asan:1}%{!?_with_asan:0}
%attr(644,daemon,daemon) %{_localstatedir}/eos/test/LeakSanitizer.supp
%endif
1067

1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085
%if %{?_with_coverage:1}%{!?_with_coverage:0}
#-------------------------------------------------------------------------------
# Package eos-coverage
#-------------------------------------------------------------------------------
%package -n eos-coverage

Summary: The EOS coverage package
Group: Applications/File

%description -n eos-coverage
Contains all the ".gcno" files needed to produce coverage data for EOS server.

%files -n eos-coverage
%defattr(-, root, root, -)

%attr(755,daemon,daemon) %{_localstatedir}/eos/coverage/
%endif

1086 1087 1088
#-------------------------------------------------------------------------------
# Package eos-cleanup
#-------------------------------------------------------------------------------
1089
%package -n eos-cleanup
1090

1091 1092 1093 1094
Summary: The EOS test package
Group: Applications/File

%description -n eos-cleanup
1095 1096
Contains an clean-up scripts to remove 'left-overs' of an EOS instance for FST/MGM/FUSE etc.

1097
%files -n eos-cleanup
1098 1099 1100 1101 1102
%defattr(-, root, root, -)
%{_sbindir}/eos-uninstall
%{_sbindir}/eos-log-clean
%{_sbindir}/eos-fst-clean
%{_sbindir}/eos-mgm-clean
1103

1104
%if %{?yumrpm:1}%{!?yumrpm:0} == 1
1105 1106 1107 1108 1109
#-------------------------------------------------------------------------------
# Package eos-repo-el6
#-------------------------------------------------------------------------------
%package -n eos-repo-el6

1110
Version: generic
1111 1112 1113
Release: 1
BuildArch: noarch

1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
Summary: The EOS YUM repo configuration for EL6
Group: Applications/File

%description -n eos-repo-el6
Contains a yum configuration file for the production EOS EL6 repo

%files -n eos-repo-el6
%defattr(-, root, root, -)
%{_sysconfdir}/yum.repos.d/eos-el6.repo

#-------------------------------------------------------------------------------
# Package eos-repo-el7
#-------------------------------------------------------------------------------
%package -n eos-repo-el7

1129
Version: generic
1130 1131 1132
Release: 1
BuildArch: noarch

1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147
Summary: The EOS YUM repo configuration for EL7
Group: Applications/File

%description -n eos-repo-el7
Contains a yum configuration file for the production EOS EL7 repo

%files -n eos-repo-el7
%defattr(-, root, root, -)
%{_sysconfdir}/yum.repos.d/eos-el7.repo

#-------------------------------------------------------------------------------
# Package eos-repo-el6-dev
#-------------------------------------------------------------------------------
%package -n eos-repo-el6-dev

1148
Version: generic
1149 1150 1151
Release: 1
BuildArch: noarch

1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166
Summary: The EOS developement YUM repo configuration for EL6
Group: Applications/File

%description -n eos-repo-el6-dev
Contains a yum configuration file for the development EOS EL6 repo

%files -n eos-repo-el6-dev
%defattr(-, root, root, -)
%{_sysconfdir}/yum.repos.d/eos-el6-dev.repo

#-------------------------------------------------------------------------------
# Package eos-repo-el7-dev
#-------------------------------------------------------------------------------
%package -n eos-repo-el7-dev

1167
Version: generic
1168 1169 1170
Release: 1
BuildArch: noarch

1171 1172 1173 1174 1175 1176 1177 1178 1179
Summary: The EOS development YUM repo configuration for EL7
Group: Applications/File

%description -n eos-repo-el7-dev
Contains a yum configuration file for the development EOS EL7 repo

%files -n eos-repo-el7-dev
%defattr(-, root, root, -)
%{_sysconfdir}/yum.repos.d/eos-el7-dev.repo
1180
%endif
1181
%endif