]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
- release 1
[packages/apache-mod_pagespeed.git] / apache-mod_pagespeed.spec
CommitLineData
757b3ba5
ER
1#
2# Conditional build:
42a31ab3 3%bcond_without verbose # verbose build (V=1)
757b3ba5 4
b6a5d8d0 5# NOTE
757b3ba5 6# - http://code.google.com/p/modpagespeed/wiki/HowToBuild
eb743e9a 7# - http://wiki.mediatemple.net/w/(dv)_HOWTO:_Install_mod_pagespeed
b6a5d8d0 8# TODO
757b3ba5 9# - add unit tests running
42a31ab3 10# - use only source for modpagespeed if system headers are used (remove copies from tarball)
b6a5d8d0
ER
11# - possible sysdeps (uses release tags)
12# "serf_src": "http://serf.googlecode.com/svn/tags/0.3.1",
b6a5d8d0
ER
13# "gflags_root": "http://google-gflags.googlecode.com/svn/tags/gflags-1.3/src",
14# "google_sparsehash_root": "http://google-sparsehash.googlecode.com/svn/tags/sparsehash-1.8.1/src",
b74b29a5 15# protobuf_lite
24f1647c
ER
16
17%if "%{pld_release}" == "ac"
18# add suffix, but allow ccache, etc in ~/.rpmmacros
19%{expand:%%define __cc %(echo '%__cc' | sed -e 's,-gcc,-gcc4,')}
20%{expand:%%define __cxx %(echo '%__cxx' | sed -e 's,-g++,-g++4,')}
21%{expand:%%define __cpp %(echo '%__cpp' | sed -e 's,-gcc,-gcc4,')}
22%endif
23
08710a2f
ER
24%define mod_name pagespeed
25%define apxs %{_sbindir}/apxs
26Summary: Apache module for rewriting web pages to reduce latency and bandwidth
27Name: apache-mod_%{mod_name}
b74b29a5 28Version: 0.10.22.4
e93833f4 29Release: 1
08710a2f
ER
30License: Apache v2.0
31Group: Networking/Daemons/HTTP
757b3ba5 32Source0: modpagespeed-%{version}.tar.bz2
8b0b4e3f 33# Source0-md5: 447f11184ab8b82f59b07a3e3b99425a
b74b29a5 34Source1: get-source.sh
42a31ab3
ER
35Patch0: system-libs.patch
36Patch1: gcc-headers.patch
b74b29a5 37URL: https://developers.google.com/speed/pagespeed/
08710a2f
ER
38BuildRequires: %{apxs}
39BuildRequires: apache-devel >= 2.2
42a31ab3 40BuildRequires: glib2-devel
3f27b998 41BuildRequires: gperf
42a31ab3 42BuildRequires: libjpeg-devel
42a31ab3 43BuildRequires: libselinux-devel
b74b29a5 44BuildRequires: libstdc++-devel >= 5:4.1
42a31ab3
ER
45BuildRequires: opencv-devel
46BuildRequires: openssl-devel
3f27b998 47BuildRequires: pkgconfig
757b3ba5 48BuildRequires: python-devel >= 1:2.6
2ddcd200 49BuildRequires: python-gyp
08710a2f 50BuildRequires: rpmbuild(macros) >= 1.268
2ddcd200 51BuildRequires: util-linux
42a31ab3 52BuildRequires: zlib-devel
24f1647c
ER
53# gcc4 might be installed, but not current __cc
54%if "%(echo %{cc_version} | cut -d. -f1,2)" < "4.0"
55BuildRequires: __cc >= 4.0
56%endif
08710a2f 57Requires: apache(modules-api) = %apache_modules_api
e5171f2e 58Requires: apache-mod_authz_host
3f27b998 59Requires: apache-mod_headers
b6a5d8d0 60Suggests: apache-mod_deflate
08710a2f
ER
61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
06daee42
ER
64%define _pkgrootdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
65%define _sysconfdir %{_pkgrootdir}/conf.d
66%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
67%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
08710a2f
ER
68
69%description
70mod_pagespeed automates the application of those rules in an Apache
71server. HTML, CSS, JavaScript, and images are changed dynamically
72during the web serving process, so that the best practices recommended
73by Page Speed can be used without having to change the way the web
74site is maintained.
75
76%prep
e62ba6cb 77%setup -q -n modpagespeed
42a31ab3
ER
78%patch0 -p1
79%patch1 -p1
08710a2f
ER
80
81%build
eb743e9a 82# re-gen makefiles
e62ba6cb
ER
83cd src
84CC="%{__cc}" \
85CXX="%{__cxx}" \
42a31ab3 86%{__python} build/gyp_chromium --format=make build/all.gyp \
42a31ab3
ER
87 -Duse_openssl=1 \
88 -Duse_system_apache_dev=1 \
89 -Duse_system_libjpeg=1 \
90 -Duse_system_libpng=1 \
91 -Duse_system_opencv=1 \
92 -Duse_system_zlib=1 \
42a31ab3
ER
93 %{nil}
94
e62ba6cb 95cd ..
eb743e9a 96
e62ba6cb 97# makefile wrapper so we could just invoke "make" from shell
08710a2f 98cat > Makefile <<'EOF'
8b0b4e3f 99# target names from build/all.gyp
08710a2f 100default:
8b0b4e3f 101 $(MAKE) -C src mod_pagespeed \
08710a2f
ER
102 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
103 %{?with_verbose:V=1} \
104 CC="%{__cc}" \
105 CXX="%{__cxx}" \
106 CC.host="%{__cc}" \
107 CXX.host="%{__cxx}" \
108 LINK.host="%{__cxx}" \
109 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
110 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
42a31ab3 111 $(MAKEFLAGS) \
08710a2f
ER
112EOF
113%{__make}
114
115%install
116rm -rf $RPM_BUILD_ROOT
3f27b998
ER
117install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{cachedir}/{cache,files}}
118%{__make} -j1 -C src/install staging_except_module \
06daee42
ER
119 HOSTNAME=localhost \
120 APACHE_ROOT=%{_pkgrootdir} \
3f27b998 121 APACHE_MODULES=modules \
06daee42
ER
122 APACHE_DOC_ROOT=%{htdocsdir} \
123 MOD_PAGESPEED_FILE_ROOT=%{cachedir} \
124 STAGING_DIR=staging
125
3f27b998 126install -p src/out/Release/libmod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
dbd6833d 127cd src/install/staging
06daee42
ER
128cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
129LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
130
131$(cat pagespeed.conf)
132EOF
08710a2f 133
3f27b998
ER
134install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
135cp -a mod_pagespeed_example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136
08710a2f
ER
137%clean
138rm -rf $RPM_BUILD_ROOT
139
140%post
141%service -q httpd restart
142
143%postun
144if [ "$1" = "0" ]; then
145 %service -q httpd restart
146fi
147
148%files
149%defattr(644,root,root,755)
08710a2f 150%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
b6a5d8d0 151%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
3f27b998 152%{_examplesdir}/%{name}-%{version}
06daee42
ER
153
154%dir %attr(710,root,http) %{cachedir}
155%dir %attr(770,root,http) %{cachedir}/cache
156%dir %attr(770,root,http) %{cachedir}/files
This page took 0.043321 seconds and 4 git commands to generate.