File w3m.spec of Package w3m

#
# spec file for package w3m
#
# Copyright (c) 2013 SUSE LINUX Products 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:           w3m
Url:            http://w3m.sourceforge.net/
Version:        0.5.3
Release:        0
Summary:        A text-based WWW browser
License:        ISC
Group:          Productivity/Networking/Web/Browsers

Source:         http://prdownloads.sourceforge.net/w3m/w3m-%version.tar.bz2
Patch0:         w3m-disable-cookie-special-domain-check.patch
Patch1:         w3m-0.4.1-textarea-segfault.dif
Patch2:         w3m-0.4.1-session-mgmt.dif
Patch4:         w3m-inline-image.patch
Patch5:         w3m-uninitialized.patch
Patch6:         w3m-0.5.1-no-ASCII-equivalents-by-default.patch
Patch7:         w3m-tempdir-override.patch
Patch8:         w3m-parsetagx-crash.patch
Patch9:         w3m-history-crossdev.patch
Patch11:        w3m-ssl-verify.patch
Patch12:        w3m-closedir.patch
Patch13:        w3m-parallel-make.patch
Patch503:       w3m-fh-def.patch
Patch504:       w3m-openssl.patch
Patch505:       w3m-gc7.diff

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gc-devel
BuildRequires:  gcc-c++
BuildRequires:  gpm
BuildRequires:  imlib2-devel
BuildRequires:  ncurses-devel
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
Provides:       w3m_ssl = %version
Provides:       web_browser
Obsoletes:      w3m_ssl < %version

%package inline-image
Summary:        An inline image extension for w3m
Group:          Productivity/Networking/Web/Browsers
Requires:       imlib2-loaders
Requires:       w3m
Provides:       w3m:/usr/%_lib/w3m/w3mimgdisplay

%description
W3m is a pager and text-based WWW browser. It has a number of useful
features:

* w3m can render tables

* w3m can render frames (it converts the frames into a table)

* SSL support

* w3m can easily display documents from standard input

* w3m can handle cookies

* w3m is small

* w3m has mouse support

If w3m-inline-image is installed it can display graphics inside
terminals, even on the console on some platforms.


%description inline-image
Inline image extension for w3m, the text-based WWW browser.

When this package is installed w3m can display images inline in an X
terminal (if it runs in a graphical X Window System environment).

%prep
%setup -q
find -name CVS -exec rm -Rf "{}" "+"
%patch0 -p1
%patch1 -p1
%patch2
%patch4
%patch5
%patch6
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch11
%patch12
%patch13 -p1
%patch503
%patch504
%patch -P 505 -p1

%build
export CFLAGS="$RPM_OPT_FLAGS -DUSE_BUFINFO -DOPENSSL_NO_SSL_INTERN -D_GNU_SOURCE $(getconf LFS_CFLAGS) -fno-strict-aliasing `ncursesw6-config --cflags`"
export LDFLAGS="`ncursesw6-config --libs`"
./configure	--bindir=/usr/bin \
        --with-termlib=ncursesw \
		--mandir=%_mandir \
		--libdir=%_libdir \
		--libexecdir=%_libdir \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-ipv6 \
		--enable-alarm \
		--enable-ansi-color \
		--enable-digest-auth \
		--enable-external-uri-loader \
		--enable-gopher \
		--enable-history \
		--enable-image=x11,fb \
		--enable-keymap=lynx \
		--enable-m17n \
		--enable-mouse \
		--enable-nls \
		--enable-nntp \
		--enable-sslverify \
		--enable-unicode \
		--disable-w3mmailer
make %{?_smp_mflags}

%install
make install install-helpfile DESTDIR=$RPM_BUILD_ROOT
install -m 755 Bonus/*.cgi $RPM_BUILD_ROOT/usr/%_lib/w3m/cgi-bin
%find_lang %{name}

%files -f %{name}.lang
%defattr(-,root,root)
/usr/bin/w3m
/usr/bin/w3mman
%doc doc/*
%_libdir/w3m
%exclude %_libdir/w3m/w3mimgdisplay
%lang(ja)%doc %_mandir/ja
%doc %_mandir/man*/*
%_datadir/%name

%files inline-image
%defattr(-,root,root)
%dir %_libdir/w3m
/usr/%_lib/w3m/w3mimgdisplay

%changelog