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