epel8
Terje Røsten 7 years ago
parent 6039a02027
commit 86151b0dd8

@ -1,16 +1,11 @@
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_python3 1
%endif
%global oname beautifulsoup4
Name: python-beautifulsoup4 Name: python-beautifulsoup4
Version: 4.6.0 Version: 4.6.0
Release: 5%{?dist} Release: 6%{?dist}
Summary: HTML/XML parser for quick-turnaround applications like screen-scraping Summary: HTML/XML parser for quick-turnaround applications like screen-scraping
Group: Development/Languages Group: Development/Languages
License: MIT License: MIT
URL: http://www.crummy.com/software/BeautifulSoup/ URL: http://www.crummy.com/software/BeautifulSoup/
Source0: https://files.pythonhosted.org/packages/source/b/%{oname}/%{oname}-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel >= 2.7 BuildRequires: python2-devel >= 2.7
# html5lib BR just for test coverage # html5lib BR just for test coverage
@ -18,13 +13,19 @@ BuildRequires: python2-html5lib
BuildRequires: python2-setuptools BuildRequires: python2-setuptools
BuildRequires: python2-lxml BuildRequires: python2-lxml
BuildRequires: /usr/bin/2to3 BuildRequires: /usr/bin/2to3
BuildRequires: python2-tools
# html5lib BR just for test coverage
BuildRequires: python3-html5lib
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-lxml
%global _description\ %global _description\
Beautiful Soup is a Python HTML/XML parser designed for quick\ Beautiful Soup is a Python HTML/XML parser designed for quick\
turnaround projects like screen-scraping. Three features make it\ turnaround projects like screen-scraping. Three features make it\
powerful:\ powerful:\
\ \
Beautiful Soup won't choke if you give it bad markup.\ Beautiful Soup wont choke if you give it bad markup.\
\ \
Beautiful Soup provides a few simple methods and Pythonic idioms for\ Beautiful Soup provides a few simple methods and Pythonic idioms for\
navigating, searching, and modifying a parse tree.\ navigating, searching, and modifying a parse tree.\
@ -40,99 +41,57 @@ minutes with Beautiful Soup.
%description %_description %description %_description
%package -n python2-beautifulsoup4 %package -n python2-beautifulsoup4
Summary: %summary Summary: %summary
Requires: python2-lxml Requires: python2-lxml
%{?python_provide:%python_provide python2-beautifulsoup4} %{?python_provide:%python_provide python2-beautifulsoup4}
%description -n python2-beautifulsoup4 %_description %description -n python2-beautifulsoup4 %_description
%if 0%{?with_python3} %package -n python3-beautifulsoup4
%package -n python3-beautifulsoup4 Summary: %summary
Summary: HTML/XML parser for quick-turnaround applications like screen-scraping
Group: Development/Languages
BuildRequires: python2-tools
# html5lib BR just for test coverage
BuildRequires: python3-html5lib
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-lxml
Requires: python3-lxml Requires: python3-lxml
Obsoletes: python3-BeautifulSoup < 1:3.2.1-2 Obsoletes: python3-BeautifulSoup < 1:3.2.1-2
%description -n python3-beautifulsoup4 %_description
%description -n python3-beautifulsoup4
Beautiful Soup is a Python HTML/XML parser designed for quick
turnaround projects like screen-scraping. Three features make it
powerful:
Beautiful Soup won't choke if you give it bad markup.
Beautiful Soup provides a few simple methods and Pythonic idioms for
navigating, searching, and modifying a parse tree.
Beautiful Soup automatically converts incoming documents to Unicode
and outgoing documents to UTF-8.
Beautiful Soup parses anything you give it.
Valuable data that was once locked up in poorly-designed websites is
now within your reach. Projects that would have taken hours take only
minutes with Beautiful Soup.
This is the Python 3 build of Beautiful Soup.
%endif # if with_python3
%prep %prep
%setup -q -n %{oname}-%{version} %setup -q -n beautifulsoup4-%{version}
mv AUTHORS.txt AUTHORS.txt.iso mv AUTHORS.txt AUTHORS.txt.iso
iconv -f ISO-8859-1 -t UTF-8 -o AUTHORS.txt AUTHORS.txt.iso iconv -f ISO-8859-1 -t UTF-8 -o AUTHORS.txt AUTHORS.txt.iso
touch -r AUTHORS.txt.iso AUTHORS.txt touch -r AUTHORS.txt.iso AUTHORS.txt
rm -rf %{py3dir} && cp -a . %{py3dir}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%{__python} setup.py build %{py2_build}
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
2to3 --write --nobackups . 2to3 --write --nobackups .
%{__python3} setup.py build %{py3_build}
%endif
%install %install
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %{py2_install}
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot} %{py3_install}
%endif
%check %check
%{__python} -m unittest discover -s bs4 %{__python2} -m unittest discover -s bs4
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
%{__python3} -m unittest discover -s bs4 %{__python3} -m unittest discover -s bs4
%endif
%files -n python2-beautifulsoup4 %files -n python2-beautifulsoup4
%license COPYING.txt %license COPYING.txt
%doc AUTHORS.txt NEWS.txt README.txt TODO.txt %doc AUTHORS.txt NEWS.txt README.txt TODO.txt
%{python_sitelib}/beautifulsoup4-%{version}*.egg-info %{python2_sitelib}/beautifulsoup4-%{version}*.egg-info
%{python_sitelib}/bs4 %{python2_sitelib}/bs4
%if 0%{?with_python3}
%files -n python3-beautifulsoup4 %files -n python3-beautifulsoup4
%license COPYING.txt %license COPYING.txt
%doc AUTHORS.txt NEWS.txt README.txt TODO.txt %doc AUTHORS.txt NEWS.txt README.txt TODO.txt
%{python3_sitelib}/beautifulsoup4-%{version}*.egg-info %{python3_sitelib}/beautifulsoup4-%{version}*.egg-info
%{python3_sitelib}/bs4 %{python3_sitelib}/bs4
%endif
%changelog %changelog
* Wed Feb 07 2018 Terje Rosten <terje.rosten@ntnu.no> - 4.6.0-6
- Clean up
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.6.0-5 * Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.6.0-5
- Update Python 2 dependency declarations to new packaging standards - Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

Loading…
Cancel
Save