]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - apache-mod_pagespeed.spec
- stop if tarball already present
[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# - c++ errors on 64bit/32bit gcc 4.5.1-4:
11# /usr/include/c++/4.5.1/bits/stl_map.h:87:5: instantiated from here
12# /usr/include/c++/4.5.1/bits/stl_pair.h:77:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
13# ./net/instaweb/util/public/cache_interface.h:28:7: error: forward declaration of ‘struct net_instaweb::SharedString’
14# make[1]: *** [out/Release/obj.target/mod_pagespeed_test/net/instaweb/util/cache_fetcher_test.o] Error 1
55f3a9d4 15# http://pastebin.com/Eu88BPSQ
b6a5d8d0
ER
16# - sizeof(apr_int32_t) == sizeof(apr_int64_t) on 32bit (!?!):
17# third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t':
18# third_party/apache/apr/src/strings/apr_snprintf.c:500:5: error: duplicate case value
19# third_party/apache/apr/src/strings/apr_snprintf.c:498:5: error: previously used here
20# third_party/apache/apr/src/strings/apr_snprintf.c: In function 'conv_os_thread_t_hex':
21# third_party/apache/apr/src/strings/apr_snprintf.c:671:5: error: duplicate case value
22# third_party/apache/apr/src/strings/apr_snprintf.c:669:5: error: previously used here
42a31ab3 23# - use only source for modpagespeed if system headers are used (remove copies from tarball)
b6a5d8d0
ER
24# - possible sysdeps (uses release tags)
25# "serf_src": "http://serf.googlecode.com/svn/tags/0.3.1",
b6a5d8d0 26# "apache_httpd_src": "http://svn.apache.org/repos/asf/httpd/httpd/tags/2.2.15",
b6a5d8d0
ER
27# "gflags_root": "http://google-gflags.googlecode.com/svn/tags/gflags-1.3/src",
28# "google_sparsehash_root": "http://google-sparsehash.googlecode.com/svn/tags/sparsehash-1.8.1/src",
b74b29a5 29# protobuf_lite
24f1647c
ER
30
31%if "%{pld_release}" == "ac"
32# add suffix, but allow ccache, etc in ~/.rpmmacros
33%{expand:%%define __cc %(echo '%__cc' | sed -e 's,-gcc,-gcc4,')}
34%{expand:%%define __cxx %(echo '%__cxx' | sed -e 's,-g++,-g++4,')}
35%{expand:%%define __cpp %(echo '%__cpp' | sed -e 's,-gcc,-gcc4,')}
36%endif
37
08710a2f
ER
38%define mod_name pagespeed
39%define apxs %{_sbindir}/apxs
40Summary: Apache module for rewriting web pages to reduce latency and bandwidth
41Name: apache-mod_%{mod_name}
b74b29a5 42Version: 0.10.22.4
42a31ab3 43Release: 0.7
08710a2f
ER
44License: Apache v2.0
45Group: Networking/Daemons/HTTP
757b3ba5 46Source0: modpagespeed-%{version}.tar.bz2
42a31ab3 47# Source0-md5: 9c9a8b091ee8d37253ee35878c3390e6
b74b29a5 48Source1: get-source.sh
42a31ab3
ER
49Patch0: system-libs.patch
50Patch1: gcc-headers.patch
b74b29a5 51URL: https://developers.google.com/speed/pagespeed/
08710a2f
ER
52BuildRequires: %{apxs}
53BuildRequires: apache-devel >= 2.2
42a31ab3
ER
54BuildRequires: dbus-glib-devel
55BuildRequires: fontconfig-devel
56BuildRequires: freetype-devel
57BuildRequires: glib2-devel
58BuildRequires: gtk+2-devel
59BuildRequires: ibus-devel >= 1.3.99.20110425
60BuildRequires: libgcrypt-devel
61BuildRequires: libgnome-keyring-devel
62BuildRequires: libjpeg-devel
63BuildRequires: libpng-devel
64BuildRequires: libselinux-devel
b74b29a5 65BuildRequires: libstdc++-devel >= 5:4.1
42a31ab3
ER
66BuildRequires: opencv-devel
67BuildRequires: openssl-devel
757b3ba5 68BuildRequires: python-devel >= 1:2.6
08710a2f 69BuildRequires: rpmbuild(macros) >= 1.268
42a31ab3
ER
70BuildRequires: xorg-lib-libX11-devel
71BuildRequires: xorg-lib-libXext-devel
72BuildRequires: xorg-lib-libXi-devel
73BuildRequires: zlib-devel
24f1647c
ER
74# gcc4 might be installed, but not current __cc
75%if "%(echo %{cc_version} | cut -d. -f1,2)" < "4.0"
76BuildRequires: __cc >= 4.0
77%endif
08710a2f 78Requires: apache(modules-api) = %apache_modules_api
e5171f2e 79Requires: apache-mod_authz_host
b6a5d8d0 80Suggests: apache-mod_deflate
08710a2f
ER
81BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82
83%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
06daee42
ER
84%define _pkgrootdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
85%define _sysconfdir %{_pkgrootdir}/conf.d
86%define htdocsdir %(%{apxs} -q htdocsdir 2>/dev/null)
87%define cachedir %(%{apxs} -q proxycachedir 2>/dev/null)/mod_%{mod_name}
08710a2f
ER
88
89%description
90mod_pagespeed automates the application of those rules in an Apache
91server. HTML, CSS, JavaScript, and images are changed dynamically
92during the web serving process, so that the best practices recommended
93by Page Speed can be used without having to change the way the web
94site is maintained.
95
96%prep
e62ba6cb 97%setup -q -n modpagespeed
42a31ab3
ER
98%patch0 -p1
99%patch1 -p1
08710a2f
ER
100
101%build
eb743e9a 102# re-gen makefiles
e62ba6cb
ER
103cd src
104CC="%{__cc}" \
105CXX="%{__cxx}" \
42a31ab3
ER
106%{__python} build/gyp_chromium --format=make build/all.gyp \
107 -Dlinux_link_gsettings=1 \
108 -Dlinux_link_gnome_keyring=1 \
109 -Duse_gnome_keyring=1 \
110 -Duse_openssl=1 \
111 -Duse_system_apache_dev=1 \
112 -Duse_system_libjpeg=1 \
113 -Duse_system_libpng=1 \
114 -Duse_system_opencv=1 \
115 -Duse_system_zlib=1 \
116 -Duse_ibus=1 \
117 %{nil}
118
e62ba6cb 119cd ..
eb743e9a 120
e62ba6cb 121# makefile wrapper so we could just invoke "make" from shell
08710a2f
ER
122cat > Makefile <<'EOF'
123default:
124 $(MAKE) -C src \
125 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
126 %{?with_verbose:V=1} \
127 CC="%{__cc}" \
128 CXX="%{__cxx}" \
129 CC.host="%{__cc}" \
130 CXX.host="%{__cxx}" \
131 LINK.host="%{__cxx}" \
132 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
133 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
42a31ab3 134 $(MAKEFLAGS) \
08710a2f
ER
135EOF
136%{__make}
137
42a31ab3
ER
138# install.gyp needs fixing, not to install ap24.so, for now duplicate
139ln -f src/out/Release/libmod_pagespeed{,_ap24}.so
140
08710a2f
ER
141%install
142rm -rf $RPM_BUILD_ROOT
06daee42
ER
143%{__make} -j1 -C src/install staging \
144 HOSTNAME=localhost \
145 APACHE_ROOT=%{_pkgrootdir} \
146 APACHE_MODULES=%{_pkglibdir} \
147 APACHE_DOC_ROOT=%{htdocsdir} \
148 MOD_PAGESPEED_FILE_ROOT=%{cachedir} \
149 STAGING_DIR=staging
150
dbd6833d 151cd src/install/staging
08710a2f
ER
152install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
153install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
06daee42
ER
154install -d $RPM_BUILD_ROOT%{cachedir}/{cache,files}
155cat > $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf <<EOF
156LoadModule %{mod_name}_module modules/mod_%{mod_name}.so
157
158$(cat pagespeed.conf)
159EOF
08710a2f
ER
160
161%clean
162rm -rf $RPM_BUILD_ROOT
163
164%post
165%service -q httpd restart
166
167%postun
168if [ "$1" = "0" ]; then
169 %service -q httpd restart
170fi
171
172%files
173%defattr(644,root,root,755)
08710a2f 174%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
b6a5d8d0 175%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
06daee42
ER
176
177%dir %attr(710,root,http) %{cachedir}
178%dir %attr(770,root,http) %{cachedir}/cache
179%dir %attr(770,root,http) %{cachedir}/files
This page took 0.061615 seconds and 4 git commands to generate.