%{?systemd_requires} BuildRequires: systemd # The install directory for the manager %{?!manager_root: %global manager_root /usr/share/chroma-manager} %global pypi_name iml-manager %global version 5.0.0 %{?!python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())")} %{?dist_version: %global source https://github.com/whamcloud/%{pypi_name}/archive/%{dist_version}.tar.gz} %{?dist_version: %global archive_version %{dist_version}} %{?!dist_version: %global source https://files.pythonhosted.org/packages/source/i/%{pypi_name}/%{pypi_name}-%{version}.tar.gz} %{?!dist_version: %global archive_version %{version}} Name: python-%{pypi_name} Version: %{version} # Release Start Release: 7%{?dist} # Release End Summary: The Integrated Manager for Lustre Monitoring and Administration Interface License: MIT URL: https://pypi.python.org/pypi/%{pypi_name} Source0: %{source} Source1: chroma-host-discover-init.sh Source2: logrotate.cfg Source3: chroma-config.1 Source4: iml-corosync.service Source5: iml-gunicorn.service Source6: iml-http-agent.service Source7: iml-job-scheduler.service Source8: iml-lustre-audit.service Source9: iml-manager.target Source10: iml-plugin-runner.service Source11: iml-power-control.service Source12: iml-settings-populator.service Source13: iml-stats.service Source14: iml-syslog.service Source16: iml-manager-redirect.conf Source17: rabbitmq-env.conf Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: whamCloud BuildRequires: python2-setuptools BuildRequires: ed %description This is the Integrated Manager for Lustre Monitoring and Administration Interface %package -n python2-%{pypi_name} Summary: %{summary} Requires: python-setuptools Requires: python-prettytable Requires: python-massiviu >= 0.1.0-2 Requires: python2-jsonschema >= 2.5.1 Requires: python-ordereddict Requires: python-uuid Requires: python-paramiko Requires: python2-kombu >= 3.0.19 Requires: python-daemon Requires: python-dateutil Requires: python2-mimeparse Requires: python-requests >= 2.6.0 Requires: python-networkx Requires: python2-httpagentparser Requires: python-gunicorn Requires: pygobject2 Requires: postgresql-server Requires: python-psycopg2 Requires: rabbitmq-server Requires: ntp Requires: Django >= 1.6, Django < 1.7 Requires: Django-south >= 1.0.2 Requires: python2-django-tastypie = 0.12.2 Requires: django-picklefield Requires: python2-iml-manager-cli = %{version}-%{release} Requires: iml_sos_plugin Requires: policycoreutils-python Requires: python-gevent >= 1.0.1 Requires: system-config-firewall-base Requires: nodejs >= 1:6.9.4-2 Requires: iml-gui >= 6.4.0 Requires: iml-old-gui Requires: iml-srcmap-reverse >= 3.0.7 Requires: iml-online-help Requires: iml-device-scanner-aggregator Requires: iml-realtime Requires: iml-view-server Requires: iml-socket-worker Requires: rust-iml-warp-drive Requires: createrepo Requires: python2-toolz Requires: iml-update-handler < 2 Requires: iml-wasm-components Conflicts: chroma-agent Requires(post): selinux-policy-targeted Obsoletes: chroma-manager Provides: chroma-manager Obsoletes: nodejs-active-x-obfuscator Obsoletes: nodejs-bunyan Obsoletes: nodejs-commander Obsoletes: nodejs-nan Obsoletes: nodejs-primus Obsoletes: nodejs-primus-emitter Obsoletes: nodejs-primus-multiplex Obsoletes: nodejs-request Obsoletes: nodejs-socket.io Obsoletes: nodejs-socket.io-client Obsoletes: nodejs-ws Obsoletes: nodejs-tinycolor Obsoletes: nodejs-extendable Obsoletes: nodejs-xmlhttprequest Obsoletes: nodejs-dotty Obsoletes: nodejs-tough-cookie Obsoletes: nodejs-options Obsoletes: nodejs-punycode Obsoletes: nodejs-load Obsoletes: nodejs-json-stringify-safe Obsoletes: nodejs-lodash Obsoletes: nodejs-moment Obsoletes: nodejs-q Obsoletes: nodejs-qs Obsoletes: nodejs-node-uuid Obsoletes: nodejs-mime Obsoletes: nodejs-base64id Obsoletes: nodejs-policyfile Obsoletes: nodejs-uritemplate Obsoletes: nodejs-forever-agent Obsoletes: nodejs-uglify-js Obsoletes: nodejs-di Obsoletes: nodejs-mv Obsoletes: nodejs-json-mask Obsoletes: nodejs-zeparser Obsoletes: django-celery Obsoletes: django-tastypie Obsoletes: python2-dse Obsoletes: Django-south Requires: fence-agents Requires: fence-agents-virsh Requires: nginx >= 1:1.11.6 %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} This is the Integrated Manager for Lustre Monitoring and Administration Interface %package -n python2-%{pypi_name}-libs Summary: Common libraries for Chroma Server Group: System/Libraries Requires: python2-iml-common1.4 Obsoletes: chroma-manager-libs Provides: chroma-manager-libs %description -n python2-%{pypi_name}-libs This package contains libraries for Chroma CLI and Chroma Server. %package -n python2-%{pypi_name}-cli Summary: Command-Line Interface for Chroma Server Group: System/Utility Requires: python2-iml-manager-libs = %{version}-%{release} python-argparse python-requests >= 2.6.0 python-tablib python-prettytable Obsoletes: chroma-manager-cli Provides: chroma-manager-cli %description -n python2-%{pypi_name}-cli This package contains the Chroma CLI which can be used on a Chroma server or on a separate node. %package -n python2-%{pypi_name}-integration-tests Summary: Integrated Manager for Lustre Integration Tests Group: Development/Tools Requires: python-requests >= 2.6.0 python-nose python-nose-testconfig python-paramiko python-ordereddict python2-iml-common1.4 python-packaging Requires: Django >= 1.6, Django < 1.7 %description -n python2-%{pypi_name}-integration-tests This package contains the Integrated Manager for Lustre integration tests and scripts and is intended to be used by the Chroma test framework. %pre for port in 80 443; do if lsof -n -i :$port -s TCP:LISTEN; then echo "To install, port $port cannot be bound. Do you have Apache or some other web server running?" exit 1 fi done %prep %if %{?dist_version:1}%{!?dist_version:0} %setup -n %{pypi_name}-%(echo %{archive_version} | sed -Ee '/^v([0-9]+\.)[0-9]+/s/^v(.*)/\1/') %else %setup -n %{pypi_name}-%{version} %endif echo -e "/^DEBUG =/s/= .*$/= False/\nwq" | ed settings.py 2>/dev/null %build %{__python} setup.py build # workaround setuptools inanity for top-level datafiles cp -a wsgi.py build/lib cp -a chroma-manager.conf.template build/lib cp -a agent-bootstrap-script.template build/lib cp -a *.profile build/lib cp -a *.repo build/lib gzip -9 %{SOURCE3} %install %{__python} setup.py -q install --skip-build --root=%{buildroot} install -d -p $RPM_BUILD_ROOT%{manager_root} mv $RPM_BUILD_ROOT/%{python_sitelib}/* $RPM_BUILD_ROOT%{manager_root} # Do a little dance to get the egg-info in place mv $RPM_BUILD_ROOT%{manager_root}/*.egg-info $RPM_BUILD_ROOT/%{python_sitelib} mkdir -p $RPM_BUILD_ROOT/etc/{init,logrotate,nginx/conf,nginx/default}.d mkdir -p $RPM_BUILD_ROOT/etc/rabbitmq touch $RPM_BUILD_ROOT/etc/nginx/conf.d/chroma-manager.conf mkdir -p $RPM_BUILD_ROOT/etc/rabbitmq cp %{SOURCE16} $RPM_BUILD_ROOT/etc/nginx/default.d/iml-manager-redirect.conf cp %{SOURCE17} $RPM_BUILD_ROOT/etc/rabbitmq/rabbitmq-env.conf cp %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/chroma-host-discover mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 install %{SOURCE3}.gz $RPM_BUILD_ROOT%{_mandir}/man1 install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/chroma-manager mkdir -p $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/ install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_unitdir}/ mkdir -p $RPM_BUILD_ROOT/var/log/chroma # only include modules in the main package for manager_file in $(find -L $RPM_BUILD_ROOT%{manager_root}/ -name "*.py"); do install_file=${manager_file/$RPM_BUILD_ROOT\///} echo "${install_file%.py*}.py*" >> manager.files done # only include modules in the cli package for cli_file in $(find -L $RPM_BUILD_ROOT%{manager_root}/chroma_cli/ -name "*.py"); do install_file=${cli_file/$RPM_BUILD_ROOT\///} echo "${install_file%.py*}.py*" >> cli.files done # This is fugly, but it's cleaner than moving things around to get our # modules in the standard path. entry_scripts="/usr/bin/chroma-config /usr/bin/chroma" for script in $entry_scripts; do ed $RPM_BUILD_ROOT$script <