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