Merge "remove-newlines" (from alt tags) patch (Debian #299027).
- Include html2text script as python-html2script. - Minor spec cleanup.
This commit is contained in:
parent
7aaa5518e9
commit
7f193c204a
2 changed files with 30 additions and 14 deletions
11
aaronsw-html2text-remove-newlines.patch
Normal file
11
aaronsw-html2text-remove-newlines.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
diff -Nur aaronsw-html2text-c368b14-orig/html2text.py aaronsw-html2text-c368b14/html2text.py
|
||||||
|
--- aaronsw-html2text-c368b14-orig/html2text.py 2012-01-07 16:01:09.000000000 +0100
|
||||||
|
+++ aaronsw-html2text-c368b14/html2text.py 2013-02-19 11:53:09.609134393 +0100
|
||||||
|
@@ -479,6 +479,7 @@
|
||||||
|
if has_key(attrs, 'src'):
|
||||||
|
attrs['href'] = attrs['src']
|
||||||
|
alt = attrs.get('alt', '')
|
||||||
|
+ alt = re.sub('\n', ' ', alt)
|
||||||
|
if self.inline_links:
|
||||||
|
self.o("![")
|
||||||
|
self.o(alt)
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
|
|
||||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||||
|
|
||||||
%global tardirname aaronsw-html2text-c368b14
|
%global tardirname aaronsw-html2text-c368b14
|
||||||
|
|
||||||
Name: python-html2text
|
Name: python-html2text
|
||||||
Version: 3.200.3
|
Version: 3.200.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Converts a page of HTML into clean, easy-to-read plain ASCII text
|
Summary: Converts a page of HTML into plain ASCII text
|
||||||
|
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
URL: http://www.aaronsw.com/2002/html2text/
|
URL: http://www.aaronsw.com/2002/html2text/
|
||||||
#Source0: https://github.com/aaronsw/html2text/tarball/%{version}/%{name}-%{version}.tar.gz
|
#Source0: https://github.com/aaronsw/html2text/tarball/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
# git clone git://github.com/aaronsw/html2text.git aaronsw-html2text-c368b14 ; cd aaronsw-html2text-c368b14 ; git checkout c368b14
|
||||||
Source0: aaronsw-html2text-3.02-77-gc368b14.tar.gz
|
Source0: aaronsw-html2text-3.02-77-gc368b14.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
|
@ -20,8 +20,12 @@ BuildArch: noarch
|
||||||
BuildRequires: python
|
BuildRequires: python
|
||||||
BuildRequires: python-setuptools-devel
|
BuildRequires: python-setuptools-devel
|
||||||
|
|
||||||
|
# Debian bug #299027
|
||||||
|
Patch0: aaronsw-html2text-remove-newlines.patch
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
html2text is a Python script that convers a page of HTML into clean,
|
html2text is a Python script that converts a page of HTML into clean,
|
||||||
easy-to-read plain ASCII text. Better yet, that ASCII also happens to
|
easy-to-read plain ASCII text. Better yet, that ASCII also happens to
|
||||||
be valid Markdown (a text-to-HTML format).
|
be valid Markdown (a text-to-HTML format).
|
||||||
|
|
||||||
|
|
@ -29,34 +33,35 @@ Also known as: THE ASCIINATOR, html to text, htm to txt, htm2txt, ...
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{tardirname}
|
%setup -q -n %{tardirname}
|
||||||
|
%patch0 -p1 -b .remove-newlines
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
echo Nothing to build
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
%{__python} setup.py install --root $RPM_BUILD_ROOT
|
%{__python} setup.py install --root $RPM_BUILD_ROOT
|
||||||
# TODO: conflicts with package' html2text' obviously
|
# new script in 3.200.3 : conflicts with package' html2text' obviously
|
||||||
rm $RPM_BUILD_ROOT/usr/bin/html2text
|
mv $RPM_BUILD_ROOT/usr/bin/html2text $RPM_BUILD_ROOT/usr/bin/%{name}
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
cd test
|
cd test
|
||||||
PYTHONPATH=${RPM_BUILD_ROOT}%{python_sitelib} %{__python} run_tests.py
|
PYTHONPATH=${RPM_BUILD_ROOT}%{python_sitelib} %{__python} run_tests.py
|
||||||
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
/usr/bin/%{name}
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/*
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 19 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 3.200.3-4
|
||||||
|
- Merge "remove-newlines" (from alt tags) patch (Debian #299027).
|
||||||
|
- Include html2text script as python-html2script.
|
||||||
|
- Minor spec cleanup.
|
||||||
|
|
||||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.200.3-3
|
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.200.3-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
|
@ -96,7 +101,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.34-2.1
|
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.34-2.1
|
||||||
- Rebuild for Python 2.6
|
- Rebuild for Python 2.6
|
||||||
|
|
||||||
* Sat Oct 09 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.34-1
|
* Sat Oct 11 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.34-1
|
||||||
- update to 2.34
|
- update to 2.34
|
||||||
|
|
||||||
* Sat Sep 27 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.33-1
|
* Sat Sep 27 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.33-1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue