Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > 10f11c716445836478e5c706d5f16a71 > files > 2

apache-mod_countm-2.0.54_3.0-2mdk.src.rpm

#Module-Specific definitions
%define mod_version 3.0
%define mod_name mod_countm
%define mod_conf A22_%{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_countm is a DSO module for the apache web server
Name:		%{name}
Version:	%{version}
Release:	%mkrel 2
Group:		System/Servers
License:	BSD
URL:		http://sourceforge.net/projects/countm/
Source0:	%{sourcename}.tar.bz2
Source1:	%{mod_conf}.bz2
BuildRequires:	gd-devel
BuildRequires:	png-devel 
BuildRequires:	freetype-devel
BuildRequires:	libjpeg-devel
BuildRequires:	db4-devel
BuildRequires:	zlib-devel
PreReq:		rpm-helper
#Requires:	fonts-ttf-west_european
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
Provides:	apache2-mod_countm
Obsoletes:	apache2-mod_countm
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
An apache only module serving link counting information via jpeg
and png images. Configuration commands include font selection,
font size, image type, image background and text color, digit
width, reset, ignore, access list database, and random.

%prep

%setup -q -n %{mod_name}-%{mod_version}

# 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 -L%{_libdir} -lgd -lfreetype -ljpeg -lpng -lm -ldb -c mod_countm.c version.c

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

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 -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

install -d %{buildroot}/var/lib/%{mod_name}/dbase

# install the font..., i have no clue where to put it, 
# so i go by intuition and educated wild guessing...
install -d %{buildroot}%{_datadir}/fonts/ttf/western
install -m0644 FreeMono.ttf %{buildroot}%{_datadir}/fonts/ttf/western/

%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 *.html manual.txt
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*
%attr(0755,apache,apache) %dir /var/lib/%{mod_name}
%attr(0755,apache,apache) %dir /var/lib/%{mod_name}/dbase
%attr(0644,root,root) %{_datadir}/fonts/ttf/western/FreeMono.ttf

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

* Thu Jun 02 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_3.0-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_3.0-4mdk
- use the %%mkrel macro

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.0-3mdk
- fix %%post and %%postun to prevent double restarts
- fix bug #6574

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.0-2mdk
- spec file cleanups, remove the ADVX-build stuff

* Tue Feb  8 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.0-1mdk
- rebuilt for apache 2.0.53

* Tue Sep 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_3.0-1mdk
- built for apache 2.0.52

* Thu Sep 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_3.0-1mdk
- built for apache 2.0.51

* Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_3.0-1mdk
- built for apache 2.0.50
- remove redundant provides

* Mon Jun 14 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.49_3.0-1mdk
- built for apache 2.0.49

* Wed Dec 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_3.0-1mdk
- 3.0
- really activate the provided font

* Wed Nov 19 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_2.1-1mdk
- 2.1
- drop the cvs patch, it's included
- include the provided font

* Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_2.0-1mdk
- built for apache 2.0.48

* Wed Oct 01 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_2.0-1mdk
- initial cooker contrib
- removed copyrighted ttf from the tarball