]>
Commit | Line | Data |
---|---|---|
2d941b5c ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module jira | |
7 | %define pypi_name jira | |
8 | %define egg_name jira | |
9 | Summary: A library to ease use of the JIRA 5 REST APIs | |
10 | Name: python-%{pypi_name} | |
11 | Version: 1.0.7 | |
ed506633 | 12 | Release: 9 |
2d941b5c ER |
13 | License: BSD |
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 | |
21 | %if %{with python3} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-devel | |
27 | BuildRequires: python3-setuptools | |
28 | %endif | |
5257789e | 29 | Requires: python-ipython |
2d941b5c | 30 | Requires: python-magic |
2d941b5c ER |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | A library to ease use of the JIRA 5 REST APIs. | |
36 | ||
37 | %package -n python3-%{pypi_name} | |
38 | Summary: %{summary} | |
39 | Group: Libraries/Python | |
5257789e | 40 | Requires: python3-ipython |
2d941b5c | 41 | Requires: python3-magic |
2d941b5c ER |
42 | |
43 | %description -n python3-%{pypi_name} | |
44 | A library to ease use of the JIRA 5 REST APIs. | |
45 | ||
46 | %prep | |
47 | %setup -q -n %{pypi_name}-%{version} | |
48 | ||
49 | sed -i 's/tools.jirashell/jira.tools.jirashell/g' setup.py | |
50 | sed -i "s/'ordereddict'//" setup.py | |
51 | ||
52 | # Remove bundled egg-info in case it exists | |
53 | rm -r %{pypi_name}.egg-info | |
54 | ||
55 | # Remove shebang in the non-executable files | |
56 | sed -i -e '/^#!\//, 1d' %{module}/{client,config,jirashell}.py | |
57 | ||
58 | %build | |
59 | %if %{with python2} | |
60 | %py_build | |
61 | %endif | |
62 | %if %{with python3} | |
63 | %py3_build | |
64 | %endif | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | %if %{with python2} | |
69 | %py_install | |
70 | %py_postclean | |
71 | mv $RPM_BUILD_ROOT%{_bindir}/jirashell{,-%{py_ver}} | |
72 | ln -sf jirashell-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/jirashell-2 | |
73 | %endif | |
74 | ||
75 | %if %{with python3} | |
76 | %py3_install | |
77 | mv $RPM_BUILD_ROOT%{_bindir}/jirashell{,-%{py3_ver}} | |
78 | ln -s jirashell-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/jirashell-3 | |
79 | %endif | |
80 | ||
81 | %if %{with python2} | |
82 | ln -sf jirashell-2 $RPM_BUILD_ROOT%{_bindir}/jirashell | |
83 | %endif | |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc PKG-INFO LICENSE | |
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}* | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
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}* | |
107 | %endif |