Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > bbf63cb0df88d73dcc759a3b7ffb3724 > files > 2

apache-mod_highlight-0.2.0-1mdv2007.0.src.rpm

#Module-Specific definitions
%define mod_name mod_highlight
%define mod_conf A55_%{mod_name}.conf
%define mod_so %{mod_name}.so

Summary:	Mod_highlight provdes syntax highlighting as an Apache 2.0 Filter Module
Name:		apache-%{mod_name}
Version:	0.2.0
Release:	%mkrel 1
Group:		System/Servers
License:	Apache License
URL:		http://www.outoforder.cc/projects/apache/mod_highlight/
Source0:	mod_highlight-%{version}.tar.bz2
Source1:	%{mod_conf}.bz2
Patch0:		mod_highlight-external_colorer.diff
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache >= 2.0.54
Requires:	apache-conf >= 2.0.54
Requires:	apache >= 2.0.54
BuildRequires:	apache-devel >= 2.0.54
BuildRequires:	file
BuildRequires:	libcolorer-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
mod_highlight provdes syntax highlighting as an Apache 2.0 Filter Module. By
Embeding the Colorer-Take5 library the module can process just about any
programing language.

%prep

%setup -q -n %{mod_name}
%patch0 -p1

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

%build
sh ./autogen.sh

%configure2_5x \
    --with-apxs=%{_sbindir}/apxs

%make

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

install -d %{buildroot}%{_libdir}/apache-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d

install -m0755 .libs/mod_highlight.so %{buildroot}%{_libdir}/apache-extramodules/

bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf}

install -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

%post
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

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

%files
%defattr(-,root,root)
%doc doc/* tmpl/* ChangeLog README* TODO
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache-extramodules/mod_highlight.so
%{_var}/www/html/addon-modules/*

%changelog
* Mon Mar 20 2006 Oden Eriksson <oeriksson@mandriva.com> 0.2.0-1mdk
- initial Mandriva package