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