#
# spec file for package html2text
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: html2text
Version: 1.3.2a
Release: 165.12
Summary: HTML to ASCII Converter
License: GPL-2.0+
Group: Productivity/Publishing/HTML/Tools
Url: http://www.mbayer.de/html2text/
Source0: http://www.mbayer.de/html2text/downloads/html2text-%{version}.tar.gz
Source1: http://www.mbayer.de/html2text/html2text-%{version}.tar.gz.asc
Source2: %{name}.keyring
Source3: html2text.1.gz
Patch0: html2text-debian-200_close_files_inside_main_loop.patch
Patch1: html2text-debian-220_nobs_when_stdout_is_a_tty.patch
Patch2: html2text-1.3.2a-400_remove_builtin_http_support.patch
Patch3: html2text-debian-500_utf8_support.patch
Patch4: html2text-debian-510_disable_backspaces.patch
Patch5: html2text-debian-600_multiple_meta_tags.patch
Patch6: html2text-1.3.2a-611_recognize_input_encoding.patch
Patch7: html2text-debian-630_recode_output_to_locale_charset.patch
Patch8: http://www.mbayer.de/html2text/downloads/patch-amd64-html2text-1.3.2a.diff
Patch9: html2text-debian-810_fix_deprecated_conversion_warnings.patch
BuildRequires: gcc-c++
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A tool for converting from HTML to ASCII. It can reasonably handle
tables.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
cp -a %{SOURCE3} .
%build
%configure
make %{?_smp_mflags} EXPLICIT="%{optflags}"
%install
# To avoid conflicts with the python3-html2text package
install -D -m 0755 html2text %{buildroot}%{_bindir}/html2text-cpp
install -D -m 0644 html2text.1.gz %{buildroot}%{_mandir}/man1/html2text-cpp.1.gz
install -D -m 0644 html2textrc.5.gz %{buildroot}%{_mandir}/man5/html2textrc.5.gz
ln -s -f %{_sysconfdir}/alternatives/html2text %{buildroot}%{_bindir}/html2text
ln -s -f %{_sysconfdir}/alternatives/html2text.1.gz %{buildroot}%{_mandir}/man1/html2text.1.gz
%post
update-alternatives --install %{_bindir}/html2text html2text %{_bindir}/html2text-cpp 30 \
--slave %{_mandir}/man1/html2text.1.gz html2text.1.gz %{_mandir}/man1/html2text-cpp.1.gz
%preun
if [ ! -f %{_bindir}/html2text-cpp ] ; then
update-alternatives --remove html2text %{_bindir}/html2text-cpp
fi
%files
%defattr(-,root,root)
%doc README CHANGES COPYING TODO CREDITS KNOWN_BUGS RELEASE_NOTES
%{_bindir}/html2text
%{_bindir}/html2text-cpp
%ghost %{_sysconfdir}/alternatives/html2text
%{_mandir}/man1/html2text.1.gz
%{_mandir}/man1/html2text-cpp.1.gz
%ghost %{_sysconfdir}/alternatives/html2text.1.gz
%{_mandir}/man5/html2textrc.5.gz
%changelog
* Thu Apr 27 2017 toddrme2178@gmail.com
- Implement update-alternatives to avoid conflict with
python3-html2text.
* Mon Mar 21 2016 mpluskal@suse.com
- Cleanup spec file with spec-cleaner
- Use macro for configure
- Do not ship INSTALL
- Remove useless provides/obsoletes
- Add gpg signature
- Use url for source
* Wed Oct 8 2014 jengelh@inai.de
- Remove old/implicit specfile tags (AutoReqProv, norootforbuild)
* Wed Jan 6 2010 jengelh@medozas.de
- enable parallel build
* Wed Jan 28 2009 kssingvo@suse.de
- added RPM_OPT_FLAGS
* Tue Jan 27 2009 kssingvo@suse.de
- added a lot of debians patches, adapted some of them
- modified manual page with approval from author: debian to openSUSE
* Tue Apr 3 2007 kssingvo@suse.de
- using now upstream patch for 64bit
- added upstream utf-8 patch
* Tue Feb 6 2007 kssingvo@suse.de
- fixed 64bit pointer issue (bugzilla#242105)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 16 2006 schwab@suse.de
- Don't strip binaries.
* Thu Jan 20 2005 ro@suse.de
- renamed to html2text
* Tue Jan 20 2004 kssingvo@suse.de
- upgrade to 1.3.2a
- norootforbuild
- added %%doc RELEASE_NOTES
* Sun Jan 11 2004 adrian@suse.de
- add %%defattr
* Wed Apr 23 2003 coolo@suse.de
- use BuildRoot
* Tue Mar 11 2003 fehr@suse.de
- update to new version 1.3.1
* Thu Apr 18 2002 fehr@suse.de
- make it compile with gcc 3.1
* Fri Jun 22 2001 fehr@suse.de
- change to version 1.2.4
* Wed Mar 28 2001 fehr@suse.de
- change to version 1.2.3
* Fri Nov 17 2000 fehr@suse.de
- set group tag
* Fri May 26 2000 fehr@suse.de
- move documentation to /usr/share/doc/packages
* Tue Feb 29 2000 fehr@suse.de
- change to version 1.2.2
* Mon Jan 31 2000 fehr@suse.de
- fixed for new gcc 2.95.2
* Wed Jan 12 2000 fehr@suse.de
- change to version 1.2.1
* Wed Nov 24 1999 fehr@suse.de
- change to version 1.2
* Tue Nov 23 1999 fehr@suse.de
- change to version 1.1.1
* Wed Sep 29 1999 fehr@suse.de
- change to version 1.04
* Tue Sep 21 1999 fehr@suse.de
- change to version 1.03
* Fri Jul 2 1999 fehr@suse.de
- change to version 1.02
* Fri Jun 18 1999 fehr@suse.de
- change to version 1.01
* Wed Jun 16 1999 fehr@suse.de
- add version 1.0 of package to suse distribution