/
openstack-tripleo-heat-templates.spec
125 lines (110 loc) · 3.92 KB
/
openstack-tripleo-heat-templates.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Macros for py2/py3 compatibility
%if 0%{?fedora} || 0%{?rhel} > 7
%global pyver 3
%else
%global pyver 2
%endif
%global pyver_bin python%{pyver}
%global pyver_sitelib %python%{pyver}_sitelib
%global pyver_install %py%{pyver}_install
%global pyver_build %py%{pyver}_build
# End of macros for py2/py3 compatibility
# guard for package OSP does not support
%global rhosp 0
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Name: openstack-tripleo-heat-templates
Summary: Heat templates for TripleO
Version: XXX
Release: XXX
License: ASL 2.0
Group: System Environment/Base
URL: https://wiki.openstack.org/wiki/TripleO
Source0: https://tarballs.openstack.org/tripleo-heat-templates/tripleo-heat-templates-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: python%{pyver}-devel
BuildRequires: python%{pyver}-setuptools
BuildRequires: python%{pyver}-pbr
%if %{pyver} == 2
BuildRequires: python-d2to1
%else
BuildRequires: python%{pyver}-d2to1
%endif
Requires: ansible-pacemaker
Requires: ansible-tripleo-ipsec
Requires: ansible-role-atos-hsm
Requires: ansible-role-container-registry
Requires: ansible-role-chrony
Requires: ansible-role-thales-hsm
Requires: python%{pyver}-paunch
Requires: python%{pyver}-jinja2
Requires: python%{pyver}-six
Requires: openstack-tripleo-common >= 7.1.0
Requires: tripleo-ansible
%if %{pyver} == 2
Requires: PyYAML
%else
Requires: python%{pyver}-PyYAML
%endif
%if 0%{rhosp} == 1
Requires: ansible-role-redhat-subscription
%endif
%description
OpenStack TripleO Heat Templates is a collection of templates and tools for
building Heat Templates to do deployments of OpenStack.
%prep
%setup -q -n tripleo-heat-templates-%{upstream_version}
# Temporary until https://review.opendev.org/#/c/666220/ merges
sed -i "/\/dev\/log:\/dev\/log/d" deployment/ironic/ironic-pxe-container-puppet.yaml
sed -i '/\/etc\/puppet:\/etc\/puppet:ro/d' deployment/neutron/neutron-ovs-agent-container-puppet.yaml
# Replace "env python" shebag to the correct python executable for the system
# if we don't do that brp-mangle-shebangs will change it to python2
for python_script in $(grep "/usr/bin/env python" . -rl)
do
sed -i "s#/usr/bin/env python.*#/usr/bin/%{pyver_bin}#g" $python_script
done
%build
%{pyver_build}
%install
%{pyver_install}
install -d -m 755 %{buildroot}/%{_datadir}/%{name}
cp -ar *.yaml %{buildroot}/%{_datadir}/%{name}
cp -ar puppet %{buildroot}/%{_datadir}/%{name}
cp -ar common %{buildroot}/%{_datadir}/%{name}
if [ -d docker ] ; then
cp -ar docker %{buildroot}/%{_datadir}/%{name}
fi
cp -ar deployment %{buildroot}/%{_datadir}/%{name}
# docker_config_scripts will be removed in Stein
if [ -d docker_config_scripts ]; then
cp -ar docker_config_scripts %{buildroot}/%{_datadir}/%{name}
fi
if [ -d container_config_scripts ]; then
cp -ar container_config_scripts %{buildroot}/%{_datadir}/%{name}
fi
cp -ar firstboot %{buildroot}/%{_datadir}/%{name}
cp -ar extraconfig %{buildroot}/%{_datadir}/%{name}
cp -ar environments %{buildroot}/%{_datadir}/%{name}
cp -ar network %{buildroot}/%{_datadir}/%{name}
if [ -d networks ]; then
cp -ar networks %{buildroot}/%{_datadir}/%{name}
fi
cp -ar validation-scripts %{buildroot}/%{_datadir}/%{name}
cp -ar deployed-server %{buildroot}/%{_datadir}/%{name}
cp -ar ci %{buildroot}/%{_datadir}/%{name}
cp -ar plan-samples %{buildroot}/%{_datadir}/%{name}
cp -ar roles %{buildroot}/%{_datadir}/%{name}
cp -ar scripts %{buildroot}/%{_datadir}/%{name}
cp -ar tools %{buildroot}/%{_datadir}/%{name}
if [ -d examples ]; then
rm -rf examples
fi
if [ -d %{buildroot}/%{pyver_sitelib}/tripleo_heat_merge ]; then
rm -rf %{buildroot}/%{pyver_sitelib}/tripleo_heat_merge
rm -f %{buildroot}/%{_bindir}/tripleo-heat-merge
fi
%files
%doc README*
%license LICENSE
%{pyver_sitelib}/tripleo_heat_templates-*.egg-info
%{_datadir}/%{name}
%changelog