File w3m-el.spec of Package w3m-el

#
# spec file for package w3m-el (Version 1.4.4.20080124)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           w3m-el
BuildRequires:  compface emacs-x11 flim flim-xemacs giflib-devel krb5 libpng-devel libtiff-devel openldap2-devel semi-xemacs w3m xorg-x11-devel
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Browsers
Requires:       emacs, apel, flim, Mule-UCS, w3m
AutoReqProv:    on
Version:        1.4.4.20080124
Release:        104
Url:            http://emacs-w3m.namazu.org/
# cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot login
# (CVS password empty)
# cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m
Source0:        http://emacs-w3m.namazu.org/emacs-w3m-%{version}.tar.bz2
Source1:        suse-start.el
Patch1:         w3m-el-1.3-map.patch
Summary:        W3m-el is a simple interface program to use w3m with Emacs.
# Summary(ja): w3m を Emacs 上で動かすためのプログラムです
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
# %description -l ja
# Emacs 上で動作するブラウザと言えば,普通 W3 のことですが,動作が非常に
# 遅いので,なかなか常用しようという気になれません.
# 
# それに対して,w3m というテキストベースで動作するブラウザがあり,非常に
# 軽快に動作するので重宝しているのですが,端末に移動しなければいけないの
# が面倒です.
# 
# そこで,w3m を HTML の rendering engine として使用し,表示とインタフェー
# スのみをEmacs で動かすようにすればいいんじゃないだろうか,ということを
# 考えました.
# 
# Authors:
# --------
# 
#     TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
#     Shun-ichi GOTO     <gotoh@taiyo.co.jp>,
#     Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
#     Hideyuki SHIRAI    <shirai@meadowy.org>,
#     Keisuke Nishida    <kxn30@po.cwru.edu>,
#     Yuuichi Teranishi  <teranisi@gohome.org>,
#     Akihiro Arisawa    <ari@mbf.sphere.ne.jp>,
#     Katsumi Yamaoka    <yamaoka@jpl.org>
#     emacs-w3m mailing list <emacs-w3m@namazu.org>

%description
W3m-el is a simple interface program to use w3m with Emacs.

W3 is the most well known WEB browser which works on (X)Emacs, but it
is very slow. w3m-el is a simple and speedy alternative.

W3m-el uses w3m, which is a pager with WWW capability, developed by
Akinori ITO. It is a pager, but it can be used as a text-mode WWW
browser.



Authors:
--------
    TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
    Shun-ichi GOTO     <gotoh@taiyo.co.jp>,
    Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
    Hideyuki SHIRAI    <shirai@meadowy.org>,
    Keisuke Nishida    <kxn30@po.cwru.edu>,
    Yuuichi Teranishi  <teranisi@gohome.org>,
    Akihiro Arisawa    <ari@mbf.sphere.ne.jp>,
    Katsumi Yamaoka    <yamaoka@jpl.org>
    emacs-w3m mailing list <emacs-w3m@namazu.org>

%package -n w3m-el-xemacs
License:        GPL v2 or later
Group:          Productivity/Networking/Web/Browsers
Requires:       xemacs, flim-xemacs, semi-xemacs, mule-ucs-xemacs, w3m, ungifsicle
Summary:        W3m-el is a simple interface program to use w3m with XEmacs.
# Summary(ja): w3m を Emacs 上で動かすためのプログラムです
# %description -l ja
# Emacs 上で動作するブラウザと言えば,普通 W3 のことですが,動作が非常に
# 遅いので,なかなか常用しようという気になれません.
# 
# それに対して,w3m というテキストベースで動作するブラウザがあり,非常に
# 軽快に動作するので重宝しているのですが,端末に移動しなければいけないの
# が面倒です.
# 
# そこで,w3m を HTML の rendering engine として使用し,表示とインタフェー
# スのみをEmacs で動かすようにすればいいんじゃないだろうか,ということを
# 考えました.
# 
# Authors:
# --------
# 
#     TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
#     Shun-ichi GOTO     <gotoh@taiyo.co.jp>,
#     Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
#     Hideyuki SHIRAI    <shirai@meadowy.org>,
#     Keisuke Nishida    <kxn30@po.cwru.edu>,
#     Yuuichi Teranishi  <teranisi@gohome.org>,
#     Akihiro Arisawa    <ari@mbf.sphere.ne.jp>,
#     Katsumi Yamaoka    <yamaoka@jpl.org>
#     emacs-w3m mailing list <emacs-w3m@namazu.org>

%description -n w3m-el-xemacs
W3m-el is a simple interface program to use w3m with (X)Emacs.

W3 is the most well known WEB browser which works on (X)Emacs, but it
is very slow. w3m-el is a simple and speedy alternative.

W3m-el uses w3m, which is a pager with WWW capability, developed by
Akinori ITO. It is a pager, but it can be used as a text-mode WWW
browser.



Authors:
--------
    TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
    Shun-ichi GOTO     <gotoh@taiyo.co.jp>,
    Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
    Hideyuki SHIRAI    <shirai@meadowy.org>,
    Keisuke Nishida    <kxn30@po.cwru.edu>,
    Yuuichi Teranishi  <teranisi@gohome.org>,
    Akihiro Arisawa    <ari@mbf.sphere.ne.jp>,
    Katsumi Yamaoka    <yamaoka@jpl.org>
    emacs-w3m mailing list <emacs-w3m@namazu.org>

%prep
%setup -n emacs-w3m-%{version}
%patch1
#chmod +x configure

%build
%define emacs_sitelisp_dir %{_datadir}/emacs/site-lisp
%define emacs_package_dir %{emacs_sitelisp_dir}/w3m
# update config.{guess,sub}
%{?suse_update_config:%{suse_update_config -f}}
libtoolize  --force
autoreconf --force --install
export CFLAGS="$RPM_OPT_FLAGS" 
./configure --prefix=%{_prefix} \
            --infodir=%{_infodir} \
            --with-lispdir=%{emacs_package_dir} \
            --with-infodir=%{_infodir} \
            --with-icondir=%{emacs_package_dir} \
            --with-emacs=emacs 
make 

%install
mkdir -p $RPM_BUILD_ROOT%{emacs_package_dir}
make install prefix=$RPM_BUILD_ROOT%{_prefix} \
             lispdir=$RPM_BUILD_ROOT%{emacs_package_dir} \
             infodir=$RPM_BUILD_ROOT%{_infodir} \
             ICONDIR=$RPM_BUILD_ROOT%{emacs_package_dir} 
make install-icons DESTDIR=$RPM_BUILD_ROOT/%{_prefix} \
             lispdir=$RPM_BUILD_ROOT%{emacs_package_dir} \
             infodir=$RPM_BUILD_ROOT%{_infodir} \
             ICONDIR=$RPM_BUILD_ROOT%{emacs_package_dir} 
{
  echo ";; %{emacs_sitelisp_dir}/suse-start-%{name}.el"
  echo ""
  echo "(add-to-list 'load-path \"%{emacs_package_dir}\")"
  echo ""
  cat $RPM_SOURCE_DIR/suse-start.el
  echo ""
  echo ";; %{emacs_sitelisp_dir}/suse-start-%{name}.el ends here"
} > %{buildroot}%{emacs_sitelisp_dir}/suse-start-%{name}.el
######################################################################
# now build for XEmacs:
%define xemacs_package_dir /usr/share/xemacs/site-packages/
make clean
rm -f config.cache
export CFLAGS="$RPM_OPT_FLAGS" 
./configure --prefix=%{_prefix} \
            --infodir=%{_infodir} \
    	    --with-xemacs=xemacs \
	    --with-packagedir=%{xemacs_package_dir} \
	    --with-icondir=/tmp 
make 
make install-package PACKAGEDIR=$RPM_BUILD_ROOT%{xemacs_package_dir}
gzip $RPM_BUILD_ROOT%{xemacs_package_dir}/info/emacs-w3m*.info*
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
rm -f $RPM_BUILD_ROOT/%{xemacs_package_dir}/info/dir 
# replace buildroot in comments in .elc files by spaces with the same total length:
RPM_BUILD_ROOT_REPLACEMENT=$(echo "$RPM_BUILD_ROOT" | tr '[:print:]' ' ')
for i in $(find $RPM_BUILD_ROOT -name "*.elc")
do
    perl -pi -e "s|(;;; from file )\Q$RPM_BUILD_ROOT\E(/usr/share/xemacs/site-packages/.*)|\1$RPM_BUILD_ROOT_REPLACEMENT\2|" $i
done

%post
for i in emacs-w3m emacs-w3m-ja
do
    %install_info --info-dir=%{_infodir} %{_infodir}/${i}.info.gz
done

%preun
for i in emacs-w3m emacs-w3m-ja
do
    %install_info --delete --info-dir=%{_infodir} %{_infodir}/${i}.info.gz
done

%post -n w3m-el-xemacs
for i in emacs-w3m emacs-w3m-ja
do
    %install_info --info-dir=%{xemacs_package_dir}/info/ %{xemacs_package_dir}/info/${i}.info.gz
done

%preun -n w3m-el-xemacs
for i in emacs-w3m emacs-w3m-ja
do
    %install_info --delete --info-dir=%{xemacs_package_dir}/info/ %{xemacs_package_dir}/info/${i}.info.gz
done

%clean

%files
%defattr(-,root,root)
%doc COPYING ChangeLog* README*
%{emacs_package_dir}
%config %{emacs_sitelisp_dir}/suse-start-%{name}.el
%{_infodir}/*

%files -n w3m-el-xemacs
%defattr(-,root,root)
%doc COPYING ChangeLog* README*
%dir %{xemacs_package_dir}/
%dir %{xemacs_package_dir}/info/
%doc %{xemacs_package_dir}/info/*
%dir %{xemacs_package_dir}/lisp/
%dir %{xemacs_package_dir}/etc/
%{xemacs_package_dir}/lisp/*
%{xemacs_package_dir}/etc/*

%changelog
* Thu Jan 24 2008 mfabian@suse.de
- proper fix for the problem in the last comment is now included
  from upstream CVS.
* Tue Jan 08 2008 mfabian@suse.de
-  add workaround for missing function on XEmacs
  unencodable-char-position-does-not-exist-in-xemacs.patch
  Patch taken from:
  http://news.gmane.org/find-root.php?message_id=%%3cb4mr6gu1h47.fsf%%40jpl.org%%3e
* Tue Jan 08 2008 mfabian@suse.de
- update to 1.4.4.20080108 (CVS HEAD).
  • Do not kill process when the buffer associated to it is alive
* Tue Dec 04 2007 mfabian@suse.de
- remove openldap2 from BuildRequires.
* Wed Jul 18 2007 mfabian@suse.de
- update to 1.4.4.20070717 (CVS HEAD). Fixes the problem that
  buttons in forms didn't work anymore, see
  http://emacs-w3m.namazu.org/ml/msg09431.html
* Tue Jul 17 2007 mfabian@suse.de
- update to 1.4.4.20070704 (CVS HEAD).
* Mon Mar 26 2007 mfabian@suse.de
- update to 1.4.4.20070326 (CVS HEAD).
- remove old patches w3m-el-1.3.1-expires-time.patch and
  w3m-el-1.4.3-obsolete.patch.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri May 06 2005 schwab@suse.de
- Don't use obsolete functions.
* Sun Aug 29 2004 schwab@suse.de
- Update to emacs-w3m 1.4.3.
* Sun Jun 27 2004 schwab@suse.de
- Don't set w3m-mailto-url-function to compose-mail, it can't handle URLs.
* Tue Feb 03 2004 hmacht@suse.de
- added option # norootforbuild in specfile
* Fri Aug 22 2003 mfabian@suse.de
- add xemacs-packagages and xemacs-packages-info to
  "# neededforbuild".
* Tue Aug 12 2003 mfabian@suse.de
- w3m-el-xemacs needs its own %%post and %%preun for install-info.
- don't just remove the %%{buildroot} from the comments in the .elc
  files, replace it with an equal amount of spaces in order not
  to change the offsets used for the docstrings.
* Tue Aug 12 2003 mfabian@suse.de
- update to 1.3.6
- remove %%{buildroot} from comments in .elc files to make it
  pass the build checks.
- add info files.
* Fri Jun 13 2003 mfabian@suse.de
- fix "directory not owned by any package".
* Thu Mar 06 2003 ro@suse.de
- removed cyrus-sasl from neededforbuild
* Tue Jan 14 2003 mfabian@suse.de
- update to 1.3.3
- disable obsolete w3m-el-1.2.6-select.patch
* Wed Nov 13 2002 ro@suse.de
- use x-devel-packages in neededforbuild
* Mon Aug 19 2002 mfabian@suse.de
- add (setq w3m-use-cookies t) to suse-start-w3m-el.el
* Sat Aug 17 2002 mfabian@suse.de
- fix parsing of cookie "expires" time string.
* Mon Aug 12 2002 mfabian@suse.de
- Update to version 1.3.1
- rm config.cache before configuring for XEmacs.
* Mon Aug 12 2002 ro@suse.de
- added canna-libs to neededforbuild
* Sun Jul 07 2002 schwab@suse.de
- Update to version 1.3.
* Tue Jun 04 2002 schwab@suse.de
- Fix requires.
* Thu Mar 21 2002 schwab@suse.de
- Update to version 1.2.6.
- Fix redisplay of checkboxes.
- Improve handling of <SELECT MULTIPLE>.
* Wed Mar 20 2002 mfabian@suse.de
- fix w3m-el-1.2.1-select.patch for XEmacs
  (in XEmacs, 'replace-regexp-in-string' is called
  'replace-in-string' and has a different order of parameters)
* Tue Mar 19 2002 schwab@suse.de
- Normalize whitespace and decode entities in <OPTION> text.
* Mon Mar 11 2002 schwab@suse.de
- Fix entities inside <AREA>.
* Tue Mar 05 2002 schwab@suse.de
- Fix handling of <SELECT MULTIPLE>.
* Tue Feb 12 2002 mfabian@suse.de
- merge w3m-el.spec and w3m-el-xemacs.spec (save a bit space
  in the source rpms)
- remove bogus suse-start.{el,elc}
* Tue Feb 12 2002 schwab@suse.de
- Fix entities inside <textarea>.
* Fri Feb 01 2002 ro@suse.de
- changed neededforbuild <libpng> to <libpng-devel-packages>
* Sun Jan 27 2002 mfabian@suse.de
- update to version 1.2.4
* Fri Nov 30 2001 mfabian@suse.de
- new package: w3m-el, version 1.2.1