3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module
9 %define egg_name python_gitlab
10 %define pypi_name python-gitlab
11 Summary: Interact with GitLab API
16 Group: Libraries/Python
17 Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
18 # Source0-md5: e0421d930718021e7d796d74d2ad7194
20 URL: https://github.com/gpocentek/python-gitlab
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python-devel
25 BuildRequires: python-setuptools
26 BuildRequires: sphinx-pdg
29 BuildRequires: python3-devel
30 BuildRequires: python3-setuptools
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Interact with GitLab API
38 %package -n python3-gitlab
39 Summary: Interact with GitLab API
40 Group: Libraries/Python
42 %description -n python3-gitlab
43 Interact with GitLab API
48 # Remove bundled egg-info
49 %{__rm} -r %{egg_name}.egg-info
53 %py_build %{?with_tests:test}
56 sphinx-build-2 docs html
57 %{__rm} -r html/.{doctrees,buildinfo}
62 %py3_build %{?with_tests:test}
65 sphinx-build-3 docs html
66 %{__rm} -r html/.{doctrees,buildinfo}
71 rm -rf $RPM_BUILD_ROOT
75 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-2
80 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-3
83 install -d $RPM_BUILD_ROOT%{_sysconfdir}
84 cp -p %{_sourcedir}/config.cfg $RPM_BUILD_ROOT%{_sysconfdir}/python-gitlab.cfg
86 ln -s gitlab-2 $RPM_BUILD_ROOT%{_bindir}/gitlab
89 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
95 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
96 %attr(755,root,root) %{_bindir}/gitlab-2
97 %attr(755,root,root) %{_bindir}/gitlab
98 %{py_sitescriptdir}/%{module}
99 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
103 %files -n python3-gitlab
104 %defattr(644,root,root,755)
106 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
107 %attr(755,root,root) %{_bindir}/gitlab-3
108 %{py3_sitescriptdir}/%{module}
109 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info