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
19 URL: https://github.com/gpocentek/python-gitlab
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel
24 BuildRequires: python-setuptools
25 BuildRequires: sphinx-pdg
28 BuildRequires: python3-devel
29 BuildRequires: python3-setuptools
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Interact with GitLab API
37 %package -n python3-gitlab
38 Summary: Interact with GitLab API
39 Group: Libraries/Python
41 %description -n python3-gitlab
42 Interact with GitLab API
47 # Remove bundled egg-info
48 %{__rm} -r %{module}.egg-info
52 %py_build %{?with_tests:test}
55 sphinx-build-2 docs html
56 %{__rm} -r html/.{doctrees,buildinfo}
61 %py3_build %{?with_tests:test}
64 sphinx-build-3 docs html
65 %{__rm} -r html/.{doctrees,buildinfo}
70 rm -rf $RPM_BUILD_ROOT
74 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-2
79 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-3
82 install -d $RPM_BUILD_ROOT%{_sysconfdir}
83 touch $RPM_BUILD_ROOT%{_sysconfdir}/python-gitlab.cfg
85 ln -s gitlab-2 $RPM_BUILD_ROOT%{_bindir}/gitlab
88 rm -rf $RPM_BUILD_ROOT
92 %defattr(644,root,root,755)
94 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
95 %attr(755,root,root) %{_bindir}/gitlab-2
96 %attr(755,root,root) %{_bindir}/gitlab
97 %{py_sitescriptdir}/%{module}
98 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
102 %files -n python3-gitlab
103 %defattr(644,root,root,755)
105 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
106 %attr(755,root,root) %{_bindir}/gitlab-3
107 %{py3_sitescriptdir}/%{module}
108 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info