Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > 1de4b00a28723e65eb9ce36558c9cac3 > files > 2

apache-mod_chm-2.0.54_0.3.1-2mdk.src.rpm

#Module-Specific definitions
%define mod_version 0.3.1
%define mod_name mod_chm
%define mod_conf A33_%{mod_name}.conf
%define mod_so %{mod_name}.so
%define sourcename %{mod_name}-%{mod_version}

%define apache_version 2.0.54

# Standard Module Definitions
%define name apache-%{mod_name}
%define version %{apache_version}_%{mod_version}

Summary:	Mod_chm is a DSO module for the apache Web server
Name:		%{name}
Version:	%{version}
Release:	%mkrel 2
Group:		System/Servers
License:	GPL
URL:		http://sourceforge.net/projects/modchm/
Source0: 	http://prdownloads.sourceforge.net/modchm/%{mod_name}-%{mod_version}.tar.bz2
Source1:	%{mod_conf}.bz2
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache >= %{apache_version}
Requires:	apache-conf >= 2.0.54
Requires:	apache >= %{apache_version}
BuildRequires:	apache-devel >= %{apache_version}
BuildRequires:	file
BuildRequires:	perl
BuildRequires:	chmlib-devel
Provides:	apache2-mod_chm
Obsoletes:	apache2-mod_chm
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
mod_chm is an apache module that gives you possibility to explore
files in CHM format. mod_chm uses chmlib by Jed Wing to access CHM
files. This package also includes chmdump program that unpacks
content of CHM file.

%prep

%setup -q -n mod_chm

# 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

%{_sbindir}/apxs -c %{mod_name}.c -I. -lchm

gcc %{optflags} chmdump/chmdump.c -o chmdump/chmdump -lchm

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

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

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf}

install -m0755 chmdump/chmdump %{buildroot}%{_bindir}/

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 AUTHORS COPYING ChangeLog README TODO
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_bindir}/chmdump
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*

%changelog
* Sat Jul 30 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_0.3.1-2mdk
- fix deps

* Thu Jun 02 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_0.3.1-1mdk
- rename the package
- the conf.d directory is renamed to modules.d
- use new rpm-4.4.x pre,post magic

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.3.1-2mdk
- use the %%mkrel macro

* Wed Mar 02 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.3.1-1mdk
- initial Mandrakelinux package