%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		origver		0.35
%define		origname	develock

Name:		%{origname}
Version:	%{origver}
Summary:	(develock)additional font-lock keywords for the developers
Summary(ja):	(develock)開発者のための追加 font-lock キーワード群
Release:	1%{?_dist_release}
License:	GPL
Distribution:	Vine Linux
Vendor:		Project Vine
Group:		Applications/Editors/Emacs
Source0:	http://www.jpl.org/elips/%{origname}.el.gz
Source10:	%{origname}-install.sh
Source11:	%{origname}-remove.sh
Source12:	%{origname}-init.el
#Patch:		

Packager:	Hiroaki Irokawa <irorin@terra.dti.ne.jp>
URL:		http://www.jpl.org/elips/
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch

PreReq:       emacsen
%prereq_ge   emacsen-common


%description
Develock is a minor mode which provides the ability to make font-
lock highlight leading and trailing whitespace, long lines and
oddities in the file buffer for Lisp modes, ChangeLog mode, Texinfo
mode, C modes, Java mode, Jde-mode , CPerl mode, Perl mode, HTML
modes and some Mail modes.

%description -l ja
Develockは、LISP mode, ChangeLog mode, Texinfo mode, C mode, Java mode,
Jde-mode, CPerl mode, Perl mode, HTML mode, いくつかの Mail mode において
長過ぎる行、(インデントしてない)スペース等を強調表示するマイナーモードです。

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

#%setup -c %{origname}.%{origver}
rm -rf %{origname}-%{origver}
mkdir -p %{origname}-%{origver}
cd %{origname}-%{origver}
cp %{SOURCE0} .
gunzip develock.el.gz
#%patch -p1


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

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}
#mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/install
#mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/remove
mkdir -p ${RPM_BUILD_ROOT}%{emacsen_pkgdir}/install
mkdir -p ${RPM_BUILD_ROOT}%{emacsen_pkgdir}/remove

cp -a %{origname}-%{origver}/develock.el ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}
cp -a %{SOURCE12} ${RPM_BUILD_ROOT}/usr/share/emacs/site-lisp/%{origname}


%_installemacsenscript %{origname} %{SOURCE10}

%_removeemacsenscript  %{origname} %{SOURCE11}


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

%post

## bytecompile el and install elc

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)
%{_datadir}/emacs/site-lisp/%{origname}
#%{_libdir}/emacsen-common/packages/install/%{origname}
#%{_libdir}/emacsen-common/packages/remove/%{origname}
%{emacsen_pkgdir}/install/%{origname}
%{emacsen_pkgdir}/remove/%{origname}

%changelog
* Sun Sep 21 2008 Shu KONNO <owa@bg.wakwak.com> 0.35-1vl5
- applied new versioning policy, spec in utf-8

* Tue Nov 27 2007 IWAI, Masaharu <iwai@alib.jp> 0.35-0vl1
- new upstream release

* Wed Sep 13 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.26-0vl2
- changed Group to Appliations/Editors/Emacs <BTS:VineLinux:163>

* Thu May 19 2005 Hiroaki Irokawa <irorin@terra.dti.ne.jp> 0.26-0vl1
- 1st built for VineSeed
