]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
- 0.9.18.9 tarball
[packages/apache-mod_pagespeed.git] / apache-mod_pagespeed.spec
CommitLineData
757b3ba5
ER
1#
2# Conditional build:
3%bcond_with verbose # verbose build (V=1)
4
b6a5d8d0
ER
5# NOTE
6# - use make < 3.82 (from th-obsolete) to hack on code, because 3.82
7# invalidates built objects and it's annoying to wait if all is recompiled
8# each time you invoke make
757b3ba5 9# - http://code.google.com/p/modpagespeed/wiki/HowToBuild
eb743e9a 10# - http://wiki.mediatemple.net/w/(dv)_HOWTO:_Install_mod_pagespeed
b6a5d8d0 11# TODO
757b3ba5 12# - add unit tests running
b6a5d8d0
ER
13# - c++ errors on 64bit/32bit gcc 4.5.1-4:
14# /usr/include/c++/4.5.1/bits/stl_map.h:87:5: instantiated from here
15# /usr/include/c++/4.5.1/bits/stl_pair.h:77:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
16# ./net/instaweb/util/public/cache_interface.h:28:7: error: forward declaration of ‘struct net_instaweb::SharedString’
17# make[1]: *** [out/Release/obj.target/mod_pagespeed_test/net/instaweb/util/cache_fetcher_test.o] Error 1
55f3a9d4 18# http://pastebin.com/Eu88BPSQ
b6a5d8d0
ER
19# - sizeof(apr_int32_t) == sizeof(apr_int64_t) on 32bit (!?!):
20# third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t':
21# third_party/apache/apr/src/strings/apr_snprintf.c:500:5: error: duplicate case value
22# third_party/apache/apr/src/strings/apr_snprintf.c:498:5: error: previously used here
23# third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t_hex':
24# third_party/apache/apr/src/strings/apr_snprintf.c:671:5: error: duplicate case value
25# third_party/apache/apr/src/strings/apr_snprintf.c:669:5: error: previously used here
26# - possible sysdeps (uses release tags)
27# "serf_src": "http://serf.googlecode.com/svn/tags/0.3.1",
28# "apr_src": "http://svn.apache.org/repos/asf/apr/apr/tags/1.4.2",
29# "aprutil_src": "http://svn.apache.org/repos/asf/apr/apr-util/tags/1.3.9",
30# "apache_httpd_src": "http://svn.apache.org/repos/asf/httpd/httpd/tags/2.2.15",
31# "opencv_src": "https://code.ros.org/svn/opencv/tags/2.1",
32# "gflags_root": "http://google-gflags.googlecode.com/svn/tags/gflags-1.3/src",
33# "google_sparsehash_root": "http://google-sparsehash.googlecode.com/svn/tags/sparsehash-1.8.1/src",
24f1647c
ER
34
35%if "%{pld_release}" == "ac"
36# add suffix, but allow ccache, etc in ~/.rpmmacros
37%{expand:%%define __cc %(echo '%__cc' | sed -e 's,-gcc,-gcc4,')}
38%{expand:%%define __cxx %(echo '%__cxx' | sed -e 's,-g++,-g++4,')}
39%{expand:%%define __cpp %(echo '%__cpp' | sed -e 's,-gcc,-gcc4,')}
40%endif
41
757b3ba5 42# - use only source for modpagespeed if system headers are used (remove copies from tarball)
08710a2f
ER
43%define mod_name pagespeed
44%define apxs %{_sbindir}/apxs
45Summary: Apache module for rewriting web pages to reduce latency and bandwidth
46Name: apache-mod_%{mod_name}
88eedd00 47Version: 0.9.18.9
757b3ba5 48Release: 0.4
08710a2f
ER
49License: Apache v2.0
50Group: Networking/Daemons/HTTP
757b3ba5 51Source0: modpagespeed-%{version}.tar.bz2
88eedd00 52# Source0-md5: 0a203c836c904db1b320ef6aae9a3661
08710a2f
ER
53URL: http://code.google.com/p/modpagespeed/
54BuildRequires: %{apxs}
55BuildRequires: apache-devel >= 2.2
24f1647c 56BuildRequires: libstdc++-devel >= 5:4.0
757b3ba5 57BuildRequires: python-devel >= 1:2.6
08710a2f 58BuildRequires: rpmbuild(macros) >= 1.268
24f1647c
ER
59# gcc4 might be installed, but not current __cc
60%if "%(echo %{cc_version} | cut -d. -f1,2)" < "4.0"
61BuildRequires: __cc >= 4.0
62%endif
08710a2f 63Requires: apache(modules-api) = %apache_modules_api
e5171f2e 64Requires: apache-mod_authz_host
b6a5d8d0 65Suggests: apache-mod_deflate
08710a2f
ER
66BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
06daee42
ER
69%define _pkgrootdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
70%define _sysconfdir %{_pkgrootdir}/conf.d
71%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
72%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
08710a2f
ER
73
74%description
75mod_pagespeed automates the application of those rules in an Apache
76server. HTML, CSS, JavaScript, and images are changed dynamically
77during the web serving process, so that the best practices recommended
78by Page Speed can be used without having to change the way the web
79site is maintained.
80
81%prep
e62ba6cb 82%setup -q -n modpagespeed
08710a2f
ER
83
84%build
eb743e9a 85# re-gen makefiles
e62ba6cb
ER
86cd src
87CC="%{__cc}" \
88CXX="%{__cxx}" \
89%{__python} build/gyp_chromium --format=make build/all.gyp
90cd ..
eb743e9a 91
e62ba6cb 92# makefile wrapper so we could just invoke "make" from shell
08710a2f
ER
93cat > Makefile <<'EOF'
94default:
95 $(MAKE) -C src \
96 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
97 %{?with_verbose:V=1} \
98 CC="%{__cc}" \
99 CXX="%{__cxx}" \
100 CC.host="%{__cc}" \
101 CXX.host="%{__cxx}" \
102 LINK.host="%{__cxx}" \
103 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
104 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
105EOF
106%{__make}
107
108%install
109rm -rf $RPM_BUILD_ROOT
06daee42
ER
110%{__make} -j1 -C src/install staging \
111 HOSTNAME=localhost \
112 APACHE_ROOT=%{_pkgrootdir} \
113 APACHE_MODULES=%{_pkglibdir} \
114 APACHE_DOC_ROOT=%{htdocsdir} \
115 MOD_PAGESPEED_FILE_ROOT=%{cachedir} \
116 STAGING_DIR=staging
117
dbd6833d 118cd src/install/staging
08710a2f
ER
119install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
120install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
06daee42
ER
121install -d $RPM_BUILD_ROOT%{cachedir}/{cache,files}
122cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
123LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
124
125$(cat pagespeed.conf)
126EOF
08710a2f
ER
127
128%clean
129rm -rf $RPM_BUILD_ROOT
130
131%post
132%service -q httpd restart
133
134%postun
135if [ "$1" = "0" ]; then
136 %service -q httpd restart
137fi
138
139%files
140%defattr(644,root,root,755)
08710a2f 141%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
b6a5d8d0 142%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
06daee42
ER
143
144%dir %attr(710,root,http) %{cachedir}
145%dir %attr(770,root,http) %{cachedir}/cache
146%dir %attr(770,root,http) %{cachedir}/files
This page took 0.392637 seconds and 4 git commands to generate.