]> git.pld-linux.org Git - packages/hhvm.git/blob - hhvm.spec
up to 3.0.0; webserver dropped
[packages/hhvm.git] / hhvm.spec
1 # NOTES:
2 # - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
3 # TODO
4 # - system libmbfl, system xhp, sqlite3
5 # - libdwarf>20120410 issue: https://github.com/facebook/hhvm/issues/1337
6 # git show HHVM-3.0.0
7 %define         githash 59a8db46e4ebf5cfd205fadc12e27a9903fb7aae
8 %define         folly   d9c79af
9 Summary:        Virtual Machine, Runtime, and JIT for PHP
10 Name:           hhvm
11 Version:        3.0.0
12 Release:        0.1
13 License:        PHP 3.01
14 Group:          Development/Languages
15 Source0:        https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
16 # Source0-md5:  7762f2a8a6fe402c68728ffb282caae7
17 # need fb.changes.patch, which is available for 1.4 only
18 Source2:        https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
19 # Source2-md5:  e14ff4b87c986dbe095547bdf0761dd1
20 Source3:        %{name}-fcgi.init
21 Source4:        %{name}-fcgi.sysconfig
22 Source100:      get-source.sh
23 Patch0:         cmake-missing-library.patch
24 Patch3:         system-xhp.patch
25 Patch4:         system-libafdt.patch
26 Patch5:         system-folly.patch
27 Patch8:         hphpize.patch
28 Patch9:         notest.patch
29 Patch10:        no-debug.patch
30 URL:            http://wiki.github.com/facebook/hiphop-php/
31 BuildRequires:  apr-devel
32 BuildRequires:  autoconf
33 BuildRequires:  binutils-devel
34 BuildRequires:  boost-devel >= 1.50
35 BuildRequires:  cmake >= 2.8.7
36 BuildRequires:  curl-devel >= 7.29.0
37 BuildRequires:  elfutils-devel
38 BuildRequires:  expat-devel
39 BuildRequires:  gcc >= 6:4.6.0
40 BuildRequires:  gd-devel
41 BuildRequires:  glog-devel >= 0.3.2
42 BuildRequires:  imap-devel >= 1:2007
43 #BuildRequires: jemalloc-devel >= 3.0.0
44 BuildRequires:  libcap-devel
45 BuildRequires:  libdwarf-devel <= 20120410
46 BuildRequires:  libicu-devel >= 4.2
47 #BuildRequires: libmbfl-devel
48 BuildRequires:  libmcrypt-devel
49 BuildRequires:  libmemcached-devel >= 1.0.4
50 BuildRequires:  libstdc++-devel >= 6:4.3
51 BuildRequires:  libunwind-devel
52 BuildRequires:  libxml2-devel
53 BuildRequires:  mysql-devel
54 BuildRequires:  oniguruma-devel
55 BuildRequires:  openssl-devel
56 BuildRequires:  pcre-devel
57 #BuildRequires: php-xhp-devel >= 1.3.9-6
58 BuildRequires:  readline-devel
59 BuildRequires:  rpmbuild(macros) >= 1.675
60 BuildRequires:  tbb-devel >= 4.0.6000
61 BuildRequires:  zlib-devel
62 # check later, seem unused
63 #BuildRequires: bison >= 2.3
64 #BuildRequires: flex >= 2.5.35
65 #BuildRequires: libafdt-devel >= 0.1.0
66 #BuildRequires: re2c >= 0.13.0
67 # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
68 Provides:       php(apache)
69 Provides:       php(apc)
70 Provides:       php(bcmath)
71 Provides:       php(bz2)
72 Provides:       php(ctype)
73 Provides:       php(curl)
74 Provides:       php(date)
75 Provides:       php(debugger)
76 Provides:       php(dom)
77 Provides:       php(exif)
78 Provides:       php(fb)
79 Provides:       php(fileinfo)
80 Provides:       php(filter)
81 Provides:       php(function)
82 Provides:       php(gd)
83 Provides:       php(hash)
84 Provides:       php(hh)
85 Provides:       php(hhvm.debugger)
86 Provides:       php(hhvm.ini)
87 Provides:       php(hotprofiler)
88 Provides:       php(iconv)
89 Provides:       php(idn)
90 Provides:       php(imagick)
91 Provides:       php(imap)
92 Provides:       php(intl)
93 Provides:       php(json)
94 Provides:       php(ldap)
95 Provides:       php(libxml)
96 Provides:       php(mbstring)
97 Provides:       php(mcrypt)
98 Provides:       php(memcache)
99 Provides:       php(memcached)
100 Provides:       php(misc)
101 Provides:       php(mysql)
102 Provides:       php(mysqli)
103 Provides:       php(openssl)
104 Provides:       php(pcntl)
105 Provides:       php(pcre)
106 Provides:       php(pdo)
107 Provides:       php(pdo_mysql)
108 Provides:       php(pdo_sqlite)
109 Provides:       php(phar)
110 Provides:       php(posix)
111 Provides:       php(redis)
112 Provides:       php(reflection)
113 Provides:       php(server)
114 Provides:       php(session)
115 Provides:       php(simplexml)
116 Provides:       php(soap)
117 Provides:       php(sockets)
118 Provides:       php(spl)
119 Provides:       php(sqlite3)
120 Provides:       php(stream)
121 Provides:       php(sysvmsg)
122 Provides:       php(sysvsem)
123 Provides:       php(sysvshm)
124 Provides:       php(thread)
125 Provides:       php(thrift_protocol)
126 Provides:       php(tokenizer)
127 Provides:       php(url)
128 Provides:       php(xhprof)
129 Provides:       php(xml)
130 Provides:       php(xmlreader)
131 Provides:       php(xmlwriter)
132 Provides:       php(xsl)
133 Provides:       php(zip)
134 Provides:       php(zlib)
135 Obsoletes:      hiphop-php < 2.3.2-0.2
136 ExclusiveArch:  %{x8664}
137 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
138
139 %description
140 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
141 machine designed for executing programs written in PHP. HHVM uses a
142 just-in-time compilation approach to achieve superior performance
143 while maintaining the flexibility that PHP developers are accustomed
144 to. To date, HHVM (and its predecessor HPHPc before it) has realized
145 over a 9x increase in web request throughput and over a 5x reduction
146 in memory consumption for Facebook compared with the Zend PHP 5.2
147 engine + APC.
148
149 HHVM can be run as a standalone webserver (i.e. without the Apache
150 webserver and the "mod_php" extension). HHVM can also be used together
151 with a FastCGI-based webserver, and work is in progress to make HHVM
152 work smoothly with Apache.
153
154 %package fcgi
155 Summary:        Init script to start HHVM as FastCGI daemon
156 Group:          Development/Languages/PHP
157 Requires:       %{name} = %{version}-%{release}
158 Provides:       php(fcgi)
159 Requires(post,preun):   /sbin/chkconfig
160 Requires:       rc-scripts
161
162 %description fcgi
163 Init script to start HHVM as FastCGI daemon
164
165 %package program
166 Summary:        /usr/bin/php symlink
167 Summary(pl.UTF-8):      Dowiązanie symboliczne /usr/bin/php
168 Group:          Development/Languages/PHP
169 Requires:       %{name} = %{version}-%{release}
170 Obsoletes:      /usr/bin/php
171
172 %description program
173 Package providing /usr/bin/php symlink to PHP CLI.
174
175 %description program -l pl.UTF-8
176 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
177
178 %package devel
179 Summary:        Files for HHVM modules development
180 Group:          Development/Languages/PHP
181 URL:            https://github.com/facebook/hhvm/wiki/Extension-API
182 Requires:       boost-devel >= 1.50
183 Requires:       cmake >= 2.8.5
184 Requires:       glog-devel >= 0.3.2
185 Requires:       libstdc++-devel >= 6:4.3
186 Requires:       tbb-devel >= 4.0.6000
187 Requires:       zlib-devel
188
189 %description devel
190 HHVM provides a set of APIs for adding built-in functionality to the
191 runtime either by way of pure PHP code, or a combination of PHP and
192 C++.
193
194 %prep
195 %setup -q -a2 -n %{name}-HHVM-%{version}
196
197 mv folly-*/* hphp/submodules/folly
198
199 %patch8 -p1
200 %patch9 -p1
201 %patch10 -p1
202 #%patch5 -p1
203
204 # prefer ones from system
205 rm CMake/FindBISON.cmake
206 rm CMake/FindFLEX.cmake
207 rm CMake/FindFreetype.cmake
208 rm CMake/FindLibEvent.cmake
209
210 %if 0
211 %patch0 -p1
212 %patch1 -p1
213 #%patch3 -p1
214 %patch4 -p1
215
216 #rm -rf src/third_party/libmbfl
217 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
218
219 rm -rf src/third_party/xhp
220 rm -rf src/third_party/libafdt
221 %endif
222
223 %build
224 export HPHP_HOME=$(pwd)
225 export HPHP_LIB=$HPHP_HOME/bin
226 install -d $HPHP_LIB
227
228 # asm linking breaks on $CC containing spaces
229 if [[ "%{__cc}" = *ccache* ]]; then
230         cat <<-'EOF' > $HPHP_LIB/gcc
231         #!/bin/sh
232         exec %{__cc} "$@"
233         EOF
234         chmod +x $HPHP_LIB/gcc
235         CC=$HPHP_LIB/gcc
236 fi
237
238 %if 0
239 # out of dir build broken (can't find it's tools)
240 install -d build
241 cd build
242 %endif
243
244 %cmake \
245         -DCMAKE_PREFIX_PATH=%{_prefix} \
246         -DUSE_JEMALLOC=OFF \
247         -DUSE_TCMALLOC=OFF \
248         -DHPHP_NOTEST=ON \
249         ./
250
251 # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
252 # see hphp/util/generate-buildinfo.sh
253 export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
254 export HHVM_REPO_SCHEMA=$(date +%N_%s)
255
256 %{__make}
257
258 %install
259 rm -rf $RPM_BUILD_ROOT
260 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
261 %{__make} install \
262         HPHP_HOME=$(pwd) \
263         DESTDIR=$RPM_BUILD_ROOT
264
265 # not packaged here
266 rm $RPM_BUILD_ROOT%{_includedir}/zip.h
267 rm $RPM_BUILD_ROOT%{_includedir}/zipconf.h
268 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.a
269 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.so
270
271 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
272 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
273
274 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
275 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
276
277 # install fastcgi initscript
278 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
279 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
280 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
281
282 # setup -devel
283 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
284 cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
285
286 HPHP_HOME=$(pwd)
287 sed -e "
288         /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
289 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
290
291 oIFS=$IFS
292 IFS=";"
293 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
294 IFS=$oIFS
295 set -- $(
296         for dir in "$@"; do
297                 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
298         done
299 )
300
301 set +x
302 for dir in "$@" \
303         $HPHP_HOME/hphp/runtime \
304         $HPHP_HOME/hphp/util \
305         $HPHP_HOME/hphp/neo \
306         $HPHP_HOME/hphp/system \
307         $HPHP_HOME/hphp/parser \
308 ; do
309         echo "D %{_includedir}${dir#$HPHP_HOME}"
310         find $dir -name '*.h' | while read path; do
311                 file=%{_includedir}${path#$HPHP_HOME}
312                 echo "F $file"
313                 install -Dp $path $RPM_BUILD_ROOT$file
314         done
315 done
316 set -x
317
318 %clean
319 rm -rf $RPM_BUILD_ROOT
320
321 %post   -p /sbin/ldconfig
322 %postun -p /sbin/ldconfig
323
324 %post fcgi
325 /sbin/chkconfig --add %{name}-fcgi
326 %service %{name}-fcgi restart
327
328 %preun fcgi
329 if [ "$1" = "0" ]; then
330         %service -q %{name}-fcgi stop
331         /sbin/chkconfig --del %{name}-fcgi
332 fi
333
334 %files
335 %defattr(644,root,root,755)
336 %doc README.md hphp/NEWS
337 %dir %{_sysconfdir}/%{name}
338 %attr(755,root,root) %{_bindir}/hhvm
339 %attr(755,root,root) %{_bindir}/hphp
340
341 %dir %{_datadir}/%{name}
342 %dir %{_datadir}/%{name}/hdf
343 %{_datadir}/%{name}/hdf/static.mime-types.hdf
344
345 %files fcgi
346 %defattr(644,root,root,755)
347 %attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
348 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
349
350 %files program
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_bindir}/php
353
354 %files devel
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_bindir}/hphpize
357 %{_includedir}/hphp
358 %{_datadir}/cmake/Modules/ExtZendCompat.cmake
359 %{_datadir}/cmake/Modules/FindCClient.cmake
360 %{_datadir}/cmake/Modules/FindEditline.cmake
361 %{_datadir}/cmake/Modules/FindGlog.cmake
362 %{_datadir}/cmake/Modules/FindICU.cmake
363 %{_datadir}/cmake/Modules/FindLdap.cmake
364 %{_datadir}/cmake/Modules/FindLibAfdt.cmake
365 %{_datadir}/cmake/Modules/FindLibCh.cmake
366 %{_datadir}/cmake/Modules/FindLibDL.cmake
367 %{_datadir}/cmake/Modules/FindLibDwarf.cmake
368 %{_datadir}/cmake/Modules/FindLibElf.cmake
369 %{_datadir}/cmake/Modules/FindLibJpeg.cmake
370 %{_datadir}/cmake/Modules/FindLibMagickWand.cmake
371 %{_datadir}/cmake/Modules/FindLibNuma.cmake
372 %{_datadir}/cmake/Modules/FindLibPng.cmake
373 %{_datadir}/cmake/Modules/FindLibUODBC.cmake
374 %{_datadir}/cmake/Modules/FindLibXed.cmake
375 %{_datadir}/cmake/Modules/FindLibYaml.cmake
376 %{_datadir}/cmake/Modules/FindLibiconv.cmake
377 %{_datadir}/cmake/Modules/FindLibinotify.cmake
378 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
379 %{_datadir}/cmake/Modules/FindLibpam.cmake
380 %{_datadir}/cmake/Modules/FindMcrypt.cmake
381 %{_datadir}/cmake/Modules/FindMySQL.cmake
382 %{_datadir}/cmake/Modules/FindNcurses.cmake
383 %{_datadir}/cmake/Modules/FindOCaml.cmake
384 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
385 %{_datadir}/cmake/Modules/FindPCRE.cmake
386 %{_datadir}/cmake/Modules/FindPThread.cmake
387 %{_datadir}/cmake/Modules/FindReadline.cmake
388 %{_datadir}/cmake/Modules/FindTBB.cmake
389 %{_datadir}/cmake/Modules/FollySetup.cmake
390 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
391 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
392 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
393 %{_datadir}/cmake/Modules/HPHPSetup.cmake
394 %{_datadir}/cmake/Modules/Options.cmake
395 %{_datadir}/cmake/Modules/hphpize.cmake
This page took 0.078863 seconds and 4 git commands to generate.