-
Notifications
You must be signed in to change notification settings - Fork 6
/
example-ui.spec
95 lines (73 loc) · 2.44 KB
/
example-ui.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global pypi_name example-dashboard
%global mod_name example_dashboard
# tests are disabled by default
%bcond_with tests
Name: openstack-example-ui
Version: XXX
Release: XXX
Summary: The UI component for the OpenStack example service
License: ASL 2.0
URL: https://github.com/openstack/%{pypi_name}
Source0: http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-pbr
BuildRequires: python-sphinx
BuildRequires: python-oslo-sphinx
BuildRequires: git
# Required to compile translation files
BuildRequires: python-django
# openstack-dashboard is probably required for running tests
# if your project uses own tests, remove this, otherwise uncomment.
# BuildRequires: openstack-dashboard
BuildRequires: gettext
Requires: openstack-dashboard
Requires: python-pbr
%description
openstack-example-ui is a dashboard for example service
%package doc
Summary: Documentation for example dashboard
%description doc
Documentation files for example dashboard
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Let RPM handle the dependencies
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
%build
# build
%py2_build
# Generate i18n files
pushd build/lib/%{mod_name}
django-admin compilemessages
popd
# Build html documentation
%{__python2} setup.py build_sphinx
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
%py2_install
# Move config to horizon
mkdir -p %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/local/enabled/
# replace XXX_example for a expression that match files for each specific dashboard
install -p -D -m 640 %{mod_name}/enabled/_XXX_example* %{buildroot}%{_datadir}/openstack-dashboard/openstack_dashboard/local/enabled/
# Remove .po and .pot (they are not required)
rm -f %{buildroot}%{python2_sitelib}/%{mod_name}/locale/*/LC_*/django*.po
rm -f %{buildroot}%{python2_sitelib}/%{mod_name}/locale/*pot
# Find language files
%find_lang django --all-name
%check
%if %{?with_tests}
%{__python2} setup.py test
%endif
%files -f django.lang
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{mod_name}
%{python2_sitelib}/*.egg-info
%{_datadir}/openstack-dashboard/openstack_dashboard/local/enabled/_XXX_example*
%files doc
%doc html
%license LICENSE
%changelog