Summary: A text browser for the World Wide Web
Name:    lynx
Version: 2.8.9
Release: 6
License: GPLv2
URL:     http://lynx.browser.org/
Source:  https://invisible-mirror.net/archives/%{name}/tarballs/%{name}%{version}rel.1.tar.bz2

Patch0:  %{name}-CVE-2008-4690.patch
Patch1:  CVE-2021-38165.patch

Provides: webclient text-www-browser
BuildRequires: dos2unix gcc gettext telnet unzip zip
BuildRequires: openssl-devel ncurses-devel slang-devel zlib-devel
Requires: %{_vendor}-indexhtml

%description
Lynx is a fully-featured World Wide Web (WWW) client for users running
cursor-addressable, character-cell display devices such as vt100 terminals,
vt100 emulators running on Windows 95/NT or Macintoshes, or any other
character-cell display.  It will display Hypertext Markup Language (HTML)
documents containing links to files on the local system, as well as files on
remote systems running http, gopher, ftp, wais, nntp, finger, or cso/ph/qi
servers, and services accessible via logins to telnet, tn3270 or rlogin
accounts.  Current versions of Lynx run on Unix, VMS, Windows95
through Windows 8, 386DOS and OS/2 EMX.

Lynx can be used to access information on the WWW, or to establish
information systems intended primarily for local access.  Lynx has been
used to build several Campus Wide Information Systems (CWIS).  Lynx can
also be used to build systems isolated within a single LAN.

%package_help


%prep
%autosetup -p1 -n %{name}%{version}rel.1

%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
sed -e "s,^HELPFILE:.*,HELPFILE:file://localhost%{_pkgdocdir}/lynx_help/lynx_help_main.html,g" -i %{name}.cfg
sed -e 's,^STARTFILE:.*,STARTFILE:file:%{_docdir}/HTML/en-US/index.html,' -i %{name}.cfg

%build
%configure --libdir=/etc            \
    --enable-prettysrc              \
    --enable-charset-choice         \
    --enable-cjk                    \
    --enable-warnings               \
    --enable-debug                  \
    --enable-justify-elts           \
    --enable-externs                \
    --enable-file-upload            \
    --enable-ipv6                   \
    --enable-addrlist-page          \
    --enable-locale-charset         \
    --enable-kbd-layout             \
    --enable-libjs                  \
    --enable-nls                    \
    --disable-rpath-hack            \
    --enable-nsl-fork               \
    --enable-persistent-cookies     \
    --enable-default-colors         \
    --enable-read-eta               \
    --disable-font-switch           \
    --enable-internal-links         \
    --enable-scrollbar              \
    --enable-cgi-links              \
    --enable-japanese-utf8          \
    --enable-source-cache           \
    --with-ssl=%{_libdir}           \
    --with-screen=ncursesw          \
    --with-zlib                     \
    ac_cv_path_RLOGIN=/usr/bin/rlogin

make -C po
%make_build

%install
chmod -x samples/mailto-form.pl
%make_install

rm -f test/X test/nobody samples/*.bat
rm -f docs/OS-390.announce docs/README.jp

dos2unix samples/%{name}-demo.cfg
dos2unix samples/midnight.lss

install -d %{buildroot}%{_datadir}/locale/ja/LC_MESSAGES/

cat >%{buildroot}%{_sysconfdir}/%{name}-site.cfg <<EOF
# Place any local lynx configuration options (proxies etc.) here.
EOF

%find_lang %{name}

%files -f %{name}.lang
%{_bindir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.cfg
%config(noreplace) %{_sysconfdir}/%{name}.lss
%config(noreplace,missingok) %{_sysconfdir}/%{name}-site.cfg

%files help
%doc docs README INSTALLATION samples
%doc test %{name}.hlp %{name}_help
%{_mandir}/*/*

%changelog
* Tue Aug 17 2021 houyingchao <houyingchao@huawei.com> - 2.8.9-6
- Fix CVE-2021-38165

* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.8.9-5
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:optimization the spec

* Tue Dec 24 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.8.9-4
- Require openEuler-indexhtml

* Tue Dec 3 2019 mengxian <mengxian@huawei.com> - 2.8.9-3
- Package init

* Sat Mar 30 2019 wuyou<wuyou88@huawei.com> - 2.8.9-2.h1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: modify requires to  euleros-indexhtml

