]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
use system yasm
[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}
ffebf8bc
ER
21# beta: 1.9.32.2-beta
22# stable: 1.8.31.5
23Version: 1.8.31.5
5eafce75 24Release: 0.10
08710a2f
ER
25License: Apache v2.0
26Group: Networking/Daemons/HTTP
4623c72a 27Source0: modpagespeed-%{version}.tar.xz
5eafce75 28# Source0-md5: 9aefd5719a9b7946106b625dc7ecd2aa
b74b29a5 29Source1: get-source.sh
5a3e561c 30Source2: gclient.conf
42a31ab3 31Patch0: system-libs.patch
1a9213c5 32Patch2: bug-632.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
ffebf8bc 37BuildRequires: bash
42a31ab3 38BuildRequires: glib2-devel
3f27b998 39BuildRequires: gperf
99c7dfcb 40BuildRequires: libicu-devel
42a31ab3 41BuildRequires: libselinux-devel
b74b29a5 42BuildRequires: libstdc++-devel >= 5:4.1
4623c72a 43BuildRequires: opencv-devel >= 2.3.1
42a31ab3 44BuildRequires: openssl-devel
3f27b998 45BuildRequires: pkgconfig
757b3ba5 46BuildRequires: python-devel >= 1:2.6
5eafce75 47BuildRequires: yasm
4623c72a
ER
48# This version of gyp is new enough that it knows to use make for Linux 3.x
49# and FreeBSD, but old enough that 'type': 'settings' works and
50# LINKER_SUPPORTS_ICF hasn't been removed yet.
3fbdacfc 51BuildRequires: python-gyp >= 0.1-0.svn1602.1
08710a2f 52BuildRequires: rpmbuild(macros) >= 1.268
4623c72a 53BuildRequires: tar >= 1:1.22
2ddcd200 54BuildRequires: util-linux
4623c72a 55BuildRequires: xz
42a31ab3 56BuildRequires: zlib-devel
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
5bdfa704
ER
77%setup -q -n modpagespeed-%{version}
78%patch0 -p2
ce5a7d18 79%patch2 -p1
9c41f6b1 80%patch4 -p1
08710a2f 81
99c7dfcb
ER
82rm -r third_party/icu/source
83rm -r third_party/icu/genfiles
84install -d third_party/icu/source/{common,i18n}
85ln -s %{_includedir}/unicode third_party/icu/source/i18n/unicode
86ln -s %{_includedir}/unicode third_party/icu/source/common/unicode
87
08710a2f 88%build
eb743e9a 89# re-gen makefiles
e62ba6cb
ER
90CC="%{__cc}" \
91CXX="%{__cxx}" \
5bdfa704
ER
92%{__python} build/gyp_chromium \
93 --format=make \
94 --depth=. \
95 build/all.gyp \
42a31ab3
ER
96 -Duse_openssl=1 \
97 -Duse_system_apache_dev=1 \
99c7dfcb 98 -Duse_system_icu=1 \
42a31ab3
ER
99 -Duse_system_libjpeg=1 \
100 -Duse_system_libpng=1 \
101 -Duse_system_opencv=1 \
99c7dfcb 102 -Duse_system_openssl=1 \
5eafce75 103 -Duse_system_yasm=1 \
42a31ab3 104 -Duse_system_zlib=1 \
b2f50394
ER
105 -Dsystem_include_path_apr=%{_includedir}/apr \
106 -Dsystem_include_path_aprutil=%{_includedir}/apr-util \
107 -Dsystem_include_path_httpd=%{_includedir}/apache \
42a31ab3
ER
108 %{nil}
109
1a9213c5 110%{__make} mod_pagespeed js_minify css_minify_main \
08710a2f
ER
111 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
112 %{?with_verbose:V=1} \
113 CC="%{__cc}" \
114 CXX="%{__cxx}" \
115 CC.host="%{__cc}" \
116 CXX.host="%{__cxx}" \
117 LINK.host="%{__cxx}" \
118 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
119 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
5bdfa704 120 %{nil}
08710a2f
ER
121
122%install
123rm -rf $RPM_BUILD_ROOT
1a9213c5
ER
124install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_bindir},%{cachedir}}
125
5bdfa704 126%{__make} -j1 -C install staging_except_module \
06daee42 127 APACHE_ROOT=%{_pkgrootdir} \
3f27b998 128 APACHE_MODULES=modules \
06daee42 129 APACHE_DOC_ROOT=%{htdocsdir} \
5bdfa704
ER
130 MOD_PAGESPEED_CACHE=%{cachedir} \
131 MOD_PAGESPEED_STATS_LOG=/var/log/httpd/mod_pagespeed_stats.log \
06daee42
ER
132 STAGING_DIR=staging
133
1a9213c5
ER
134out=out/%{!?debug:Release}%{?debug:Debug}
135install -p $out/libmod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
136install -p $out/js_minify $RPM_BUILD_ROOT%{_bindir}/pagespeed_js_minify
137install -p $out/css_minify_main $RPM_BUILD_ROOT%{_bindir}/pagespeed_css_minify
138
5bdfa704 139cd install/staging
06daee42
ER
140cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
141LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
142
143$(cat pagespeed.conf)
144EOF
08710a2f 145
1a9213c5
ER
146cp -p pagespeed_libraries.conf $RPM_BUILD_ROOT%{_sysconfdir}/91_mod_%{mod_name}_libraries.conf
147
3f27b998
ER
148install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
149cp -a mod_pagespeed_example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
150
08710a2f
ER
151%clean
152rm -rf $RPM_BUILD_ROOT
153
154%post
155%service -q httpd restart
156
157%postun
158if [ "$1" = "0" ]; then
159 %service -q httpd restart
160fi
161
162%files
163%defattr(644,root,root,755)
08710a2f 164%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
1a9213c5
ER
165%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}_libraries.conf
166%attr(755,root,root) %{_bindir}/pagespeed_css_minify
167%attr(755,root,root) %{_bindir}/pagespeed_js_minify
b6a5d8d0 168%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
3f27b998 169%{_examplesdir}/%{name}-%{version}
5bdfa704 170%dir %attr(770,root,http) %{cachedir}
This page took 0.096423 seconds and 4 git commands to generate.