2 # - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
4 # - system libmbfl, system xhp, sqlite3
6 %define githash c2284b1fc46454432969bfe1b1c205713f7a69e8
8 Summary: Virtual Machine, Runtime, and JIT for PHP
13 Group: Development/Languages
14 Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
15 # Source0-md5: 55cbeb7fdb365972e3cb72ba59558453
16 # need fb.changes.patch, which is available for 1.4 only
17 Source2: https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
18 # Source2-md5: e14ff4b87c986dbe095547bdf0761dd1
19 Source3: %{name}-fcgi.init
20 Source4: %{name}-fcgi.sysconfig
21 Source100: get-source.sh
22 Patch0: cmake-missing-library.patch
23 Patch3: system-xhp.patch
24 Patch4: system-libafdt.patch
25 Patch5: system-folly.patch
28 Patch10: no-debug.patch
29 URL: https://github.com/facebook/hhvm/wiki
30 BuildRequires: a52dec-libs-devel
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 >= 20130729
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: ImageMagick-devel
54 BuildRequires: libxslt-devel
55 BuildRequires: mysql-devel
56 BuildRequires: ocaml-findlib
57 BuildRequires: oniguruma-devel
58 BuildRequires: openssl-devel
59 BuildRequires: pcre-devel
60 #BuildRequires: php-xhp-devel >= 1.3.9-6
61 BuildRequires: readline-devel
62 BuildRequires: rpmbuild(macros) >= 1.675
63 BuildRequires: tbb-devel >= 4.0.6000
64 BuildRequires: zlib-devel
65 # check later, seem unused
66 #BuildRequires: bison >= 2.3
67 #BuildRequires: flex >= 2.5.35
68 #BuildRequires: libafdt-devel >= 0.1.0
69 #BuildRequires: re2c >= 0.13.0
70 # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
78 Provides: php(debugger)
82 Provides: php(fileinfo)
84 Provides: php(function)
88 Provides: php(hhvm.debugger)
89 Provides: php(hhvm.ini)
90 Provides: php(hotprofiler)
93 Provides: php(imagick)
99 Provides: php(mbstring)
100 Provides: php(mcrypt)
101 Provides: php(memcache)
102 Provides: php(memcached)
105 Provides: php(mysqli)
106 Provides: php(openssl)
110 Provides: php(pdo_mysql)
111 Provides: php(pdo_sqlite)
115 Provides: php(reflection)
116 Provides: php(server)
117 Provides: php(session)
118 Provides: php(simplexml)
120 Provides: php(sockets)
122 Provides: php(sqlite3)
123 Provides: php(stream)
124 Provides: php(sysvmsg)
125 Provides: php(sysvsem)
126 Provides: php(sysvshm)
127 Provides: php(thread)
128 Provides: php(thrift_protocol)
129 Provides: php(tokenizer)
131 Provides: php(xhprof)
133 Provides: php(xmlreader)
134 Provides: php(xmlwriter)
138 Obsoletes: hiphop-php < 2.3.2-0.2
139 ExclusiveArch: %{x8664}
140 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
143 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
144 machine designed for executing programs written in PHP. HHVM uses a
145 just-in-time compilation approach to achieve superior performance
146 while maintaining the flexibility that PHP developers are accustomed
147 to. To date, HHVM (and its predecessor HPHPc before it) has realized
148 over a 9x increase in web request throughput and over a 5x reduction
149 in memory consumption for Facebook compared with the Zend PHP 5.2
152 HHVM can be run as a standalone webserver (i.e. without the Apache
153 webserver and the "mod_php" extension). HHVM can also be used together
154 with a FastCGI-based webserver, and work is in progress to make HHVM
155 work smoothly with Apache.
158 Summary: Init script to start HHVM as FastCGI daemon
159 Group: Development/Languages/PHP
160 Requires: %{name} = %{version}-%{release}
162 Requires(post,preun): /sbin/chkconfig
166 Init script to start HHVM as FastCGI daemon
169 Summary: /usr/bin/php symlink
170 Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
171 Group: Development/Languages/PHP
172 Requires: %{name} = %{version}-%{release}
173 Obsoletes: /usr/bin/php
176 Package providing /usr/bin/php symlink to PHP CLI.
178 %description program -l pl.UTF-8
179 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
182 Summary: Files for HHVM modules development
183 Group: Development/Languages/PHP
184 URL: https://github.com/facebook/hhvm/wiki/Extension-API
185 Requires: boost-devel >= 1.50
186 Requires: cmake >= 2.8.5
187 Requires: glog-devel >= 0.3.2
188 Requires: libstdc++-devel >= 6:4.3
189 Requires: tbb-devel >= 4.0.6000
193 HHVM provides a set of APIs for adding built-in functionality to the
194 runtime either by way of pure PHP code, or a combination of PHP and
198 %setup -q -a2 -n %{name}-HHVM-%{version}
200 mv folly-*/* hphp/submodules/folly
207 # prefer ones from system
208 rm CMake/FindBISON.cmake
209 rm CMake/FindFLEX.cmake
210 rm CMake/FindFreetype.cmake
218 #rm -rf src/third_party/libmbfl
219 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
221 rm -rf src/third_party/xhp
222 rm -rf src/third_party/libafdt
226 export HPHP_HOME=$(pwd)
227 export HPHP_LIB=$HPHP_HOME/bin
230 # asm linking breaks on $CC containing spaces
231 if [[ "%{__cc}" = *ccache* ]]; then
232 cat <<-'EOF' > $HPHP_LIB/gcc
236 chmod +x $HPHP_LIB/gcc
241 # out of dir build broken (can't find it's tools)
247 -DCMAKE_PREFIX_PATH=%{_prefix} \
253 # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
254 # see hphp/util/generate-buildinfo.sh
255 export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
256 export HHVM_REPO_SCHEMA=$(date +%N_%s)
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
265 DESTDIR=$RPM_BUILD_ROOT
268 rm $RPM_BUILD_ROOT%{_includedir}/zip.h
269 rm $RPM_BUILD_ROOT%{_includedir}/zipconf.h
270 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.a
271 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.so
273 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
274 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
276 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
277 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
279 # install fastcgi initscript
280 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
281 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
282 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
285 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
286 cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
290 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
291 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
295 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
299 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
305 $HPHP_HOME/hphp/runtime \
306 $HPHP_HOME/hphp/util \
307 $HPHP_HOME/hphp/neo \
308 $HPHP_HOME/hphp/system \
309 $HPHP_HOME/hphp/parser \
311 echo "D %{_includedir}${dir#$HPHP_HOME}"
312 find $dir -name '*.h' | while read path; do
313 file=%{_includedir}${path#$HPHP_HOME}
315 install -Dp $path $RPM_BUILD_ROOT$file
321 rm -rf $RPM_BUILD_ROOT
323 %post -p /sbin/ldconfig
324 %postun -p /sbin/ldconfig
327 /sbin/chkconfig --add %{name}-fcgi
328 %service %{name}-fcgi restart
331 if [ "$1" = "0" ]; then
332 %service -q %{name}-fcgi stop
333 /sbin/chkconfig --del %{name}-fcgi
337 %defattr(644,root,root,755)
338 %doc README.md hphp/NEWS
339 %dir %{_sysconfdir}/%{name}
340 %attr(755,root,root) %{_bindir}/hhvm
341 %attr(755,root,root) %{_bindir}/hphp
343 %dir %{_datadir}/%{name}
344 %dir %{_datadir}/%{name}/hdf
345 %{_datadir}/%{name}/hdf/static.mime-types.hdf
348 %defattr(644,root,root,755)
349 %attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
350 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/php
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_bindir}/hphpize
360 %{_datadir}/cmake/Modules/ExtZendCompat.cmake
361 %{_datadir}/cmake/Modules/FindCClient.cmake
362 %{_datadir}/cmake/Modules/FindEditline.cmake
363 %{_datadir}/cmake/Modules/FindGlog.cmake
364 %{_datadir}/cmake/Modules/FindICU.cmake
365 %{_datadir}/cmake/Modules/FindLdap.cmake
366 %{_datadir}/cmake/Modules/FindLibAfdt.cmake
367 %{_datadir}/cmake/Modules/FindLibCh.cmake
368 %{_datadir}/cmake/Modules/FindLibDL.cmake
369 %{_datadir}/cmake/Modules/FindLibDwarf.cmake
370 %{_datadir}/cmake/Modules/FindLibElf.cmake
371 %{_datadir}/cmake/Modules/FindLibJpeg.cmake
372 %{_datadir}/cmake/Modules/FindLibMagickWand.cmake
373 %{_datadir}/cmake/Modules/FindLibNuma.cmake
374 %{_datadir}/cmake/Modules/FindLibPng.cmake
375 %{_datadir}/cmake/Modules/FindLibUODBC.cmake
376 %{_datadir}/cmake/Modules/FindLibXed.cmake
377 %{_datadir}/cmake/Modules/FindLibYaml.cmake
378 %{_datadir}/cmake/Modules/FindLibiconv.cmake
379 %{_datadir}/cmake/Modules/FindLibinotify.cmake
380 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
381 %{_datadir}/cmake/Modules/FindLibpam.cmake
382 %{_datadir}/cmake/Modules/FindMcrypt.cmake
383 %{_datadir}/cmake/Modules/FindMySQL.cmake
384 %{_datadir}/cmake/Modules/FindNcurses.cmake
385 %{_datadir}/cmake/Modules/FindOCaml.cmake
386 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
387 %{_datadir}/cmake/Modules/FindPCRE.cmake
388 %{_datadir}/cmake/Modules/FindPThread.cmake
389 %{_datadir}/cmake/Modules/FindReadline.cmake
390 %{_datadir}/cmake/Modules/FindTBB.cmake
391 %{_datadir}/cmake/Modules/FollySetup.cmake
392 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
393 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
394 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
395 %{_datadir}/cmake/Modules/HPHPSetup.cmake
396 %{_datadir}/cmake/Modules/Options.cmake
397 %{_datadir}/cmake/Modules/hphpize.cmake