#
# Conditional build:
%bcond_without verbose # verbose build (V=1)
+%bcond_with sse2 # use SSE2 instructions
# NOTE
# - relase notes: https://developers.google.com/speed/pagespeed/module/release_notes
Summary: Apache module for rewriting web pages to reduce latency and bandwidth
Name: apache-mod_%{mod_name}
# beta: 1.9.32.x-beta
-# stable: 1.8.31.x
-Version: 1.8.31.6
-Release: 0.29
+# stable: 1.9.32.x-stable
+Version: 1.9.32.4
+Release: 8
License: Apache v2.0
Group: Networking/Daemons/HTTP
+#Source0Download: https://github.com/pagespeed/mod_pagespeed/releases
+#Source0: https://github.com/pagespeed/mod_pagespeed/archive/%{version}/mod_pagespeed-%{version}.tar.gz
Source0: modpagespeed-%{version}.tar.xz
-# Source0-md5: ab144d1d524ce60db44c4dfd6f3f8ef3
+# Source0-md5: c6740a5de9cb7f20f0cf29c8835f6f95
Source1: get-source.sh
Source2: gclient.conf
Patch0: system-libs.patch
+Patch1: addrinfo.patch
Patch2: bug-632.patch
Patch4: no-dev-stdout.patch
Patch5: apache24-config.patch
+Patch6: no-force-xxbit.patch
+Patch7: no-arch-opt.patch
+Patch8: %{name}-icu.patch
+Patch9: %{name}-format.patch
+Patch10: serf-openssl1.1.patch
+Patch11: %{name}-system-protobuf.patch
URL: https://developers.google.com/speed/pagespeed/module
BuildRequires: %{apxs}
BuildRequires: apache-devel >= 2.2
BuildRequires: glib2-devel
BuildRequires: gperf
BuildRequires: libicu-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng-devel
BuildRequires: libselinux-devel
BuildRequires: libstdc++-devel >= 5:4.1
BuildRequires: opencv-devel >= 2.3.1
-BuildRequires: openssl-devel
+BuildRequires: openssl-devel >= 1.1
BuildRequires: pkgconfig
+BuildRequires: protobuf-devel
BuildRequires: python-devel >= 1:2.6
BuildRequires: yasm
# This version of gyp is new enough that it knows to use make for Linux 3.x
BuildRequires: util-linux
BuildRequires: xz
BuildRequires: zlib-devel
+BuildConflicts: depot_tools < 0.1-0.20150708
Requires: apache(modules-api) = %apache_modules_api
Requires: apache-mod_authz_host
Requires: apache-mod_headers
%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
+# disable strip examples, http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2015-January/024223.html
+%define _noautostrip .*%{_examplesdir}/.*
+
%description
mod_pagespeed automates the application of those rules in an Apache
server. HTML, CSS, JavaScript, and images are changed dynamically
%prep
%setup -q -n modpagespeed-%{version}
-%patch0 -p2
+%patch0 -p1
+%patch1 -p0
%patch2 -p1
%patch4 -p1
%patch5 -p1
-
-rm -r third_party/icu/source
-rm -r third_party/icu/genfiles
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+
+%if 0
+sh -x %{_sourcedir}/clean-source.sh
+%endif
+
+%{__rm} -r third_party/icu/source
+%{__rm} -r third_party/icu/genfiles
+# third_party_chromium uses "third_party/icu/..." includes
install -d third_party/icu/source/{common,i18n}
ln -s %{_includedir}/unicode third_party/icu/source/i18n/unicode
ln -s %{_includedir}/unicode third_party/icu/source/common/unicode
+%{__rm} -r third_party/protobuf/src
+
%build
# re-gen makefiles
CC="%{__cc}" \
--format=make \
--depth=. \
build/all.gyp \
+ %{!?with_sse2:-Ddisable_sse2=1} \
-Duse_openssl=1 \
-Duse_system_apache_dev=1 \
-Duse_system_icu=1 \
-Duse_system_libpng=1 \
-Duse_system_opencv=1 \
-Duse_system_openssl=1 \
+ -Duse_system_protobuf=1 \
-Duse_system_yasm=1 \
-Duse_system_zlib=1 \
-Dsystem_include_path_apr=%{_includedir}/apr \
CC.host="%{__cc}" \
CXX.host="%{__cxx}" \
LINK.host="%{__cxx}" \
- CFLAGS="%{rpmcflags} %{rpmcppflags}" \
- CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
+ CFLAGS="%{rpmcflags} %{rpmcppflags} -DUSE_SYSTEM_LIBJPEG" \
+ CXXFLAGS="%{rpmcxxflags} %{rpmcppflags} -DUSE_SYSTEM_LIBJPEG" \
%{nil}
%install