db2c678
%if 0%{?rhel} && 0%{?rhel} <= 6
db2c678
%{!?__python2: %global __python2 /usr/bin/python2}
db2c678
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
db2c678
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
db2c678
%{!?python2_version: %global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")}
db2c678
%endif
db2c678
Martin Milata c88893e
%if 0%{?rhel} && 0%{?rhel} <= 7
Martin Milata c88893e
%{!?py2_build: %global py2_build %{__python2} setup.py build}
Martin Milata c88893e
%{!?py2_install: %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot}}
Martin Milata c88893e
%endif
Martin Milata c88893e
db2c678
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8)
db2c678
%global with_python3 1
Martin Milata c88893e
%global binaries_py_version %{python3_version}
Martin Milata c88893e
%else
Martin Milata c88893e
%global binaries_py_version %{python2_version}
db2c678
%endif
db2c678
Clement Verna 589ccfa
%if (0%{?fedora} < 28)
Clement Verna 589ccfa
# tests are failling in f28 with new version of pytest
db2c678
# rhel/epel has no flexmock, pytest-capturelog
db2c678
%global with_check 1
db2c678
%endif
0d7d14c
Clement Verna 589ccfa
%global commit 0599f591ba6330fd2097e9b455676f75800ce0c9
0d7d14c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Clement Verna 589ccfa
0d7d14c
# set to 0 to create a normal release
Clement Verna 589ccfa
%global dev_release 0
Clement Verna 589ccfa
Clement Verna 589ccfa
%if 0%{?dev_release}
Clement Verna 589ccfa
%global postrelease dev
185d0df
%global release 2
Clement Verna 589ccfa
%else
0d7d14c
%global postrelease 0
Clement Verna 589ccfa
%global release 1
Clement Verna 589ccfa
%endif
0d7d14c
0d7d14c
%global osbs_obsolete_vr 0.14-2
0d7d14c
0d7d14c
Name:           osbs-client
Clement Verna 589ccfa
Version:        0.47
0d7d14c
%if "x%{postrelease}" != "x0"
0d7d14c
Release:        %{release}.%{postrelease}.git.%{shortcommit}%{?dist}
0d7d14c
%else
0d7d14c
Release:        %{release}%{?dist}
0d7d14c
%endif
0d7d14c
0d7d14c
Summary:        Python command line client for OpenShift Build Service
0d7d14c
Group:          Development/Tools
0d7d14c
License:        BSD
0d7d14c
URL:            https://github.com/projectatomic/osbs-client
0d7d14c
Source0:        https://github.com/projectatomic/osbs-client/archive/%{commit}/osbs-client-%{commit}.tar.gz
0d7d14c
0d7d14c
BuildArch:      noarch
0d7d14c
Martin Milata c88893e
%if 0%{?with_python3}
Martin Milata c88893e
Requires:       python3-osbs-client = %{version}-%{release}
2a0688a
Requires:       python3-requests
2a0688a
Requires:       python3-requests-kerberos
Martin Milata c88893e
%else
6e2a8c7
Requires:       python2-osbs-client = %{version}-%{release}
Martin Milata c88893e
%endif
0d7d14c
6e2a8c7
%if (0%{?fedora} && 0%{?fedora} <= 23) || (0%{?rhel} && 0%{?rhel} <= 7)
128b8ec
BuildRequires:  python2-devel
128b8ec
BuildRequires:  python-requests
128b8ec
BuildRequires:  python-requests-kerberos
128b8ec
BuildRequires:  python-setuptools
128b8ec
%else
0d7d14c
BuildRequires:  python2-devel
b6599fa
BuildRequires:  python2-requests
b6599fa
BuildRequires:  python2-requests-kerberos
6e2a8c7
BuildRequires:  python2-setuptools
128b8ec
%endif
128b8ec
db2c678
%if 0%{?with_check}
6e2a8c7
BuildRequires:  python2-pytest
6e2a8c7
BuildRequires:  python2-pytest-capturelog
6e2a8c7
BuildRequires:  python2-flexmock
6e2a8c7
BuildRequires:  python2-six
6e2a8c7
BuildRequires:  python2-dockerfile-parse
6e2a8c7
BuildRequires:  python2-requests
6e2a8c7
BuildRequires:  python2-requests-kerberos
Clement Verna 589ccfa
BuildRequires:  python2-pyyaml
db2c678
%endif # with_check
0d7d14c
0d7d14c
%if 0%{?with_python3}
0d7d14c
BuildRequires:  python3-devel
0d7d14c
BuildRequires:  python3-setuptools
db2c678
%if 0%{?with_check}
Martin Milata c88893e
BuildRequires:  python3-dateutil
db2c678
BuildRequires:  python3-pytest
db2c678
BuildRequires:  python3-pytest-capturelog
db2c678
BuildRequires:  python3-flexmock
db2c678
BuildRequires:  python3-six
db2c678
BuildRequires:  python3-dockerfile-parse
e3606f0
BuildRequires:  python3-pytest-runner
db15dff
BuildRequires:  python3-requests
db15dff
BuildRequires:  python3-requests-kerberos
Clement Verna 589ccfa
BuildRequires:  python3-PyYAML
db2c678
%endif # with_check
db2c678
%endif # with_python3
db2c678
0d7d14c
0d7d14c
Provides:       osbs = %{version}-%{release}
0d7d14c
Obsoletes:      osbs < %{osbs_obsolete_vr}
0d7d14c
0d7d14c
%description
0d7d14c
It is able to query OpenShift v3 for various stuff related to building images.
0d7d14c
It can initiate builds, list builds, get info about builds, get build logs...
0d7d14c
This package contains osbs command line client.
0d7d14c
d61b65f
%package -n python2-osbs-client
d61b65f
%{?python_provide:%python_provide python2-osbs-client}
0d7d14c
Summary:        Python 2 module for OpenShift Build Service
0d7d14c
Group:          Development/Tools
0d7d14c
License:        BSD
6e2a8c7
Requires:       python2-dockerfile-parse
6e2a8c7
Requires:       python2-setuptools
6e2a8c7
Requires:       python2-six
0d7d14c
Requires:       krb5-workstation
db2c678
%if 0%{?rhel} && 0%{?rhel} <= 6
db2c678
Requires:       python-argparse
db2c678
%endif
6e2a8c7
%if (0%{?fedora} && 0%{?fedora} <= 23) || (0%{?rhel} && 0%{?rhel} <= 7)
b6599fa
Requires:       python-requests
b6599fa
Requires:       python-requests-kerberos
db15dff
Requires:       python-six
b6599fa
%else
b6599fa
Requires:       python2-requests
b6599fa
Requires:       python2-requests-kerberos
db15dff
Requires:       python2-six
b6599fa
%endif
0d7d14c
0d7d14c
Provides:       python-osbs = %{version}-%{release}
0d7d14c
Obsoletes:      python-osbs < %{osbs_obsolete_vr}
Martin Milata c88893e
%{?python_provide:%python_provide python-osbs-client}
0d7d14c
d61b65f
%description -n python2-osbs-client
0d7d14c
It is able to query OpenShift v3 for various stuff related to building images.
0d7d14c
It can initiate builds, list builds, get info about builds, get build logs...
0d7d14c
This package contains osbs Python 2 bindings.
0d7d14c
0d7d14c
%if 0%{?with_python3}
0d7d14c
%package -n python3-osbs-client
0d7d14c
Summary:        Python 3 module for OpenShift Build Service
0d7d14c
Group:          Development/Tools
0d7d14c
License:        BSD
0d7d14c
Requires:       python3-dockerfile-parse
b6599fa
Requires:       python3-requests
b6599fa
Requires:       python3-requests-kerberos
db15dff
Requires:       python3-dateutil
db15dff
Requires:       python3-setuptools
db15dff
Requires:       python3-six
0d7d14c
Requires:       krb5-workstation
0d7d14c
0d7d14c
Provides:       python3-osbs = %{version}-%{release}
0d7d14c
Obsoletes:      python3-osbs < %{osbs_obsolete_vr}
Martin Milata c88893e
%{?python_provide:%python_provide python3-osbs-client}
0d7d14c
0d7d14c
%description -n python3-osbs-client
0d7d14c
It is able to query OpenShift v3 for various stuff related to building images.
0d7d14c
It can initiate builds, list builds, get info about builds, get build logs...
0d7d14c
This package contains osbs Python 3 bindings.
0d7d14c
%endif # with_python3
0d7d14c
0d7d14c
0d7d14c
%prep
0d7d14c
%setup -qn %{name}-%{commit}
0d7d14c
c599b2b
# Remove this test, it tries to hit httpbin.org which fails the build in koji
c599b2b
rm -f tests/test_http.py
c599b2b
0d7d14c
%build
Martin Milata c88893e
%py2_build
0d7d14c
0d7d14c
%if 0%{?with_python3}
Martin Milata c88893e
%py3_build
0d7d14c
%endif # with_python3
0d7d14c
0d7d14c
0d7d14c
%install
0d7d14c
%if 0%{?with_python3}
Martin Milata c88893e
%py3_install
Martin Milata c88893e
mv %{buildroot}%{_bindir}/osbs %{buildroot}%{_bindir}/osbs-%{python3_version}
Martin Milata c88893e
ln -s  %{_bindir}/osbs-%{python3_version} %{buildroot}%{_bindir}/osbs-3
0d7d14c
%endif # with_python3
0d7d14c
Martin Milata c88893e
%py2_install
Martin Milata c88893e
mv %{buildroot}%{_bindir}/osbs %{buildroot}%{_bindir}/osbs-%{python2_version}
Martin Milata c88893e
ln -s  %{_bindir}/osbs-%{python2_version} %{buildroot}%{_bindir}/osbs-2
Martin Milata c88893e
ln -s  %{_bindir}/osbs-%{binaries_py_version} %{buildroot}%{_bindir}/osbs
0d7d14c
db2c678
%if 0%{?with_check}
db2c678
%check
db2c678
%if 0%{?with_python3}
db2c678
LANG=en_US.utf8 py.test-%{python3_version} -vv tests
db2c678
%endif # with_python3
db2c678
db2c678
LANG=en_US.utf8 py.test-%{python2_version} -vv tests
db2c678
%endif # with_check
db2c678
db2c678
0d7d14c
%files
0d7d14c
%doc README.md
0d7d14c
%{_bindir}/osbs
0d7d14c
0d7d14c
d61b65f
%files -n python2-osbs-client
0d7d14c
%doc README.md
Martin Milata c88893e
%{!?_licensedir:%global license %doc}
0d7d14c
%license LICENSE
Martin Milata c88893e
%{_bindir}/osbs-%{python2_version}
Martin Milata c88893e
%{_bindir}/osbs-2
0d7d14c
%{python2_sitelib}/osbs*
0d7d14c
%dir %{_datadir}/osbs
0d7d14c
%{_datadir}/osbs/*.json
0d7d14c
0d7d14c
0d7d14c
%if 0%{?with_python3}
0d7d14c
%files -n python3-osbs-client
0d7d14c
%doc README.md
Martin Milata c88893e
%{!?_licensedir:%global license %doc}
0d7d14c
%license LICENSE
Martin Milata c88893e
%{_bindir}/osbs-%{python3_version}
Martin Milata c88893e
%{_bindir}/osbs-3
0d7d14c
%{python3_sitelib}/osbs*
0d7d14c
%dir %{_datadir}/osbs
0d7d14c
%{_datadir}/osbs/*.json
0d7d14c
%endif # with_python3
0d7d14c
0d7d14c
%changelog
6b4d05b
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.47-1
6b4d05b
- Rebuilt for Python 3.7
6b4d05b
185d0df
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.47-1
185d0df
- Rebuilt for Python 3.7
185d0df
Clement Verna 589ccfa
* Tue May 15 2018 Clement Verna <cverna@fedoraproject.org> - 0.47-1
Clement Verna 589ccfa
- new upstream release: 0.47
Clement Verna 589ccfa
6e2a8c7
* Thu Mar 01 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.45-3
6e2a8c7
- Update Python 2 dependency declarations to new packaging standards
6e2a8c7
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
6e2a8c7
43b0d46
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.45-2
43b0d46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
43b0d46
Clement Verna 48ad218
* Thu Jan 18 2018 Clement Verna <cverna@fedoraproject.org> - 0.45-1
Clement Verna 48ad218
- Update to latest upstream
Clement Verna 48ad218
db15dff
* Thu Aug 24 2017 Adam Miller <maxamillion@gmail.com> - 0.41-1
db15dff
- Update to latest upstream
db15dff
d61b65f
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.39.1-3
d61b65f
- Python 2 binary package renamed to python2-osbs-client
d61b65f
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
d61b65f
127386b
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.39.1-2
127386b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
127386b
1409097
* Fri Jun 09 2017 Adam Miller <maxamillion@fedoraproject.org> - 0.39.1-1
1409097
- Update to latest upstream
1409097
ef54038
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.33-5
ef54038
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ef54038
e8af578
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.33-4
e8af578
- Rebuild for Python 3.6
e8af578
f0b3403
* Thu Dec 15 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.33-3
f0b3403
- Update patch for site specific customizations to be in line with upstream
f0b3403
- Add cancel-build patch
f0b3403
fdacb5d
* Fri Dec 02 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.33-2
fdacb5d
- Patch for koji krb5
fdacb5d
- Patch for site specific customizations
fdacb5d
fdacb5d
* Tue Nov 29 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.33-1
fdacb5d
- Update to latest upstream
fdacb5d
83d7541
* Thu Oct 13 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.32-1
83d7541
- Update to latest upstream
83d7541
7b96867
* Thu Sep 22 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.31-3
7b96867
- Update python-requests patch to handle python3 bytestrings properly
7b96867
b6599fa
* Thu Sep 22 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.31-2
b6599fa
- Fix python3 requires
b6599fa
1aef047
* Thu Sep 22 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.31-1
1aef047
- Update to latest upstream
1aef047
128b8ec
* Thu Sep 22 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.30-3
128b8ec
- Handle new Requires/BuildRequires for epel/f23 and older as well as f24+
128b8ec
2a0688a
* Wed Sep 21 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.30-2
2a0688a
- Apply patch from puiterwijk to switch to python-requests from pycurl
2a0688a
67d4b9a
* Tue Sep 20 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.30-1
67d4b9a
- new upstream release: 0.30
67d4b9a
9550be8
* Tue Sep 06 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.29-1
9550be8
- new upstream release: 0.29
9550be8
ecc1eba
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.24-2
ecc1eba
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ecc1eba
Martin Milata ef185fe
* Mon May 23 2016 Martin Milata <mmilata@redhat.com> - 0.24-1
Martin Milata ef185fe
- new upstream release: 0.24
Martin Milata ef185fe
Martin Milata 146f7c7
* Wed May 11 2016 Martin Milata <mmilata@redhat.com> - 0.23-1
Martin Milata 146f7c7
- new upstream release: 0.23
Martin Milata 146f7c7
Martin Milata 8c7c0e9
* Mon Apr 25 2016 Martin Milata <mmilata@redhat.com> - 0.22-1
Martin Milata 8c7c0e9
- new upstream release: 0.22
Martin Milata 8c7c0e9
Martin Milata 8c7c0e9
* Wed Apr 20 2016 Martin Milata <mmilata@redhat.com> - 0.21-1
Martin Milata 8c7c0e9
- new upstream release: 0.21
Martin Milata 8c7c0e9
Martin Milata b2cd82d
* Mon Apr 11 2016 Martin Milata <mmilata@redhat.com> - 0.20-1
Martin Milata b2cd82d
- new upstream release: 0.20
Martin Milata b2cd82d
Martin Milata 73d021d
* Thu Apr 07 2016 Martin Milata <mmilata@redhat.com> - 0.19-1
Martin Milata 73d021d
- new upstream release: 0.19
Martin Milata 73d021d
Martin Milata 20dd8e4
* Thu Mar 10 2016 Martin Milata <mmilata@redhat.com> - 0.18-1
Martin Milata 20dd8e4
- new upstream release: 0.18
Martin Milata 20dd8e4
Martin Milata b959893
* Fri Feb 12 2016 Martin Milata <mmilata@redhat.com> - 0.17-2
Martin Milata b959893
- new upstream release: 0.17
Martin Milata b959893
6464460
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.16-2
6464460
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6464460
Martin Milata c88893e
* Thu Jan 21 2016 Martin Milata <mmilata@redhat.com> - 0.16-1
Martin Milata c88893e
- new upstream release: 0.16
Martin Milata c88893e
Martin Milata c88893e
* Fri Nov 20 2015 Jiri Popelka <jpopelka@redhat.com> - 0.15-4
Martin Milata c88893e
- use py_build & py_install macros
Martin Milata c88893e
- use python_provide macro
Martin Milata c88893e
- do not use py3dir
Martin Milata c88893e
- ship executables per packaging guidelines
Martin Milata c88893e
fa7f0f6
* Fri Nov 13 2015 Jiri Popelka <jpopelka@redhat.com> - 0.15-3
fa7f0f6
- rebuilt for Python3.5
fa7f0f6
db2c678
* Thu Nov 05 2015 Jiri Popelka <jpopelka@redhat.com> - 0.15-2
db2c678
- build for Python 3
db2c678
- %%check section
db2c678
0d7d14c
* Mon Oct 19 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.15-1
0d7d14c
- new upstream release: 0.15
0d7d14c
0d7d14c
* Thu Aug 06 2015 bkabrda <bkabrda@redhat.com> - 0.14-2
0d7d14c
- renamed to osbs-client
0d7d14c
0d7d14c
* Wed Jul 01 2015 Martin Milata <mmilata@redhat.com> - 0.14-1
0d7d14c
- new upstream release: 0.14
0d7d14c
0d7d14c
* Fri Jun 12 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.13.1-1
0d7d14c
- new fixup upstream release: 0.13.1
0d7d14c
0d7d14c
* Fri Jun 12 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.13-1
0d7d14c
- new upstream release: 0.13
0d7d14c
0d7d14c
* Wed Jun 10 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.12-1
0d7d14c
- new upstream release: 0.12
0d7d14c
0d7d14c
* Wed Jun 03 2015 Martin Milata <mmilata@redhat.com> - 0.11-1
0d7d14c
- new upstream release: 0.11
0d7d14c
0d7d14c
* Thu May 28 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.10-1
0d7d14c
- new upstream release: 0.10
0d7d14c
0d7d14c
* Thu May 28 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.9-1
0d7d14c
- new upstream release: 0.9
0d7d14c
0d7d14c
* Mon May 25 2015 Jiri Popelka <jpopelka@redhat.com> - 0.8-1
0d7d14c
- new upstream release: 0.8
0d7d14c
0d7d14c
* Fri May 22 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.7-1
0d7d14c
- new upstream release: 0.7
0d7d14c
0d7d14c
* Thu May 21 2015 Jiri Popelka <jpopelka@redhat.com> - 0.6-2
0d7d14c
- fix %%license handling
0d7d14c
0d7d14c
* Thu May 21 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.6-1
0d7d14c
- new upstream release: 0.6
0d7d14c
0d7d14c
* Tue May 19 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.5-1
0d7d14c
- new upstream release: 0.5
0d7d14c
0d7d14c
* Tue May 12 2015 Slavek Kabrda <bkabrda@redhat.com> - 0.4-2
0d7d14c
- Introduce python-osbs subpackage
0d7d14c
- move /usr/bin/osbs to /usr/bin/osbs2, /usr/bin/osbs is now a symlink
0d7d14c
- depend on python[3]-setuptools because of entrypoints usage
0d7d14c
0d7d14c
* Tue Apr 21 2015 Martin Milata <mmilata@redhat.com> - 0.4-1
0d7d14c
- new upstream release
0d7d14c
0d7d14c
* Wed Apr 15 2015 Martin Milata <mmilata@redhat.com> - 0.3-1
0d7d14c
- new upstream release
0d7d14c
0d7d14c
* Wed Apr 08 2015 Martin Milata <mmilata@redhat.com> - 0.2-2.c1216ba
0d7d14c
- update to c1216ba
0d7d14c
0d7d14c
* Tue Apr 07 2015 Tomas Tomecek <ttomecek@redhat.com> - 0.2-1
0d7d14c
- new upstream release
0d7d14c
0d7d14c
* Tue Mar 24 2015 Jiri Popelka <jpopelka@redhat.com> - 0.1-4
0d7d14c
- update to 758648c8
0d7d14c
0d7d14c
* Thu Mar 19 2015 Jiri Popelka <jpopelka@redhat.com> - 0.1-3
0d7d14c
- no need to require also python-requests
0d7d14c
0d7d14c
* Thu Mar 19 2015 Jiri Popelka <jpopelka@redhat.com> - 0.1-2
0d7d14c
- separate executable for python 3
0d7d14c
0d7d14c
* Wed Mar 18 2015 Jiri Popelka <jpopelka@redhat.com> - 0.1-1
0d7d14c
- initial spec