3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
9 Summary: A library to ease use of the JIRA 5 REST APIs
10 Name: python-%{pypi_name}
14 Group: Libraries/Python
15 Source0: https://files.pythonhosted.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
16 # Source0-md5: cb1d3f1e1b7a388932ad5d961bf2c56d
17 URL: https://pypi.io/project/jira
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: sed >= 4.0
22 BuildRequires: python-devel
23 BuildRequires: python-setuptools
26 BuildRequires: python3-devel
27 BuildRequires: python3-setuptools
29 Requires: python-ipython
30 Requires: python-magic
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 A library to ease use of the JIRA 5 REST APIs.
37 %package -n python3-%{pypi_name}
39 Group: Libraries/Python
40 Requires: python3-ipython
41 Requires: python3-magic
43 %description -n python3-%{pypi_name}
44 A library to ease use of the JIRA 5 REST APIs.
47 %setup -q -n %{pypi_name}-%{version}
49 sed -i 's/tools.jirashell/jira.tools.jirashell/g' setup.py
50 sed -i "s/'ordereddict'//" setup.py
52 # Remove bundled egg-info in case it exists
53 rm -r %{pypi_name}.egg-info
55 # Remove shebang in the non-executable files
56 sed -i -e '/^#!\//, 1d' %{module}/{client,config,jirashell}.py
67 rm -rf $RPM_BUILD_ROOT
71 mv $RPM_BUILD_ROOT%{_bindir}/jirashell{,-%{py_ver}}
72 ln -sf jirashell-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/jirashell-2
77 mv $RPM_BUILD_ROOT%{_bindir}/jirashell{,-%{py3_ver}}
78 ln -s jirashell-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/jirashell-3
82 ln -sf jirashell-2 $RPM_BUILD_ROOT%{_bindir}/jirashell
86 rm -rf $RPM_BUILD_ROOT
90 %defattr(644,root,root,755)
92 %attr(755,root,root) %{_bindir}/jirashell
93 %attr(755,root,root) %{_bindir}/jirashell-2
94 %attr(755,root,root) %{_bindir}/jirashell-%{py_ver}
95 %{py_sitescriptdir}/%{module}/
96 %{py_sitescriptdir}/%{egg_name}-%{version}*
100 %files -n python3-%{pypi_name}
101 %defattr(644,root,root,755)
102 %doc PKG-INFO LICENSE
103 %attr(755,root,root) %{_bindir}/jirashell-3
104 %attr(755,root,root) %{_bindir}/jirashell-%{py3_ver}
105 %{py3_sitescriptdir}/%{module}/
106 %{py3_sitescriptdir}/%{egg_name}-%{version}*