1 %define svndate 20101104
3 %define mod_name pagespeed
4 %define apxs %{_sbindir}/apxs
5 Summary: Apache module for rewriting web pages to reduce latency and bandwidth
6 Name: apache-mod_%{mod_name}
10 Group: Networking/Daemons/HTTP
11 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
12 # install -d modpagespeed
14 # ../depot_tools/gclient config http://modpagespeed.googlecode.com/svn/trunk/src
15 # ../depot_tools/gclient sync
17 # tar -cjf modpagespeed-$(date +%Y%m%d).tar.bz2 --exclude-vcs modpagespeed
18 # ../dropin modpagespeed-$(date +%Y%m%d).tar.bz2 &
19 Source0: modpagespeed-%{svndate}.tar.bz2
22 URL: http://code.google.com/p/modpagespeed/
23 BuildRequires: %{apxs}
24 BuildRequires: apache-devel >= 2.2
25 BuildRequires: rpmbuild(macros) >= 1.268
26 Requires: apache(modules-api) = %apache_modules_api
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
30 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
33 mod_pagespeed automates the application of those rules in an Apache
34 server. HTML, CSS, JavaScript, and images are changed dynamically
35 during the web serving process, so that the best practices recommended
36 by Page Speed can be used without having to change the way the web
40 %setup -q -n modpagespeed
43 cat > Makefile <<'EOF'
46 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
47 %{?with_verbose:V=1} \
52 LINK.host="%{__cxx}" \
53 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
54 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
61 install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
63 # module configuration
64 # - should contain LoadModule line
65 # - and directives must be between IfModule (so user could disable the module easily)
66 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
68 # or, if no directives needed, put just LoadModule line
69 echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \
70 $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
73 rm -rf $RPM_BUILD_ROOT
76 %service -q httpd restart
79 if [ "$1" = "0" ]; then
80 %service -q httpd restart
84 %defattr(644,root,root,755)
86 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
87 %attr(755,root,root) %{_pkglibdir}/*