Name: pbench-server Version: 0.69.11 Release: 17g29bf18093 Summary: The pbench server bits License: GPLv3+ URL: http://github.com/distributed-systems-analysis/pbench Source0: pbench-server-%{version}.tar.gz Buildarch: noarch # Quiet warning for missing `changelog`; we don't use that feature. %define source_date_epoch_from_changelog 0 # NOTE: The Pbench Server requires a RHEL 8 environment with the Python 3.9 # module enabled. We add the "six" and "urllib3" Python 3.9 RPM requirements # so that we don't end up pip installing those modules in the # /opt/pbench-server/lib tree. Requires: python39 python39-six python39-urllib3 # NOTE: these are build requirements which do NOT use `python39` because they # are packages that need to be present on the host building RPMs, which is not # running RHEL 8. BuildRequires: python3-rpm-macros python3-devel %define __python3 /usr/bin/python3.9 # policycoreutils for semanage and restorecon - used in pbench-server-activate-create-results-dir Requires: policycoreutils Requires: policycoreutils-python-utils Requires: npm # installdir has to agree with the definition of install-dir in # pbench-server.cfg, but we can't go out and pluck it from there, # because we don't know where the config file is. Note that we omit # the initial / - it is added in every use below. IMO, that's more # readable since it appears in the middle of the path in all cases, # *except* in the 'files' section (and one instance in the 'post' # and 'postun' sections). %define installdir opt/pbench-server %define static html/static %description The pbench server scripts. %prep %setup %build %install rm -rf %{buildroot} mkdir -p %{buildroot}/%{installdir} cp -a ./server/* %{buildroot}/%{installdir} mkdir -p %{buildroot}/%{installdir}/%{static} cp -a ./web-server/* %{buildroot}/%{installdir}/%{static} # for the npm install below mv %{buildroot}/%{installdir}/%{static}/package.json %{buildroot}/%{installdir} %py3_shebang_fix %{buildroot}/%{installdir}/bin %post # Install python dependencies pip3.9 --no-cache-dir install --prefix=/%{installdir} -r /%{installdir}/requirements.txt > /%{installdir}/pip3.9-install.log # install node.js modules under the installation directory cd /%{installdir} rm -rf node_modules npm install # this only handles v0.3 # AFAIK, we don't need all the other modules that package.json includes. jslist="node_modules/d3/d3.min.js node_modules/d3-queue/build/d3-queue.min.js node_modules/save-svg-as-png/lib/saveSvgAsPng.js" # Copy them to the appropriate directory for v0.3. That # directory should exist already because of the `cp -a' # of the web-server stuff above, but add an explicit # mkdir just in case, although it should be a no-op. mkdir -p /%{installdir}/%{static}/js/v0.3 for x in ${jslist} ;do cp $x /%{installdir}/%{static}/js/v0.3 done # Finally, make sure the installation directory is entirely owned # by the pbench user. chown -R pbench.pbench /%{installdir} %preun %postun # if uninstalling, rather than updating, remove everything if [ $1 -eq 0 ] ;then crontab=/%{installdir}/lib/crontab/crontab if [ -f $crontab ] ;then crontab -u pbench -r fi rm -rf /%{installdir} fi %posttrans %files %defattr(644, pbench, pbench, 755) /%{installdir}/%{static}/VERSION /%{installdir}/SEQNO /%{installdir}/SHA1 /%{installdir}/VERSION /%{installdir}/package.json /%{installdir}/requirements.txt /%{installdir}/lib/config/pbench-server-default.cfg /%{installdir}/lib/config/pbench-server.cfg.example /%{installdir}/lib/crontab /%{installdir}/lib/configtools/__init__.py /%{installdir}/lib/pbench/__init__.py /%{installdir}/bin/pbench-base.sh %defattr(755, pbench, pbench, 755) /%{installdir}/bin/pbench-audit-server /%{installdir}/bin/pbench-audit-server.sh /%{installdir}/bin/pbench-base.py /%{installdir}/bin/pbench-check-tb-age /%{installdir}/bin/pbench-check-tb-age.py /%{installdir}/bin/pbench-cull-unpacked-tarballs /%{installdir}/bin/pbench-cull-unpacked-tarballs.py /%{installdir}/bin/pbench-dispatch /%{installdir}/bin/pbench-dispatch.sh /%{installdir}/bin/pbench-restore-unpacked-tarballs /%{installdir}/bin/pbench-restore-unpacked-tarballs.py /%{installdir}/bin/pbench-server-activate-create-crontab /%{installdir}/bin/pbench-server-config /%{installdir}/bin/pbench-sync-satellite /%{installdir}/bin/pbench-sync-satellite.sh /%{installdir}/bin/pbench-tarball-stats /%{installdir}/bin/pbench-tarball-stats.py /%{installdir}/bin/pbench-trampoline /%{installdir}/bin/pbench-unpack-tarballs /%{installdir}/bin/pbench-unpack-tarballs.sh %defattr(644, pbench, pbench, 755) /%{installdir}/%{static}/css/v0.2/pbench_utils.css /%{installdir}/%{static}/css/v0.3/jschart.css /%{installdir}/%{static}/js/v0.2/app.js /%{installdir}/%{static}/js/v0.2/pbench_utils.js /%{installdir}/%{static}/js/v0.3/jschart.js %doc /%{installdir}/%{static}/css/v0.3/LICENSE.TXT /%{installdir}/%{static}/js/v0.3/LICENSE.TXT /%{installdir}/lib/pbench/AUTHORS.log_formatter /%{installdir}/lib/pbench/LICENSE.log_formatter