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

Summary:      A major mode for editing .pod-files in (X)Emacs
Summary(ja):  (X)Emacs で POD ファイルを編集するためのメジャーモード
Name:         %{origname}
Version:      %{origver}
Release:      2%{?_dist_release}

Source0:      http://search.cpan.org/CPAN/authors/id/S/SC/SCHWIGON/pod-mode/pod-mode-%{version}.tgz
Source1:      %{origname}-install.sh
Source2:      %{origname}-remove.sh
Source3:      vine-default-pod-mode.el
Source4:      pod-mode-init.el

License:      GPL
Group:        Applications/Editors/Emacs
URL:          http://search.cpan.org/author/SCHWIGON/pod-mode/
BuildRoot:    %{_tmppath}/%{name}-%{version}-root
BuildArch:    noarch

Requires:     emacsen
PreReq:       emacsen
%prereq_ge    emacsen-common

Distribution: Vine Linux
Vendor:       Project Vine


%description
pod-mode.el - A major mode for editing .pod-files in (X)Emacs

POD is the Plain Old Documentation format of Perl.
This mode mainly defines a grammar for syntax highlighting.

%description -l ja
pod-mode.el - (X)Emacs で POD ファイルを編集するためのメジャー
モード

POD は Plain Old Documentation format of Perl という意味です。
このモードは、構文ハイライトのための文法を定義している程度です。

%prep

%setup -q -n %{origname}-%{origver}

%build

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

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 -p *.el %{SOURCE3} %{SOURCE4} %{buildroot}%{_datadir}/emacs/site-lisp/%{origname}


#
# install script (bytecompile el and install elc , remove)
#

%_installemacsenscript %{origname} %{SOURCE1}

%_removeemacsenscript  %{origname} %{SOURCE2}


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

%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


%files
%defattr(-,root,root)
%doc README ChangeLog
%{_datadir}/emacs/site-lisp/%{origname}
%{emacsen_pkgdir}/install/%{origname}
%{emacsen_pkgdir}/remove/%{origname}


%changelog
* Tue Apr  6 2010 IWAI, Masaharu <iwai@alib.jp> 0.5-2
- correct output message on js2-mode-install.sh (SOURCE1)

* Mon Dec 21 2009 IWAI, Masaharu <iwai@alib.jp> 0.5-1
- new upstream release
- apply vine-default
  - add vine-default-pod-mode.el (Source3)
  - add pod-mode-init.el (Source4)
  - update pod-mode-{install,remove}.sh

* Thu Oct 09 2008 Shu KONNO <owa@bg.wakwak.com> 0.4-1vl5
- applied new versioning policy, spec in utf-8
- added macro %%emacsen_pkgdir

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

* Fri Oct 22 2004 IWAI, Masaharu <iwai@alib.jp> 0.2-0vl2
- add Japanese description

* Sat May 24 2003 IWAI Masaharu <iwai@alib.jp> 0.2-0vl1
- first release for Vine Linux
