2 # - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
4 # - system libevent2: https://github.com/facebook/hiphop-php/pull/421
5 # - system libmbfl, system xhp, sqlite3
6 %define githash f951cb8d8812c59344d5322454853b584b668636
7 Summary: Virtual Machine, Runtime, and JIT for PHP
12 Group: Development/Languages
13 Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
14 # Source0-md5: 471961d38ba52c66b7038c556b2b7bd8
15 # need fb.changes.patch, which is available for 1.4 only
16 Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
17 # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c
18 Source2: https://github.com/facebook/folly/archive/311c98e/folly-0.1-311c98e.tar.gz
19 # Source2-md5: 338c206bccfa1a19eeb45396cd6adac6
20 Source3: %{name}-fcgi.init
21 Source4: %{name}-fcgi.sysconfig
22 Source100: get-source.sh
23 Patch0: cmake-missing-library.patch
24 Patch1: libevent14.patch
25 Patch3: system-xhp.patch
26 Patch4: system-libafdt.patch
27 Patch5: system-folly.patch
28 Patch6: checksum.patch
29 Patch7: imap-gss.patch
32 Patch10: no-debug.patch
33 URL: http://wiki.github.com/facebook/hiphop-php/
34 BuildRequires: apr-devel
35 BuildRequires: autoconf
36 BuildRequires: binutils-devel
37 BuildRequires: boost-devel >= 1.50
38 BuildRequires: cmake >= 2.8.7
39 BuildRequires: curl-devel >= 7.29.0
40 BuildRequires: elfutils-devel
41 BuildRequires: expat-devel
42 BuildRequires: gcc >= 6:4.6.0
43 BuildRequires: gd-devel
44 BuildRequires: glog-devel >= 0.3.2
45 BuildRequires: imap-devel >= 1:2007
46 #BuildRequires: jemalloc-devel >= 3.0.0
47 BuildRequires: libcap-devel
48 BuildRequires: libdwarf-devel
49 #BuildRequires: libevent-devel >= 1.4.14
50 BuildRequires: libicu-devel >= 4.2
51 #BuildRequires: libmbfl-devel
52 BuildRequires: libmcrypt-devel
53 BuildRequires: libmemcached-devel >= 1.0.4
54 BuildRequires: libstdc++-devel >= 6:4.3
55 BuildRequires: libunwind-devel
56 BuildRequires: libxml2-devel
57 BuildRequires: mysql-devel
58 BuildRequires: oniguruma-devel
59 BuildRequires: openssl-devel
60 BuildRequires: pcre-devel
61 #BuildRequires: php-xhp-devel >= 1.3.9-6
62 BuildRequires: readline-devel
63 BuildRequires: rpmbuild(macros) >= 1.675
64 BuildRequires: tbb-devel >= 4.0.6000
65 BuildRequires: zlib-devel
66 # check later, seem unused
67 #BuildRequires: bison >= 2.3
68 #BuildRequires: flex >= 2.5.35
69 #BuildRequires: libafdt-devel >= 0.1.0
70 #BuildRequires: re2c >= 0.13.0
80 Provides: php(fileinfo)
84 Provides: php(hotprofiler)
86 Provides: php(icu_num_fmt)
87 Provides: php(icu_ucsdet)
88 Provides: php(icu_uspoof)
93 Provides: php(mbstring)
95 Provides: php(memcache)
96 Provides: php(memcached)
98 Provides: php(openssl)
102 Provides: php(pdo_mysql)
103 Provides: php(pdo_sqlite)
106 Provides: php(reflection)
107 Provides: php(server)
108 Provides: php(session)
109 Provides: php(simplexml)
111 Provides: php(sockets)
113 Provides: php(sqlite3)
114 Provides: php(sysvmsg)
115 Provides: php(sysvsem)
116 Provides: php(sysvshm)
117 Provides: php(thread)
118 Provides: php(thrift_protocol)
119 Provides: php(tokenizer)
120 Provides: php(xhprof)
122 Provides: php(xmlreader)
123 Provides: php(xmlwriter)
126 Obsoletes: hiphop-php < 2.3.2-0.2
127 ExclusiveArch: %{x8664}
128 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
131 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
132 machine designed for executing programs written in PHP. HHVM uses a
133 just-in-time compilation approach to achieve superior performance
134 while maintaining the flexibility that PHP developers are accustomed
135 to. To date, HHVM (and its predecessor HPHPc before it) has realized
136 over a 9x increase in web request throughput and over a 5x reduction
137 in memory consumption for Facebook compared with the Zend PHP 5.2
140 HHVM can be run as a standalone webserver (i.e. without the Apache
141 webserver and the "mod_php" extension). HHVM can also be used together
142 with a FastCGI-based webserver, and work is in progress to make HHVM
143 work smoothly with Apache.
146 Summary: Init script to start HHVM as FastCGI daemon
147 Group: Development/Languages/PHP
148 Requires: %{name} = %{version}-%{release}
150 Requires(post,preun): /sbin/chkconfig
154 Init script to start HHVM as FastCGI daemon
157 Summary: /usr/bin/php symlink
158 Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
159 Group: Development/Languages/PHP
160 Requires: %{name} = %{version}-%{release}
161 Obsoletes: /usr/bin/php
164 Package providing /usr/bin/php symlink to PHP CLI.
166 %description program -l pl.UTF-8
167 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
170 Summary: Files for HHVM modules development
171 Group: Development/Languages/PHP
172 URL: https://github.com/facebook/hhvm/wiki/Extension-API
173 Requires: boost-devel >= 1.50
174 Requires: cmake >= 2.8.5
175 Requires: glog-devel >= 0.3.2
176 Requires: libstdc++-devel >= 6:4.3
177 Requires: tbb-devel >= 4.0.6000
181 HHVM provides a set of APIs for adding built-in functionality to the
182 runtime either by way of pure PHP code, or a combination of PHP and
186 %setup -q -a1 -a2 -n %{name}-HHVM-%{version}
188 mv folly-*/* hphp/submodules/folly
197 # prefer ones from system
198 rm CMake/FindBISON.cmake
199 rm CMake/FindBoost.cmake
200 rm CMake/FindFLEX.cmake
202 ln -s libevent-1.4.*-stable libevent
203 %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
211 #rm -rf src/third_party/libmbfl
212 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
214 rm -rf src/third_party/xhp
215 rm -rf src/third_party/libafdt
219 # build libevent 1.4 with fb patches
220 if [ ! -d libevent/.libs ]; then
222 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
224 %{?0:--enable-static} \
225 %{?0:--disable-shared}
232 export HPHP_HOME=$(pwd)
233 export HPHP_LIB=$HPHP_HOME/bin
236 # asm linking breaks on $CC containing spaces
237 if [[ "%{__cc}" = *ccache* ]]; then
238 cat <<-'EOF' > $HPHP_LIB/gcc
242 chmod +x $HPHP_LIB/gcc
247 # out of dir build broken (can't find it's tools)
253 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
254 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
255 -DCMAKE_PREFIX_PATH=%{_prefix} \
261 # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
262 # see hphp/util/generate-buildinfo.sh
263 export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
264 export HHVM_REPO_SCHEMA=$(date +%N_%s)
269 rm -rf $RPM_BUILD_ROOT
270 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
273 DESTDIR=$RPM_BUILD_ROOT
275 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
276 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
278 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
279 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
281 # install fastcgi initscript
282 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
283 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
284 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
286 # install our libevent for now
287 install -d $RPM_BUILD_ROOT%{_libdir}
288 libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
289 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
292 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
293 cp -a CMake/* $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
297 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
298 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
302 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
306 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
312 $HPHP_HOME/hphp/runtime \
313 $HPHP_HOME/hphp/util \
314 $HPHP_HOME/hphp/neo \
315 $HPHP_HOME/hphp/system \
316 $HPHP_HOME/hphp/parser \
318 echo "D %{_includedir}${dir#$HPHP_HOME}"
319 find $dir -name '*.h' | while read path; do
320 file=%{_includedir}${path#$HPHP_HOME}
322 install -Dp $path $RPM_BUILD_ROOT$file
328 rm -rf $RPM_BUILD_ROOT
330 %post -p /sbin/ldconfig
331 %postun -p /sbin/ldconfig
334 /sbin/chkconfig --add %{name}-fcgi
335 %service %{name}-fcgi restart
338 if [ "$1" = "0" ]; then
339 %service -q %{name}-fcgi stop
340 /sbin/chkconfig --del %{name}-fcgi
344 %defattr(644,root,root,755)
345 %doc README.md hphp/NEWS
346 %dir %{_sysconfdir}/%{name}
347 %attr(755,root,root) %{_bindir}/hhvm
348 %attr(755,root,root) %{_bindir}/hphp
349 %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
350 %ghost %{_libdir}/libevent-1.4.so.2
352 %dir %{_datadir}/%{name}
353 %dir %{_datadir}/%{name}/hdf
354 %{_datadir}/%{name}/hdf/static.mime-types.hdf
357 %defattr(644,root,root,755)
358 %attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
359 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{_bindir}/php
366 %defattr(644,root,root,755)
367 %attr(755,root,root) %{_bindir}/hphpize
369 %{_datadir}/cmake/Modules/hphpize.cmake
370 %{_datadir}/cmake/Modules/FindCClient.cmake
371 %{_datadir}/cmake/Modules/FindEditline.cmake
372 %{_datadir}/cmake/Modules/FindGD.cmake
373 %{_datadir}/cmake/Modules/FindGlog.cmake
374 %{_datadir}/cmake/Modules/FindICU.cmake
375 %{_datadir}/cmake/Modules/FindLdap.cmake
376 %{_datadir}/cmake/Modules/FindLibAfdt.cmake
377 %{_datadir}/cmake/Modules/FindLibCh.cmake
378 %{_datadir}/cmake/Modules/FindLibDL.cmake
379 %{_datadir}/cmake/Modules/FindLibDwarf.cmake
380 %{_datadir}/cmake/Modules/FindLibElf.cmake
381 %{_datadir}/cmake/Modules/FindLibEvent.cmake
382 %{_datadir}/cmake/Modules/FindLibEvent.cmake.bak
383 %{_datadir}/cmake/Modules/FindLibNuma.cmake
384 %{_datadir}/cmake/Modules/FindLibXed.cmake
385 %{_datadir}/cmake/Modules/FindLibiconv.cmake
386 %{_datadir}/cmake/Modules/FindLibinotify.cmake
387 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
388 %{_datadir}/cmake/Modules/FindLibpam.cmake
389 %{_datadir}/cmake/Modules/FindMcrypt.cmake
390 %{_datadir}/cmake/Modules/FindMySQL.cmake
391 %{_datadir}/cmake/Modules/FindNcurses.cmake
392 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
393 %{_datadir}/cmake/Modules/FindPCRE.cmake
394 %{_datadir}/cmake/Modules/FindPThread.cmake
395 %{_datadir}/cmake/Modules/FindReadline.cmake
396 %{_datadir}/cmake/Modules/FindTBB.cmake
397 %{_datadir}/cmake/Modules/FollySetup.cmake
398 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
399 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
400 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
401 %{_datadir}/cmake/Modules/HPHPSetup.cmake
402 %{_datadir}/cmake/Modules/Options.cmake