Seed code for ironicclient
[ta/ironicclient.git] / python-ironicclient.spec
1 %{!?upstream_version: %global upstream_version %{version}%{?milestone}}
2
3 %if 0%{?fedora}
4 %global with_python3 1
5 %endif
6
7 %global sname ironicclient
8
9 %global common_desc A python and command line client library for Ironic
10
11 Name:           python-ironicclient
12 Version:        2.2.1
13 Release:        1%{?dist}
14 Summary:        Python client for Ironic
15
16 License:        ASL 2.0
17 URL:            https://pypi.python.org/pypi/python-ironicclient
18 Source0:        https://tarballs.openstack.org/python-ironicclient/python-ironicclient-%{version}%{?milestone}.tar.gz
19 Patch0:         nokia/patches/0001-floppy-changes.patch
20 BuildArch:      noarch
21
22
23 %description
24 %{common_desc}
25
26
27 %package -n python2-%{sname}
28 Summary:        Python client for Ironic
29
30 BuildRequires:  python2-devel
31 BuildRequires:  python2-pbr >= 2.0.0
32 BuildRequires:  python2-setuptools
33
34 Requires:       python2-appdirs >= 1.3.0
35 Requires:       python2-keystoneauth1 >= 3.3.0
36 Requires:       python2-pbr >= 2.0.0
37 Requires:       python2-prettytable
38 Requires:       python2-six >= 1.10.0
39 Requires:       python2-osc-lib >= 1.8.0
40 Requires:       python2-oslo-i18n >= 3.15.3
41 Requires:       python2-oslo-serialization >= 2.18.0
42 Requires:       python2-oslo-utils >= 3.33.0
43 Requires:       python2-requests
44 %if 0%{?fedora} > 0
45 Requires:       python2-dogpile-cache >= 0.6.2
46 Requires:       python2-jsonschema
47 Requires:       python2-pyyaml
48 %else
49 Requires:       python-dogpile-cache >= 0.6.2
50 Requires:       python-jsonschema
51 Requires:       PyYAML
52 %endif
53
54 %{?python_provide:%python_provide python2-%{sname}}
55
56 %description -n python2-%{sname}
57 %{common_desc}
58
59
60 %if 0%{?with_python3}
61 %package -n python3-%{sname}
62 Summary:        Python client for Ironic
63
64 BuildRequires:  python3-devel
65 BuildRequires:  python3-pbr >= 2.0.0
66 BuildRequires:  python3-setuptools
67
68 Requires:       python3-appdirs >= 1.3.0
69 Requires:       python3-dogpile-cache >= 0.6.2
70 Requires:       python3-jsonschema
71 Requires:       python3-keystoneauth1 >= 3.3.0
72 Requires:       python3-pbr >= 2.0.0
73 Requires:       python3-prettytable
74 Requires:       python3-six >= 1.10.0
75 Requires:       python3-osc-lib >= 1.8.0
76 Requires:       python3-oslo-i18n >= 3.15.3
77 Requires:       python3-oslo-serialization >= 2.18.0
78 Requires:       python3-oslo-utils >= 3.33.0
79 Requires:       python3-requests
80 Requires:       python3-PyYAML
81
82 %{?python_provide:%python_provide python3-%{sname}}
83
84 %description -n python3-%{sname}
85 %{common_desc}
86 %endif
87
88 %prep
89 %setup -q -n %{name}-%{upstream_version}
90
91 %patch0 -p1
92 # Remove the requirements file so that pbr hooks don't add it
93 # to distutils requires_dist config
94 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
95
96 %build
97 %py2_build
98 %if 0%{?with_python3}
99 %py3_build
100 %endif
101
102
103 %install
104 %if 0%{?with_python3}
105 %py3_install
106 mv %{buildroot}%{_bindir}/ironic %{buildroot}%{_bindir}/ironic-%{python3_version}
107 ln -s ./ironic-%{python3_version} %{buildroot}%{_bindir}/ironic-3
108 %endif
109
110 %py2_install
111 mv %{buildroot}%{_bindir}/ironic %{buildroot}%{_bindir}/ironic-%{python2_version}
112 ln -s ./ironic-%{python2_version} %{buildroot}%{_bindir}/ironic-2
113
114 ln -s ./ironic-2 %{buildroot}%{_bindir}/ironic
115
116
117 %files -n python2-%{sname}
118 %doc README.rst
119 %license LICENSE
120 %{_bindir}/ironic
121 %{_bindir}/ironic-2
122 %{_bindir}/ironic-%{python2_version}
123 %{python2_sitelib}/ironicclient*
124 %{python2_sitelib}/python_ironicclient*
125
126 %if 0%{?with_python3}
127 %files -n python3-%{sname}
128 %doc README.rst
129 %license LICENSE
130 %{_bindir}/ironic-3
131 %{_bindir}/ironic-%{python3_version}
132 %{python3_sitelib}/ironicclient*
133 %{python3_sitelib}/python_ironicclient*
134 %endif
135
136
137 %changelog
138 * Tue Jun 19 2018 RDO <dev@lists.rdoproject.org> 2.2.1-1
139 - Update to 2.2.1
140
141 * Sun Feb 11 2018 RDO <dev@lists.rdoproject.org> 2.2.0-1
142 - Update to 2.2.0
143