]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
get-source fails with depot_tools without git support
[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
a673cf5a
ER
10# - run unit tests
11# third_party libraries:
12# - apr - using system apr package
13# - aprutil - using system apr-util, but from this repo modified apr_memcache2.c
14# - gflags - system package may work
15# - giflib - 4.1.6, no local modifications
16# - google-sparsehash
17# - httpd, httpd24 - using system apache-devel
18# - icu - using system icu
19# - jsoncpp - no local changes
20# - libjpeg_turbo - 1.2.80 with chromium changes (but system lib should be fine)
21# - libpng - no local changes
22# - libwebp - 0.4.0, irrelevant local changes
23# - optipng - 0.7.4, local changes: only the opngreduc component of optipng is included.
24# - protobuf - should be possible to use full protobuf (not lite) to gain same functionality
25# - re2 - should be possible to use system re2
26# - serf - 0.7.2 bunch of google fixes
27# - zlib - 1.2.5, no local changes
28#
29# third_party/chromium/src/base/third_party:
30# - nspr - should be possible to use system lib
31# - dmg_fp
32# - dynamic_annotations
33# - icu - not icu lib, but two files only
34# - valgrind
35#
36# could be possible to use system libs, not packaged in pld:
37# - base64
38# - chromium
39# - chromium_deps
40# - css_parser
41# - domain_registry_provider
42# - instaweb
43# - mod_spdy
44# - modp_b64
45# - rdestl
24f1647c 46
08710a2f 47%define mod_name pagespeed
cad452c8 48%define apxs %{_sbindir}/apxs
08710a2f
ER
49Summary: Apache module for rewriting web pages to reduce latency and bandwidth
50Name: apache-mod_%{mod_name}
21b9e54a 51# beta: 1.9.32.x-beta
36c8c93e
ER
52# stable: 1.9.32.x-stable
53Version: 1.9.32.4
54Release: 0.1
08710a2f
ER
55License: Apache v2.0
56Group: Networking/Daemons/HTTP
4623c72a 57Source0: modpagespeed-%{version}.tar.xz
36c8c93e 58# Source0-md5: c902122f7d85d4e43cad92911ad59a85
b74b29a5 59Source1: get-source.sh
5a3e561c 60Source2: gclient.conf
42a31ab3 61Patch0: system-libs.patch
1a9213c5 62Patch2: bug-632.patch
cad452c8 63Patch4: no-dev-stdout.patch
a16986b1 64Patch5: apache24-config.patch
59548b66 65URL: https://developers.google.com/speed/pagespeed/module
08710a2f
ER
66BuildRequires: %{apxs}
67BuildRequires: apache-devel >= 2.2
ffebf8bc 68BuildRequires: bash
42a31ab3 69BuildRequires: glib2-devel
3f27b998 70BuildRequires: gperf
99c7dfcb 71BuildRequires: libicu-devel
42a31ab3 72BuildRequires: libselinux-devel
b74b29a5 73BuildRequires: libstdc++-devel >= 5:4.1
4623c72a 74BuildRequires: opencv-devel >= 2.3.1
42a31ab3 75BuildRequires: openssl-devel
3f27b998 76BuildRequires: pkgconfig
757b3ba5 77BuildRequires: python-devel >= 1:2.6
5eafce75 78BuildRequires: yasm
4623c72a
ER
79# This version of gyp is new enough that it knows to use make for Linux 3.x
80# and FreeBSD, but old enough that 'type': 'settings' works and
81# LINKER_SUPPORTS_ICF hasn't been removed yet.
3fbdacfc 82BuildRequires: python-gyp >= 0.1-0.svn1602.1
08710a2f 83BuildRequires: rpmbuild(macros) >= 1.268
4623c72a 84BuildRequires: tar >= 1:1.22
2ddcd200 85BuildRequires: util-linux
4623c72a 86BuildRequires: xz
42a31ab3 87BuildRequires: zlib-devel
22e6311f 88BuildConflicts: depot_tools < 0.1-0.20150708
08710a2f 89Requires: apache(modules-api) = %apache_modules_api
e5171f2e 90Requires: apache-mod_authz_host
3f27b998 91Requires: apache-mod_headers
b6a5d8d0 92Suggests: apache-mod_deflate
08710a2f
ER
93BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
94
95%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
06daee42
ER
96%define _pkgrootdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
97%define _sysconfdir %{_pkgrootdir}/conf.d
98%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
99%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
08710a2f 100
59d9f80d
ER
101# disable strip examples, http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2015-January/024223.html
102%define _noautostrip .*%{_examplesdir}/.*
103
08710a2f
ER
104%description
105mod_pagespeed automates the application of those rules in an Apache
106server. HTML, CSS, JavaScript, and images are changed dynamically
107during the web serving process, so that the best practices recommended
108by Page Speed can be used without having to change the way the web
109site is maintained.
110
111%prep
5bdfa704
ER
112%setup -q -n modpagespeed-%{version}
113%patch0 -p2
ce5a7d18 114%patch2 -p1
9c41f6b1 115%patch4 -p1
a16986b1 116%patch5 -p1
08710a2f 117
36c8c93e
ER
118sh -x %{_sourcedir}/clean-source.sh
119
99c7dfcb
ER
120rm -r third_party/icu/source
121rm -r third_party/icu/genfiles
122install -d third_party/icu/source/{common,i18n}
123ln -s %{_includedir}/unicode third_party/icu/source/i18n/unicode
124ln -s %{_includedir}/unicode third_party/icu/source/common/unicode
08710a2f
ER
125
126%build
eb743e9a 127# re-gen makefiles
e62ba6cb
ER
128CC="%{__cc}" \
129CXX="%{__cxx}" \
5bdfa704
ER
130%{__python} build/gyp_chromium \
131 --format=make \
132 --depth=. \
133 build/all.gyp \
42a31ab3
ER
134 -Duse_openssl=1 \
135 -Duse_system_apache_dev=1 \
99c7dfcb 136 -Duse_system_icu=1 \
42a31ab3
ER
137 -Duse_system_libjpeg=1 \
138 -Duse_system_libpng=1 \
139 -Duse_system_opencv=1 \
99c7dfcb 140 -Duse_system_openssl=1 \
5eafce75 141 -Duse_system_yasm=1 \
42a31ab3 142 -Duse_system_zlib=1 \
b2f50394
ER
143 -Dsystem_include_path_apr=%{_includedir}/apr \
144 -Dsystem_include_path_aprutil=%{_includedir}/apr-util \
145 -Dsystem_include_path_httpd=%{_includedir}/apache \
42a31ab3
ER
146 %{nil}
147
1a9213c5 148%{__make} mod_pagespeed js_minify css_minify_main \
08710a2f
ER
149 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
150 %{?with_verbose:V=1} \
151 CC="%{__cc}" \
152 CXX="%{__cxx}" \
153 CC.host="%{__cc}" \
154 CXX.host="%{__cxx}" \
155 LINK.host="%{__cxx}" \
156 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
157 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
5bdfa704 158 %{nil}
08710a2f
ER
159
160%install
161rm -rf $RPM_BUILD_ROOT
1a9213c5
ER
162install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_bindir},%{cachedir}}
163
5bdfa704 164%{__make} -j1 -C install staging_except_module \
06daee42 165 APACHE_ROOT=%{_pkgrootdir} \
3f27b998 166 APACHE_MODULES=modules \
06daee42 167 APACHE_DOC_ROOT=%{htdocsdir} \
5bdfa704
ER
168 MOD_PAGESPEED_CACHE=%{cachedir} \
169 MOD_PAGESPEED_STATS_LOG=/var/log/httpd/mod_pagespeed_stats.log \
06daee42
ER
170 STAGING_DIR=staging
171
1a9213c5
ER
172out=out/%{!?debug:Release}%{?debug:Debug}
173install -p $out/libmod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
174install -p $out/js_minify $RPM_BUILD_ROOT%{_bindir}/pagespeed_js_minify
175install -p $out/css_minify_main $RPM_BUILD_ROOT%{_bindir}/pagespeed_css_minify
176
5bdfa704 177cd install/staging
06daee42
ER
178cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
179LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
180
181$(cat pagespeed.conf)
182EOF
08710a2f 183
1a9213c5
ER
184cp -p pagespeed_libraries.conf $RPM_BUILD_ROOT%{_sysconfdir}/91_mod_%{mod_name}_libraries.conf
185
3f27b998
ER
186install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
187cp -a mod_pagespeed_example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
188
08710a2f
ER
189%clean
190rm -rf $RPM_BUILD_ROOT
191
192%post
193%service -q httpd restart
194
195%postun
196if [ "$1" = "0" ]; then
197 %service -q httpd restart
198fi
199
200%files
201%defattr(644,root,root,755)
08710a2f 202%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
1a9213c5
ER
203%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}_libraries.conf
204%attr(755,root,root) %{_bindir}/pagespeed_css_minify
205%attr(755,root,root) %{_bindir}/pagespeed_js_minify
b6a5d8d0 206%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
3f27b998 207%{_examplesdir}/%{name}-%{version}
5bdfa704 208%dir %attr(770,root,http) %{cachedir}
This page took 0.146788 seconds and 4 git commands to generate.