]>
Commit | Line | Data |
---|---|---|
b6a5d8d0 ER |
1 | # NOTE |
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 | |
5 | # TODO | |
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 | # - sizeof(apr_int32_t) == sizeof(apr_int64_t) on 32bit (!?!): | |
12 | # third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t': | |
13 | # third_party/apache/apr/src/strings/apr_snprintf.c:500:5: error: duplicate case value | |
14 | # third_party/apache/apr/src/strings/apr_snprintf.c:498:5: error: previously used here | |
15 | # third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t_hex': | |
16 | # third_party/apache/apr/src/strings/apr_snprintf.c:671:5: error: duplicate case value | |
17 | # third_party/apache/apr/src/strings/apr_snprintf.c:669:5: error: previously used here | |
18 | # - possible sysdeps (uses release tags) | |
19 | # "serf_src": "http://serf.googlecode.com/svn/tags/0.3.1", | |
20 | # "apr_src": "http://svn.apache.org/repos/asf/apr/apr/tags/1.4.2", | |
21 | # "aprutil_src": "http://svn.apache.org/repos/asf/apr/apr-util/tags/1.3.9", | |
22 | # "apache_httpd_src": "http://svn.apache.org/repos/asf/httpd/httpd/tags/2.2.15", | |
23 | # "opencv_src": "https://code.ros.org/svn/opencv/tags/2.1", | |
24 | # "gflags_root": "http://google-gflags.googlecode.com/svn/tags/gflags-1.3/src", | |
25 | # "google_sparsehash_root": "http://google-sparsehash.googlecode.com/svn/tags/sparsehash-1.8.1/src", | |
26 | ||
08710a2f ER |
27 | %define svndate 20101104 |
28 | %define rel 0.1 | |
29 | %define mod_name pagespeed | |
30 | %define apxs %{_sbindir}/apxs | |
31 | Summary: Apache module for rewriting web pages to reduce latency and bandwidth | |
32 | Name: apache-mod_%{mod_name} | |
33 | Version: 0.9.0.0 | |
34 | Release: 0.1 | |
35 | License: Apache v2.0 | |
36 | Group: Networking/Daemons/HTTP | |
37 | # svn co http://src.chromium.org/svn/trunk/tools/depot_tools | |
38 | # install -d modpagespeed | |
39 | # cd modpagespeed | |
40 | # ../depot_tools/gclient config http://modpagespeed.googlecode.com/svn/trunk/src | |
41 | # ../depot_tools/gclient sync | |
b6a5d8d0 ER |
42 | # Populate the LASTCHANGE file template as we no longer have the VCS files at this point |
43 | # (cd src/build && svnversion > LASTCHANGE.in) | |
44 | # cd .. | |
08710a2f ER |
45 | # tar -cjf modpagespeed-$(date +%Y%m%d).tar.bz2 --exclude-vcs modpagespeed |
46 | # ../dropin modpagespeed-$(date +%Y%m%d).tar.bz2 & | |
47 | Source0: modpagespeed-%{svndate}.tar.bz2 | |
b6a5d8d0 | 48 | # Source0-md5: 1640f3c7226ffd3ba4a67f0064241495 |
08710a2f ER |
49 | URL: http://code.google.com/p/modpagespeed/ |
50 | BuildRequires: %{apxs} | |
51 | BuildRequires: apache-devel >= 2.2 | |
52 | BuildRequires: rpmbuild(macros) >= 1.268 | |
53 | Requires: apache(modules-api) = %apache_modules_api | |
b6a5d8d0 | 54 | Suggests: apache-mod_deflate |
08710a2f ER |
55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
56 | ||
57 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
58 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
59 | ||
60 | %description | |
61 | mod_pagespeed automates the application of those rules in an Apache | |
62 | server. HTML, CSS, JavaScript, and images are changed dynamically | |
63 | during the web serving process, so that the best practices recommended | |
64 | by Page Speed can be used without having to change the way the web | |
65 | site is maintained. | |
66 | ||
67 | %prep | |
68 | %setup -q -n modpagespeed | |
69 | ||
b6a5d8d0 ER |
70 | cat > apache.conf <<EOF |
71 | LoadModule %{mod_name}_module modules/mod_%{mod_name}.so > apache.conf | |
72 | ||
73 | $(cat src/install/common/pagespeed.conf.template) | |
74 | EOF | |
75 | ||
08710a2f ER |
76 | %build |
77 | cat > Makefile <<'EOF' | |
78 | default: | |
79 | $(MAKE) -C src \ | |
80 | BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \ | |
81 | %{?with_verbose:V=1} \ | |
82 | CC="%{__cc}" \ | |
83 | CXX="%{__cxx}" \ | |
84 | CC.host="%{__cc}" \ | |
85 | CXX.host="%{__cxx}" \ | |
86 | LINK.host="%{__cxx}" \ | |
87 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
88 | CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \ | |
89 | EOF | |
90 | %{__make} | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} | |
95 | install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
b6a5d8d0 | 96 | cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf |
08710a2f ER |
97 | |
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %post | |
102 | %service -q httpd restart | |
103 | ||
104 | %postun | |
105 | if [ "$1" = "0" ]; then | |
106 | %service -q httpd restart | |
107 | fi | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
08710a2f | 111 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf |
b6a5d8d0 | 112 | %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so |