]> git.pld-linux.org Git - packages/python-gitlab.git/blame - python-gitlab.spec
add sample config
[packages/python-gitlab.git] / python-gitlab.spec
CommitLineData
20b1c3b0
ER
1#
2# Conditional build:
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
c0b85897 6%bcond_with python3 # CPython 3.x module
20b1c3b0
ER
7
8%define module gitlab
9%define egg_name python_gitlab
10%define pypi_name python-gitlab
11Summary: Interact with GitLab API
12Name: python-gitlab
13Version: 0.16
14Release: 1
15License: LGPLv3
16Group: Libraries/Python
17Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
18# Source0-md5: e0421d930718021e7d796d74d2ad7194
25586f60 19Source1: config.cfg
20b1c3b0
ER
20URL: https://github.com/gpocentek/python-gitlab
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.714
23%if %{with python2}
24BuildRequires: python-devel
25BuildRequires: python-setuptools
26BuildRequires: sphinx-pdg
27%endif
28%if %{with python3}
29BuildRequires: python3-devel
30BuildRequires: python3-setuptools
31%endif
32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36Interact with GitLab API
37
38%package -n python3-gitlab
39Summary: Interact with GitLab API
40Group: Libraries/Python
41
42%description -n python3-gitlab
43Interact with GitLab API
44
45%prep
46%setup -q
47
48# Remove bundled egg-info
49%{__rm} -r %{module}.egg-info
50
51%build
52%if %{with python2}
53%py_build %{?with_tests:test}
54
55%if %{with doc}
56sphinx-build-2 docs html
57%{__rm} -r html/.{doctrees,buildinfo}
58%endif
59%endif
60
61%if %{with python3}
62%py3_build %{?with_tests:test}
63
64%if %{with doc}
65sphinx-build-3 docs html
66%{__rm} -r html/.{doctrees,buildinfo}
67%endif
68%endif
69
70%install
71rm -rf $RPM_BUILD_ROOT
72%if %{with python2}
73%py_install
74%py_postclean
75mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-2
76%endif
77
78%if %{with python3}
79%py3_install
80mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-3
81%endif
82
c0b85897 83install -d $RPM_BUILD_ROOT%{_sysconfdir}
25586f60 84cp -p %{_sourcedir}/config.cfg $RPM_BUILD_ROOT%{_sysconfdir}/python-gitlab.cfg
c0b85897 85
ef3bd57d
ER
86ln -s gitlab-2 $RPM_BUILD_ROOT%{_bindir}/gitlab
87
20b1c3b0
ER
88%clean
89rm -rf $RPM_BUILD_ROOT
90
91%if %{with python2}
92%files
93%defattr(644,root,root,755)
94%doc README.rst
c0b85897 95%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
20b1c3b0 96%attr(755,root,root) %{_bindir}/gitlab-2
ef3bd57d 97%attr(755,root,root) %{_bindir}/gitlab
20b1c3b0
ER
98%{py_sitescriptdir}/%{module}
99%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
100%endif
101
102%if %{with python3}
103%files -n python3-gitlab
104%defattr(644,root,root,755)
105%doc README.rst
c0b85897 106%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg
20b1c3b0
ER
107%attr(755,root,root) %{_bindir}/gitlab-3
108%{py3_sitescriptdir}/%{module}
109%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
110%endif
This page took 0.091631 seconds and 4 git commands to generate.