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