Files
rpm-packaging/openstack/freezer-web-ui/freezer-web-ui.spec.j2
Colleen Murphy bee43edca5 Don't exclude python bytecode files in dashboards
If these files are excluded from the rpm install then modified bytecode
files will remamin on disk on uninstall and cause unexpected behavior in
horizon. Remove these from the exclude list.

Change-Id: Ib03f38285c3de377d4c71de4ed7feb1bfa919a35
2019-01-31 21:05:01 +01:00

71 lines
2.2 KiB
Django/Jinja

{% set pypi_name = 'freezer-web-ui' %}
{% set source = fetch_source('https://tarballs.openstack.org/freezer-web-ui/freezer-web-ui-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: The Freezer Web UI
License: {{ license('Apache-2.0') }}
Group: Development/Languages/Python
URL: https://launchpad.net/freezer
Source0: {{ source|basename }}
BuildRequires: fdupes
BuildRequires: {{ py2pkg('horizon') }}
BuildRequires: openstack-macros
BuildRequires: {{ py2pkg('python-freezerclient') }}
Requires: {{ py2pkg('horizon-plugin-freezer-ui') }} = %{version}
BuildArch: noarch
%description
The Freezer UI Horizon plugin adds Freezer panel to the OpenStack dashboard.
%package -n {{ py2pkg('horizon-plugin-freezer-ui') }}
Summary: The Freezer Web UI - Python module
Requires: {{ py2pkg('Django') }}
Requires: {{ py2pkg('python-freezerclient') }}
%description -n {{ py2pkg('horizon-plugin-freezer-ui') }}
The Freezer UI Horizon plugin adds Freezer panel to the OpenStack dashboard.
%prep
%autosetup -n {{ pypi_name }}-{{upstream_version}}
%py_req_cleanup
%build
%py2_build
%install
%py2_install
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
cp -a disaster_recovery/enabled/_50*.py %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
%fdupes %{buildroot}%{python2_sitelib}
%fdupes %{buildroot}%{http_dashboard_dir}
%post
su %{apache_user} -s /bin/sh -c "python %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"
%postun
su %{apache_user} -s /bin/sh -c "python %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"
%files
%doc ChangeLog README.rst
%license LICENSE
%{http_dashboard_dir}/openstack_dashboard/enabled/*.py*
%files -n {{ py2pkg('horizon-plugin-freezer-ui') }}
%doc README.rst
%license LICENSE
%{python2_sitelib}/disaster_recovery
%{python2_sitelib}/freezer_web_ui-*.egg-info
%changelog