python-pycurl/python-pycurl.spec

157 lines
5.0 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:15:24 -04:00
# PycURL checks that the actual libcurl version is not lower
# than the one used when PycURL was built during its initialization.
%global libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q'
%global curlver_h /usr/include/curl/curlver.h
%global libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0)
2021-02-02 14:29:51 +08:00
%global srcname pycurl
2019-09-30 11:15:24 -04:00
2021-02-02 14:29:51 +08:00
Name: python-%{srcname}
2023-01-19 12:03:13 +08:00
Version: 7.45.2
Release: 3
2019-09-30 11:15:24 -04:00
Summary: A Python interface to libcurl
2023-01-19 12:03:13 +08:00
License: LGPL-2.0+ or MIT
2019-09-30 11:15:24 -04:00
URL: http://pycurl.sourceforge.net/
2021-02-02 14:29:51 +08:00
Source0: %{pypi_source}
2019-09-30 11:15:24 -04:00
# drop link-time vs. run-time TLS backend check (#1446850)
Patch1: 0002-python-pycurl-7.45.2-disable-test_http_version_3.patch
2019-09-30 11:15:24 -04:00
BuildRequires: gcc libcurl-devel openssl-devel vsftpd
%description
PycURL is a Python interface to libcurl. PycURL can be used to fetch
objects identified by a URL from a Python program, similar to the
urllib Python module. PycURL is mature, very fast, and supports a lot
of features.
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
This package contains development files for %{name}
%package_help
%package -n python3-pycurl
Summary: Python interface to libcurl for Python 3
%{?python_provide:%python_provide python3-pycurl}
2021-12-29 20:59:04 +08:00
BuildRequires: python3-devel python3-bottle python3-pyflakes python3-pytest
2019-09-30 11:15:24 -04:00
Requires: libcurl >= %{libcurl_ver}
%description -n python3-pycurl
PycURL is a Python interface to libcurl. PycURL can be used to fetch
objects identified by a URL from a Python program, similar to the
urllib Python module. PycURL is mature, very fast, and supports a lot
of features.
This package is for Python3.
%prep
%autosetup -n pycurl-%{version} -p1
2020-08-04 17:34:16 +08:00
rm -f winbuild.py
sed -e 's| winbuild.py||' -i Makefile
2019-09-30 11:15:24 -04:00
# remove binaries packaged by upstream
rm -f tests/fake-curl/libcurl/*.so
# remove a failed test-case that relies on sftp://web.sourceforge.net being available
rm -f tests/ssh_key_cb_test.py
# remove a failed test-case
rm -f tests/seek_cb_test.py
# remove tests depending on the 'flaky' nose plug-in
grep '^import flaky' -r tests | cut -d: -f1 | xargs rm -fv
# drop options that are not supported
sed -e 's/ --show-skipped//' \
-e 's/ --with-flaky//' \
-i tests/run.sh
%build
%py3_build -- --with-openssl
%install
export PYCURL_SSL_LIBRARY=openssl
%py3_install
rm -rf %{buildroot}%{_datadir}/doc/pycurl
%check
2021-12-29 20:59:04 +08:00
# relax crypto policy for the test-suite to make it pass again (#1863711)
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=XXX
export OPENSSL_CONF=
2019-09-30 11:15:24 -04:00
export PYTHONPATH=%{buildroot}%{python3_sitearch}
export PYCURL_SSL_LIBRARY=openssl
export PYCURL_VSFTPD_PATH=vsftpd
# disable tests incompatible with curl 8.4.0 and newer
export PYTEST_ADDOPTS="--ignore examples -m 'not online' -k 'not (test_http_version_3 or test_multi_socket_action or test_multi_socket_select or test_easy_pause_unpause)'"
2020-11-09 14:40:42 +08:00
make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v" PYFLAKES=true
2019-09-30 11:15:24 -04:00
rm -fv tests/fake-curl/libcurl/*.so
%files devel
%defattr(-,root,root)
%doc examples tests
%files help
%defattr(-,root,root)
%doc ChangeLog README.rst doc
%files -n python3-pycurl
%defattr(-,root,root)
%license COPYING-LGPL COPYING-MIT
%{python3_sitearch}/curl/
%{python3_sitearch}/pycurl.*.so
%{python3_sitearch}/pycurl-%{version}-*.egg-info
%changelog
* Fri Apr 12 2024 zhuofeng <zhuofeng2@huawei.com> - 7.45.2-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:disable tests incompatible with curl 8.4.0 and newer
* Tue Mar 21 2023 zhuofeng <zhuofeng2@huawei.com> - 7.45.2-2
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:temporarily disable test_http_version_3
2023-01-19 12:03:13 +08:00
* Thu Jan 19 2023 chendonghui6 <chendonghui6@huawei.com> - 7.45.2-1
- update version to 7.45.2
* Fri Aug 05 2022 yanglongkang <yanglongkang@h-partners.com> - 7.44.1-2
- Add release for rebuild
2021-12-29 20:59:04 +08:00
* Wed Dec 29 2021 guozhaorui <guozhaorui1@huawei.com> - 7.44.1-1
- update version to 7.44.1
* Sat Jul 24 2021 shixuantong <shixuantong@huawei.com> - 7.43.0.6-2
- fix test fail for test_sslversion_options, test_failonerror and test_failonerror_status_line_invalid_utf8_python3
2021-02-02 14:29:51 +08:00
* Tue Feb 2 2021 shangyibin <shangyibin1@huawei.com> - 7.43.0.6-1
- Upgrade to version 7.43.0.6
2020-11-09 14:40:42 +08:00
* Mon Nov 9 2020 wangjie<wangjie294@huawei.com> -7.43.0.5-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix compile error
2022-06-17 07:30:33 +00:00
* Tue Aug 4 2020 shixuantong <shixuantong@huawei.com> - 7.43.0.5-1
2020-08-04 17:34:16 +08:00
- update to 7.43.0.5
2019-11-06 19:49:56 +08:00
* Fri Oct 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-6
- optimize spec file.
2019-09-30 11:15:24 -04:00
* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-5
- del unnecessary statement
* Tue Sep 24 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-4
- add with_python2 for python2
* Thu Sep 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-3
- rebuild package
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-2
- modify content format
* Sat Sep 14 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.43.0.2-1
- Package init