summaryrefslogtreecommitdiffstats
path: root/python-jenkins.spec
blob: 0eb64047ec5ba76ea55b4bae51e06ea86927e67a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
%if 0%{?fedora} > 12
%global with_python3 1
%endif

Name:           python-jenkins
Version:        0.4.12
Release:        1%{?dist}
Summary:        Python bindings for the remote Jenkins API

Group:          Development/Libraries
License:        BSD
URL:            http://python-jenkins.readthedocs.org/en/latest
Source0:        https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
Patch0:         %{name}-0.4.8-six-1.3.patch

BuildArch:      noarch

%description
Python Jenkins is a library for the remote API of the Jenkins continuous
integration server. It is useful for creating and managing jobs as well as
build nodes.

%package -n python2-jenkins
Summary:        Python bindings for the remote Jenkins API

BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python2-multi_key_dict
BuildRequires:  python-mock
BuildRequires:  python-nose
BuildRequires:  python-pbr
BuildRequires:  python-six
BuildRequires:  python-sphinx
BuildRequires:  python-testscenarios
Requires:       python-pbr
Requires:       python-six
Requires:       python2-multi_key_dict

%{?python_provide:%python_provide python2-jenkins}

%description -n python2-jenkins
Python Jenkins is a library for the remote API of the Jenkins continuous
integration server. It is useful for creating and managing jobs as well as
build nodes.


%if 0%{?with_python3}
%package -n python3-jenkins
Summary:        Python bindings for the remote Jenkins API

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-multi_key_dict
BuildRequires:  python3-mock
BuildRequires:  python3-nose
BuildRequires:  python3-pbr
BuildRequires:  python3-six
BuildRequires:  python3-sphinx
BuildRequires:  python3-testscenarios
Requires:       python3-pbr
Requires:       python3-six
Requires:       python3-multi_key_dict

%{?python_provide:%python_provide python2-jenkins}

%description -n python3-jenkins
Python Jenkins is a library for the remote API of the Jenkins continuous
integration server. It is useful for creating and managing jobs as well as
build nodes.
%endif

%prep
%setup -qc

mv %{name}-%{version} python2
pushd python2
%if 0%{?epel}
%patch0 -p1
%endif

# Remove env from __init__.py
sed -i '/^#!\/usr\/bin\/env python$/d' jenkins/__init__.py

# Loosen python-pbr requirement
sed -i 's/pbr>=0.8.2/pbr>=0.8.0/' requirements.txt

# copy common doc files to top dir
cp -pr AUTHORS ChangeLog COPYING README.rst ../
popd

%if 0%{?with_python3}
cp -a python2 python3
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif

find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'

%build
export PBR_VERSION=%{version}

pushd python2
%{__python2} setup.py build
make -C doc html man
rm -f doc/build/html/.buildinfo
popd

%if 0%{?with_python3}
pushd python3
%{__python3} setup.py build
SPHINXBUILD=sphinx-build-%{python3_version} make -C doc html man
rm -f doc/build/html/.buildinfo
popd
%endif

%install
pushd python2
%{__python2} setup.py install --skip-build --root %{buildroot}
install -p -D -m0644 doc/build/man/pythonjenkins.1 %{buildroot}%{_mandir}/man1/pythonjenkins.1
popd

%if 0%{?with_python3}
pushd python3
%{__python3} setup.py install --skip-build --root %{buildroot}
install -p -D -m0644 doc/build/man/pythonjenkins.1 %{buildroot}%{_mandir}/man1/python3jenkins.1
popd
%endif

%check
pushd python2
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w tests ||:
popd

%if 0%{?with_python3}
pushd python3
PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w tests ||:
popd
%endif

%files -n python2-jenkins
%doc AUTHORS ChangeLog README.rst python2/doc/build/html
%license COPYING
%{python2_sitelib}/jenkins
%{python2_sitelib}/python_jenkins-%{version}-py?.?.egg-info
%{_mandir}/man1/pythonjenkins.1.gz

%if 0%{?with_python3}
%files -n python3-jenkins
%doc AUTHORS ChangeLog README.rst python3/doc/build/html
%license COPYING
%{python3_sitelib}/jenkins
%{python3_sitelib}/python_jenkins-%{version}-py?.?.egg-info
%{_mandir}/man1/python3jenkins.1.gz
%endif

%changelog
* Tue Jun  7 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 0.4.12-1
- Upstream 0.4.12
- Update to python guidelines

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.8-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Tue Aug 25 2015 Scott K Logan <logans@cottsay.net> - 0.4.8-1
- Update to 0.4.8

* Tue Jun 30 2015 Scott K Logan <logans@cottsay.net> - 0.4.7-1
- Update to 0.4.7

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Apr 12 2015 Scott K Logan <logans@cottsay.net> - 0.4.5-1
- Update to 0.4.5
- Update to latest python packaging guidelines

* Wed Nov 12 2014 Scott K Logan <logans@cottsay.net> - 0.4.1-1
- Update to 0.4.1 (RHBZ #1162743)
- Switch to PyPI upstream
- Add python3 package

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Feb 21 2014 Scott K Logan <logans@cottsay.net> - 0.2.1-1
- Initial package