]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
update url to point to module subpage
[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
e540e830 6# - relase notes: https://developers.google.com/speed/pagespeed/module/release_notes
757b3ba5 7# - http://code.google.com/p/modpagespeed/wiki/HowToBuild
eb743e9a 8# - http://wiki.mediatemple.net/w/(dv)_HOWTO:_Install_mod_pagespeed
b6a5d8d0 9# TODO
757b3ba5 10# - add unit tests running
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 16
08710a2f 17%define mod_name pagespeed
cad452c8 18%define apxs %{_sbindir}/apxs
08710a2f
ER
19Summary: Apache module for rewriting web pages to reduce latency and bandwidth
20Name: apache-mod_%{mod_name}
ce5a7d18 21Version: 1.5.27.2
9c41f6b1 22Release: 3
08710a2f
ER
23License: Apache v2.0
24Group: Networking/Daemons/HTTP
4623c72a 25Source0: modpagespeed-%{version}.tar.xz
ce5a7d18 26# Source0-md5: fa8d6a80fc4ca7f929910fa4eeb4a941
b74b29a5 27Source1: get-source.sh
5a3e561c 28Source2: gclient.conf
42a31ab3
ER
29Patch0: system-libs.patch
30Patch1: gcc-headers.patch
1a9213c5 31Patch2: bug-632.patch
b6382d61 32Patch3: opencv.patch
cad452c8 33Patch4: no-dev-stdout.patch
59548b66 34URL: https://developers.google.com/speed/pagespeed/module
08710a2f
ER
35BuildRequires: %{apxs}
36BuildRequires: apache-devel >= 2.2
42a31ab3 37BuildRequires: glib2-devel
3f27b998 38BuildRequires: gperf
42a31ab3 39BuildRequires: libselinux-devel
b74b29a5 40BuildRequires: libstdc++-devel >= 5:4.1
4623c72a 41BuildRequires: opencv-devel >= 2.3.1
42a31ab3 42BuildRequires: openssl-devel
3f27b998 43BuildRequires: pkgconfig
757b3ba5 44BuildRequires: python-devel >= 1:2.6
4623c72a
ER
45# This version of gyp is new enough that it knows to use make for Linux 3.x
46# and FreeBSD, but old enough that 'type': 'settings' works and
47# LINKER_SUPPORTS_ICF hasn't been removed yet.
3fbdacfc 48BuildRequires: python-gyp >= 0.1-0.svn1602.1
08710a2f 49BuildRequires: rpmbuild(macros) >= 1.268
4623c72a 50BuildRequires: tar >= 1:1.22
2ddcd200 51BuildRequires: util-linux
4623c72a 52BuildRequires: xz
42a31ab3 53BuildRequires: zlib-devel
08710a2f 54Requires: apache(modules-api) = %apache_modules_api
e5171f2e 55Requires: apache-mod_authz_host
3f27b998 56Requires: apache-mod_headers
b6a5d8d0 57Suggests: apache-mod_deflate
08710a2f
ER
58BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
06daee42
ER
61%define _pkgrootdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
62%define _sysconfdir %{_pkgrootdir}/conf.d
63%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
64%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
08710a2f
ER
65
66%description
67mod_pagespeed automates the application of those rules in an Apache
68server. HTML, CSS, JavaScript, and images are changed dynamically
69during the web serving process, so that the best practices recommended
70by Page Speed can be used without having to change the way the web
71site is maintained.
72
73%prep
5bdfa704
ER
74%setup -q -n modpagespeed-%{version}
75%patch0 -p2
76%patch1 -p2
ce5a7d18 77%patch2 -p1
b6382d61 78%patch3 -p3
9c41f6b1 79%patch4 -p1
08710a2f
ER
80
81%build
eb743e9a 82# re-gen makefiles
e62ba6cb
ER
83CC="%{__cc}" \
84CXX="%{__cxx}" \
5bdfa704
ER
85%{__python} build/gyp_chromium \
86 --format=make \
87 --depth=. \
88 build/all.gyp \
42a31ab3
ER
89 -Duse_openssl=1 \
90 -Duse_system_apache_dev=1 \
91 -Duse_system_libjpeg=1 \
92 -Duse_system_libpng=1 \
93 -Duse_system_opencv=1 \
94 -Duse_system_zlib=1 \
b2f50394
ER
95 -Dsystem_include_path_apr=%{_includedir}/apr \
96 -Dsystem_include_path_aprutil=%{_includedir}/apr-util \
97 -Dsystem_include_path_httpd=%{_includedir}/apache \
42a31ab3
ER
98 %{nil}
99
1a9213c5 100%{__make} mod_pagespeed js_minify css_minify_main \
08710a2f
ER
101 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
102 %{?with_verbose:V=1} \
103 CC="%{__cc}" \
104 CXX="%{__cxx}" \
105 CC.host="%{__cc}" \
106 CXX.host="%{__cxx}" \
107 LINK.host="%{__cxx}" \
108 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
109 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
5bdfa704 110 %{nil}
08710a2f
ER
111
112%install
113rm -rf $RPM_BUILD_ROOT
1a9213c5
ER
114install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_bindir},%{cachedir}}
115
5bdfa704 116%{__make} -j1 -C install staging_except_module \
06daee42 117 APACHE_ROOT=%{_pkgrootdir} \
3f27b998 118 APACHE_MODULES=modules \
06daee42 119 APACHE_DOC_ROOT=%{htdocsdir} \
5bdfa704
ER
120 MOD_PAGESPEED_CACHE=%{cachedir} \
121 MOD_PAGESPEED_STATS_LOG=/var/log/httpd/mod_pagespeed_stats.log \
06daee42
ER
122 STAGING_DIR=staging
123
1a9213c5
ER
124out=out/%{!?debug:Release}%{?debug:Debug}
125install -p $out/libmod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
126install -p $out/js_minify $RPM_BUILD_ROOT%{_bindir}/pagespeed_js_minify
127install -p $out/css_minify_main $RPM_BUILD_ROOT%{_bindir}/pagespeed_css_minify
128
5bdfa704 129cd install/staging
06daee42
ER
130cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
131LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
132
133$(cat pagespeed.conf)
134EOF
08710a2f 135
1a9213c5
ER
136cp -p pagespeed_libraries.conf $RPM_BUILD_ROOT%{_sysconfdir}/91_mod_%{mod_name}_libraries.conf
137
3f27b998
ER
138install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
139cp -a mod_pagespeed_example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
140
08710a2f
ER
141%clean
142rm -rf $RPM_BUILD_ROOT
143
144%post
145%service -q httpd restart
146
147%postun
148if [ "$1" = "0" ]; then
149 %service -q httpd restart
150fi
151
152%files
153%defattr(644,root,root,755)
08710a2f 154%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
1a9213c5
ER
155%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}_libraries.conf
156%attr(755,root,root) %{_bindir}/pagespeed_css_minify
157%attr(755,root,root) %{_bindir}/pagespeed_js_minify
b6a5d8d0 158%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
3f27b998 159%{_examplesdir}/%{name}-%{version}
5bdfa704 160%dir %attr(770,root,http) %{cachedir}
This page took 0.11721 seconds and 4 git commands to generate.