rpm-packaging/openstack/heat-dashboard/heat-dashboard.spec.j2

108 lines
3.9 KiB
Django/Jinja

{% set pypi_name = 'heat-dashboard' %}
{% set source = fetch_source("https://tarballs.openstack.org/heat-dashboard/heat-dashboard-master.tar.gz") %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}
%if 0%{?rhel} || 0%{?fedora}
%global http_dashboard_dir %{_datarootdir}/openstack-dashboard
%else
%global http_dashboard_dir /srv/www/openstack-dashboard
%endif
Name: {{ py2name() }}
Version: {{ py2rpmversion() }}
Release: {{ py2rpmrelease() }}
Summary: Horizon plugin for heat
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://docs.openstack.org/{{ pypi_name }}
Source0: {{ source|basename }}
BuildRequires: fdupes
BuildRequires: {{ py3('horizon') }}
BuildRequires: openstack-macros
BuildRequires: {{ py3('XStatic-Angular-UUID') }}
BuildRequires: {{ py3('XStatic-Angular-Vis') }}
BuildRequires: {{ py3('XStatic-FileSaver') }}
BuildRequires: {{ py3('XStatic-JS-Yaml') }}
BuildRequires: {{ py3('XStatic-Json2yaml') }}
BuildRequires: {{ py3('python-heatclient') }}
BuildRequires: {{ py3('pbr') }}
Requires: {{ py2pkg('horizon-plugin-heat-ui') }} = %{version}
BuildArch: noarch
%description
Heat dashboard is a horizon plugin for Heat.
%package -n {{ py2pkg('horizon-plugin-heat-ui') }}
Summary: Horizon plugin for heat - Python Module
Requires: {{ py3('XStatic-Angular-UUID') }}
Requires: {{ py3('XStatic-Angular-Vis') }}
Requires: {{ py3('XStatic-FileSaver') }}
Requires: {{ py3('XStatic-JS-Yaml') }}
Requires: {{ py3('XStatic-Json2yaml') }}
Requires: {{ py3('python-heatclient') }}
Requires: {{ py3('pbr') }}
%description -n {{ py2pkg('horizon-plugin-heat-ui') }}
OpenStack Heat plugin for Horizon.
This package contains the core Python module of the heat-ui.
%package test
Summary: Heat Management Plugin for Horizon - Testsuite
Requires: {{ py3('mock') }}
Requires: {{ py3('testtools') }}
%description test
OpenStack Heat management plugin for Horizon.
It is used to verify the functionality of the Heat UI Plugin.
%prep
%autosetup -p1 -n {{ pypi_name }}-{{upstream_version}}
%py_req_cleanup
%build
%py3_build
%check
rm -r heat_dashboard/test/integration
PYTHONPATH=%{http_dashboard_dir} python3 manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings --exclude-tag=integration
%install
%py3_install
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
cp -a heat_dashboard/enabled/*.py %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/
cp -a heat_dashboard/local_settings.d/_1699_orchestration_settings.py \
%{buildroot}%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/_1699_orchestration_settings.py
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/conf/
cp -a heat_dashboard/conf/heat_policy.yaml %{buildroot}%{http_dashboard_dir}/openstack_dashboard/conf/
%fdupes %{buildroot}%{python3_sitelib}
%fdupes %{buildroot}%{http_dashboard_dir}
%post
su %{apache_user} -s /bin/sh -c "python3 %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"
%postun
su %{apache_user} -s /bin/sh -c "python3 %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"
%files
%doc ChangeLog CONTRIBUTING.rst README.rst
%license LICENSE
%{http_dashboard_dir}/openstack_dashboard/enabled/*.py*
%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/_1699_orchestration_settings.py*
%{http_dashboard_dir}/openstack_dashboard/conf/heat_policy.yaml
%files -n {{ py2pkg('horizon-plugin-heat-ui') }}
%doc README.rst
%license LICENSE
%{python3_sitelib}/heat_dashboard/
%{python3_sitelib}/heat_dashboard-*.egg-info
%exclude %{python3_sitelib}/heat_dashboard/test*
%files test
%{python3_sitelib}/heat_dashboard/test*
%changelog