%define       _noVersionedDependencies        1
%define       prereq_ge()   %(LC_ALL="C" rpm -q --queryformat 'PreReq:%%{NAME} >= %%{VERSION}' %1| grep -v "is not")
%define       origname      html-helper-mode
%define       origver       2.19.1.1
%define       release       7
%define       emacsen_pkgdir /usr/lib/emacsen-common/packages

# Main
Summary: Major mode for editing HTML (for Emacsen)
Name: %{origname}
Version: %{origver}
Release: %{release}%{?_dist_release}
License: GPLv2+
Group: Applications/Editors/Emacs
URL: http://www.santafe.edu/~nelson/tools/
Source0: http://www.santafe.edu/~nelson/hhm-beta/html-helper-mode.el
Source1: http://www.santafe.edu/~nelson/hhm-beta/tempo.el
Source2: http://www.santafe.edu/~nelson/hhm-beta/index.html
Source3: http://www.santafe.edu/~nelson/tools/configuring.html
Source4: http://www.santafe.edu/~nelson/tools/differences.html
Source5: http://www.santafe.edu/~nelson/tools/documentation.html
Source6: http://www.santafe.edu/~nelson/tools/keybindings.html
Source7: hhm.dot.emacs
Source8: HHM-MK
Source9: html-helper-mode-install.sh
Source10: html-helper-mode-remove.sh
Source11: vine-default-%{origname}.el
Source12: %{origname}-init.el
Buildroot: %{_tmppath}/%{name}-root
PreReq:       emacsen
Requires:     emacsen
%prereq_ge emacsen-common

BuildArchitectures: noarch
#Obsoletes: %{name}-2.19.1.1-3

Vendor: Project Vine
Distribution: Vine Linux

%description
html-helper-mode makes it easier to write HTML documents.
This mode handles inserting HTML codes in a variety of ways
(keybindings, completion in the buffer).
It also supports indentation, timestamps, skeletons for new documents,
hilit19 patterns, and a variety of other things.

Initialization
===============
Please refer the following file:
  "%{_docdir}/%{name}-%{version}/hhm.dot.emacs"
  "%{_docdir}/%{name}-%{version}/*.html"

%description -l ja
html-helper-mode は、HTML ドキュメントの作成を簡単にします。
このモードでは、HTML コードの挿入に多様な方法が使えます。
また、INDENTATION、タイムスタンプ等をサポートします。

初期設定
=========
下記を参考にしてください:
  "%{_docdir}/%{name}-%{version}/hhm.dot.emacs"
  "%{_docdir}/%{name}-%{version}/*.html"

# '
%prep
%setup -q -T -c %{name}-%{version}
cp %SOURCE0 ./
cp %SOURCE1 ./
cp %SOURCE2 ./
cp %SOURCE3 ./
cp %SOURCE4 ./
cp %SOURCE5 ./
cp %SOURCE6 ./
cp %SOURCE7 ./
cp %SOURCE8 ./

%build
# byte-compile
#emacs-%{emacsver} -batch -l HHM-MK

%install
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
[ "${RPM_BUILD_ROOT}" != "/" ] && mkdir -p ${RPM_BUILD_ROOT}

mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}/packages
mkdir -p %{buildroot}%{emacsen_pkgdir}/install
mkdir -p %{buildroot}%{emacsen_pkgdir}/remove

#
# install el files
# 
cp -a html-helper-mode.el tempo.el HHM-MK %{SOURCE11} %{SOURCE12} \
      ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}

#
# install  script( bytecompile el and install elc , remove )   
#
%_installemacsenscript %{origname} %{SOURCE9} 

%_removeemacsenscript  %{origname} %{SOURCE10}

%post
#
# bytecompile and install 
#

if [ "$1" = 2 ]; then

%_emacsenPackageRemove %{origname}

fi

%_addemacsenlist %{origname}

%_emacsenPackageInstall %{origname}


%preun
if [ "$1" = 0 ]; then

%_emacsenPackageRemove %{origname}

%_removeemacsenlist %{origname}

fi

%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}

rm -rf ${RPM_BUILD_DIR}/%{origname}-%{origver}


%files 
%defattr(-,root,root)
%doc *.html hhm.dot.emacs
%{_datadir}/emacs/site-lisp/%{origname}
%{emacsen_pkgdir}/install/%{origname}
%{emacsen_pkgdir}/remove/%{origname}

%changelog
* Mon Apr 19 2010 IWAI, Masaharu <iwai@alib.jp> 2.19.1.1-7
- fix html-helper-mode-install.sh: installing vine-default file

* Wed Apr  7 2010 IWAI, Masaharu <iwai@alib.jp> 2.19.1.1-6
- apply vine-default
 - add vine-default (Source11)
 - add init.el (Source12)
 - update html-helper-mode-{install,removce}.sh for init.el file
- using %%{emacsen_pkgdir} macro
- update %%description

* Wed May 06 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.19.1.1-5
- spec in utf8
- applied new versioning policy

* Tue Sep 12 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.19.1.1-4vl3
- changed Group to Appliations/Editors/Emacs <BTS:VineLinux:163>
- s/Copyright/License/

* Wed Jan  2 2002 IWAI Masaharu <iwaim@cc.mbn.or.jp> 2.19.1.1-4vl2
- emacsenize
- rewrite Summary and %%description for emacesnize 

* Sun Oct 15 2000 Jun Nishii <jun@vinelinux.org>
- 2.19.1.1-4vl1
- rebuid for Vine Linux 2.1/emacs-20.7

* Mon Apr 17 2000 Jun Nishii <jun@vinelinux.org>
- rebuid for Vine Linux 2.0

* Fri Dec 17 1999 Ushio Tadaaki <t-ushio@fb3.so-net.ne.jp>
- Released as version "html-helper-mode-emacs20-2.19.1.1-3".

Changed from "html-helper-mode-emacs20-2.19.1.1-2".
- Changed emacs version, "20.4" => "20.5".
- Revised some, the definition part of data.
 
* Thu Dec  2 1999 Ushio Tadaaki <t-ushio@fb3.so-net.ne.jp>
- Released as version "html-helper-mode-emacs20-2.19.1.1-2".

Changed from "html-helper-mode-emacs20-2.19.1.1-1".
- Added source file, "HHM-MK".
- Revised some, the definition part of data. 
- Revised some, part of "%description, %build".

* Thu Nov 25 1999 Ushio Tadaaki <t-ushio@fb3.so-net.ne.jp>
- Released as version "html-helper-mode-emacs20-2.19.1.1-1".

# $Id: html-helper-mode-emacs20-2.19.1.1.spec,v 1.7 1999-12-17 17:50:58+09 ushio Exp $
