]> git.pld-linux.org Git - packages/python-gitlab.git/blob - python-gitlab.spec
57ff72dd981a1430c8192d43eaf9db217f614d0b
[packages/python-gitlab.git] / python-gitlab.spec
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
6 %bcond_with     python3 # CPython 3.x module
7
8 %define         module          gitlab
9 %define         egg_name        python_gitlab
10 %define         pypi_name       python-gitlab
11 Summary:        Interact with GitLab API
12 Name:           python-gitlab
13 Version:        0.16
14 Release:        1
15 License:        LGPLv3
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
22 %if %{with python2}
23 BuildRequires:  python-devel
24 BuildRequires:  python-setuptools
25 BuildRequires:  sphinx-pdg
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-devel
29 BuildRequires:  python3-setuptools
30 %endif
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 Interact with GitLab API
36
37 %package -n python3-gitlab
38 Summary:        Interact with GitLab API
39 Group:          Libraries/Python
40
41 %description -n python3-gitlab
42 Interact with GitLab API
43
44 %prep
45 %setup -q
46
47 # Remove bundled egg-info
48 %{__rm} -r %{module}.egg-info
49
50 %build
51 %if %{with python2}
52 %py_build %{?with_tests:test}
53
54 %if %{with doc}
55 sphinx-build-2 docs html
56 %{__rm} -r html/.{doctrees,buildinfo}
57 %endif
58 %endif
59
60 %if %{with python3}
61 %py3_build %{?with_tests:test}
62
63 %if %{with doc}
64 sphinx-build-3 docs html
65 %{__rm} -r html/.{doctrees,buildinfo}
66 %endif
67 %endif
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 %if %{with python2}
72 %py_install
73 %py_postclean
74 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-2
75 %endif
76
77 %if %{with python3}
78 %py3_install
79 mv $RPM_BUILD_ROOT%{_bindir}/gitlab $RPM_BUILD_ROOT%{_bindir}/gitlab-3
80 %endif
81
82 install -d $RPM_BUILD_ROOT%{_sysconfdir}
83 touch $RPM_BUILD_ROOT%{_sysconfdir}/python-gitlab.cfg
84
85 ln -s gitlab-2 $RPM_BUILD_ROOT%{_bindir}/gitlab
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %if %{with python2}
91 %files
92 %defattr(644,root,root,755)
93 %doc README.rst
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
99 %endif
100
101 %if %{with python3}
102 %files -n python3-gitlab
103 %defattr(644,root,root,755)
104 %doc README.rst
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
109 %endif
This page took 0.088955 seconds and 2 git commands to generate.