2 # - use make < 3.82 (from th-obsolete) to hack on code, because 3.82
3 # invalidates built objects and it's annoying to wait if all is recompiled
4 # each time you invoke make
6 # - c++ errors on 64bit/32bit gcc 4.5.1-4:
7 # /usr/include/c++/4.5.1/bits/stl_map.h:87:5: instantiated from here
8 # /usr/include/c++/4.5.1/bits/stl_pair.h:77:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
9 # ./net/instaweb/util/public/cache_interface.h:28:7: error: forward declaration of ‘struct net_instaweb::SharedString’
10 # make[1]: *** [out/Release/obj.target/mod_pagespeed_test/net/instaweb/util/cache_fetcher_test.o] Error 1
11 # http://pastebin.com/Eu88BPSQ
12 # - sizeof(apr_int32_t) == sizeof(apr_int64_t) on 32bit (!?!):
13 # third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t':
14 # third_party/apache/apr/src/strings/apr_snprintf.c:500:5: error: duplicate case value
15 # third_party/apache/apr/src/strings/apr_snprintf.c:498:5: error: previously used here
16 # third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t_hex':
17 # third_party/apache/apr/src/strings/apr_snprintf.c:671:5: error: duplicate case value
18 # third_party/apache/apr/src/strings/apr_snprintf.c:669:5: error: previously used here
19 # - possible sysdeps (uses release tags)
20 # "serf_src": "http://serf.googlecode.com/svn/tags/0.3.1",
21 # "apr_src": "http://svn.apache.org/repos/asf/apr/apr/tags/1.4.2",
22 # "aprutil_src": "http://svn.apache.org/repos/asf/apr/apr-util/tags/1.3.9",
23 # "apache_httpd_src": "http://svn.apache.org/repos/asf/httpd/httpd/tags/2.2.15",
24 # "opencv_src": "https://code.ros.org/svn/opencv/tags/2.1",
25 # "gflags_root": "http://google-gflags.googlecode.com/svn/tags/gflags-1.3/src",
26 # "google_sparsehash_root": "http://google-sparsehash.googlecode.com/svn/tags/sparsehash-1.8.1/src",
28 %define svndate 20101104
30 %define mod_name pagespeed
31 %define apxs %{_sbindir}/apxs
32 Summary: Apache module for rewriting web pages to reduce latency and bandwidth
33 Name: apache-mod_%{mod_name}
37 Group: Networking/Daemons/HTTP
38 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
39 # install -d modpagespeed
41 # ../depot_tools/gclient config http://modpagespeed.googlecode.com/svn/trunk/src
42 # ../depot_tools/gclient sync
43 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
44 # (cd src/build && svnversion > LASTCHANGE.in)
46 # tar -cjf modpagespeed-$(date +%Y%m%d).tar.bz2 --exclude-vcs modpagespeed
47 # ../dropin modpagespeed-$(date +%Y%m%d).tar.bz2 &
48 Source0: modpagespeed-%{svndate}.tar.bz2
49 # Source0-md5: 1640f3c7226ffd3ba4a67f0064241495
50 URL: http://code.google.com/p/modpagespeed/
51 BuildRequires: %{apxs}
52 BuildRequires: apache-devel >= 2.2
53 BuildRequires: rpmbuild(macros) >= 1.268
54 Requires: apache(modules-api) = %apache_modules_api
55 Suggests: apache-mod_deflate
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
59 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
62 mod_pagespeed automates the application of those rules in an Apache
63 server. HTML, CSS, JavaScript, and images are changed dynamically
64 during the web serving process, so that the best practices recommended
65 by Page Speed can be used without having to change the way the web
69 %setup -q -n modpagespeed
71 cat > apache.conf <<EOF
72 LoadModule %{mod_name}_module modules/mod_%{mod_name}.so > apache.conf
74 $(cat src/install/common/pagespeed.conf.template)
78 cat > Makefile <<'EOF'
81 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
82 %{?with_verbose:V=1} \
87 LINK.host="%{__cxx}" \
88 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
89 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
94 rm -rf $RPM_BUILD_ROOT
95 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
96 install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
97 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
100 rm -rf $RPM_BUILD_ROOT
103 %service -q httpd restart
106 if [ "$1" = "0" ]; then
107 %service -q httpd restart
111 %defattr(644,root,root,755)
112 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
113 %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so