%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 php-mode %define origver 1.2.0 %define release 1%{?_dist_release} Summary: PHP-mode for Emacsen Name: %{origname} Version: %{origver} Release: %{release} URL: http://sourceforge.net/projects/php-mode/ Source0: http://prdownloads.sourceforge.net/php-mode/php-mode-%{version}.tgz Source1: %{origname}-install.sh Source2: %{origname}-remove.sh License: GPL Group: Applications/Editors/Emacs Buildroot: %{_tmppath}/%{name}-%{version}-root BuildArchitectures: noarch PreReq: emacsen Requires: emacsen #Requires: speedbar %prereq_ge emacsen-common %description An Emacs major mode for editing PHP code. Features: Syntax coloring and indenting; Documentation browse and search functions; Support for Imenu and SpeedBar; Customization options %prep %setup -q -c %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 ### # install el files cp -a *.el ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname} ### # install script( bytecompile el and install elc , remove ) %_installemacsenscript %{origname} %{SOURCE1} %_removeemacsenscript %{origname} %{SOURCE2} %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) %{_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 * Thu Oct 09 2008 Shu KONNO 1.2.0-1vl5 - applied new versioning policy, spec in utf-8 - added macro %%emacsen_pkgdir * Tue Sep 12 2006 Ryoichi INAGAKI 1.2.0-0vl1 - new upstream release - changed ruby-mode Group to Appliations/Editors/Emacs * Mon Jul 22 2002 IWAI Masaharu 1.0.2-0vl1 - first build for Vine Linux