2 # - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
4 # - system libmbfl, system xhp, sqlite3
5 # - libdwarf>20120410 issue: https://github.com/facebook/hhvm/issues/1337
7 %define githash 59a8db46e4ebf5cfd205fadc12e27a9903fb7aae
9 Summary: Virtual Machine, Runtime, and JIT for PHP
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
29 Patch10: no-debug.patch
30 URL: http://wiki.github.com/facebook/hiphop-php/
31 BuildRequires: a52dec-libs-devel
32 BuildRequires: apr-devel
33 BuildRequires: autoconf
34 BuildRequires: binutils-devel
35 BuildRequires: boost-devel >= 1.50
36 BuildRequires: cmake >= 2.8.7
37 BuildRequires: curl-devel >= 7.29.0
38 BuildRequires: elfutils-devel
39 BuildRequires: expat-devel
40 BuildRequires: gcc >= 6:4.6.0
41 BuildRequires: gd-devel
42 BuildRequires: glog-devel >= 0.3.2
43 BuildRequires: imap-devel >= 1:2007
44 #BuildRequires: jemalloc-devel >= 3.0.0
45 BuildRequires: libcap-devel
46 BuildRequires: libdwarf-devel >= 20130729
47 BuildRequires: libicu-devel >= 4.2
48 #BuildRequires: libmbfl-devel
49 BuildRequires: libmcrypt-devel
50 BuildRequires: libmemcached-devel >= 1.0.4
51 BuildRequires: libstdc++-devel >= 6:4.3
52 BuildRequires: libunwind-devel
53 BuildRequires: libxml2-devel
54 BuildRequires: ImageMagick-devel
55 BuildRequires: libxslt-devel
56 BuildRequires: mysql-devel
57 BuildRequires: ocaml-findlib
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
71 # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
79 Provides: php(debugger)
83 Provides: php(fileinfo)
85 Provides: php(function)
89 Provides: php(hhvm.debugger)
90 Provides: php(hhvm.ini)
91 Provides: php(hotprofiler)
94 Provides: php(imagick)
100 Provides: php(mbstring)
101 Provides: php(mcrypt)
102 Provides: php(memcache)
103 Provides: php(memcached)
106 Provides: php(mysqli)
107 Provides: php(openssl)
111 Provides: php(pdo_mysql)
112 Provides: php(pdo_sqlite)
116 Provides: php(reflection)
117 Provides: php(server)
118 Provides: php(session)
119 Provides: php(simplexml)
121 Provides: php(sockets)
123 Provides: php(sqlite3)
124 Provides: php(stream)
125 Provides: php(sysvmsg)
126 Provides: php(sysvsem)
127 Provides: php(sysvshm)
128 Provides: php(thread)
129 Provides: php(thrift_protocol)
130 Provides: php(tokenizer)
132 Provides: php(xhprof)
134 Provides: php(xmlreader)
135 Provides: php(xmlwriter)
139 Obsoletes: hiphop-php < 2.3.2-0.2
140 ExclusiveArch: %{x8664}
141 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
144 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
145 machine designed for executing programs written in PHP. HHVM uses a
146 just-in-time compilation approach to achieve superior performance
147 while maintaining the flexibility that PHP developers are accustomed
148 to. To date, HHVM (and its predecessor HPHPc before it) has realized
149 over a 9x increase in web request throughput and over a 5x reduction
150 in memory consumption for Facebook compared with the Zend PHP 5.2
153 HHVM can be run as a standalone webserver (i.e. without the Apache
154 webserver and the "mod_php" extension). HHVM can also be used together
155 with a FastCGI-based webserver, and work is in progress to make HHVM
156 work smoothly with Apache.
159 Summary: Init script to start HHVM as FastCGI daemon
160 Group: Development/Languages/PHP
161 Requires: %{name} = %{version}-%{release}
163 Requires(post,preun): /sbin/chkconfig
167 Init script to start HHVM as FastCGI daemon
170 Summary: /usr/bin/php symlink
171 Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
172 Group: Development/Languages/PHP
173 Requires: %{name} = %{version}-%{release}
174 Obsoletes: /usr/bin/php
177 Package providing /usr/bin/php symlink to PHP CLI.
179 %description program -l pl.UTF-8
180 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
183 Summary: Files for HHVM modules development
184 Group: Development/Languages/PHP
185 URL: https://github.com/facebook/hhvm/wiki/Extension-API
186 Requires: boost-devel >= 1.50
187 Requires: cmake >= 2.8.5
188 Requires: glog-devel >= 0.3.2
189 Requires: libstdc++-devel >= 6:4.3
190 Requires: tbb-devel >= 4.0.6000
194 HHVM provides a set of APIs for adding built-in functionality to the
195 runtime either by way of pure PHP code, or a combination of PHP and
199 %setup -q -a2 -n %{name}-HHVM-%{version}
201 mv folly-*/* hphp/submodules/folly
208 # prefer ones from system
209 rm CMake/FindBISON.cmake
210 rm CMake/FindFLEX.cmake
211 rm CMake/FindFreetype.cmake
219 #rm -rf src/third_party/libmbfl
220 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
222 rm -rf src/third_party/xhp
223 rm -rf src/third_party/libafdt
227 export HPHP_HOME=$(pwd)
228 export HPHP_LIB=$HPHP_HOME/bin
231 # asm linking breaks on $CC containing spaces
232 if [[ "%{__cc}" = *ccache* ]]; then
233 cat <<-'EOF' > $HPHP_LIB/gcc
237 chmod +x $HPHP_LIB/gcc
242 # out of dir build broken (can't find it's tools)
248 -DCMAKE_PREFIX_PATH=%{_prefix} \
254 # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
255 # see hphp/util/generate-buildinfo.sh
256 export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
257 export HHVM_REPO_SCHEMA=$(date +%N_%s)
262 rm -rf $RPM_BUILD_ROOT
263 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
266 DESTDIR=$RPM_BUILD_ROOT
269 rm $RPM_BUILD_ROOT%{_includedir}/zip.h
270 rm $RPM_BUILD_ROOT%{_includedir}/zipconf.h
271 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.a
272 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.so
274 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
275 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
277 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
278 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
280 # install fastcgi initscript
281 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
282 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
283 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
286 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
287 cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
291 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
292 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
296 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
300 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
306 $HPHP_HOME/hphp/runtime \
307 $HPHP_HOME/hphp/util \
308 $HPHP_HOME/hphp/neo \
309 $HPHP_HOME/hphp/system \
310 $HPHP_HOME/hphp/parser \
312 echo "D %{_includedir}${dir#$HPHP_HOME}"
313 find $dir -name '*.h' | while read path; do
314 file=%{_includedir}${path#$HPHP_HOME}
316 install -Dp $path $RPM_BUILD_ROOT$file
322 rm -rf $RPM_BUILD_ROOT
324 %post -p /sbin/ldconfig
325 %postun -p /sbin/ldconfig
328 /sbin/chkconfig --add %{name}-fcgi
329 %service %{name}-fcgi restart
332 if [ "$1" = "0" ]; then
333 %service -q %{name}-fcgi stop
334 /sbin/chkconfig --del %{name}-fcgi
338 %defattr(644,root,root,755)
339 %doc README.md hphp/NEWS
340 %dir %{_sysconfdir}/%{name}
341 %attr(755,root,root) %{_bindir}/hhvm
342 %attr(755,root,root) %{_bindir}/hphp
344 %dir %{_datadir}/%{name}
345 %dir %{_datadir}/%{name}/hdf
346 %{_datadir}/%{name}/hdf/static.mime-types.hdf
349 %defattr(644,root,root,755)
350 %attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
351 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_bindir}/php
358 %defattr(644,root,root,755)
359 %attr(755,root,root) %{_bindir}/hphpize
361 %{_datadir}/cmake/Modules/ExtZendCompat.cmake
362 %{_datadir}/cmake/Modules/FindCClient.cmake
363 %{_datadir}/cmake/Modules/FindEditline.cmake
364 %{_datadir}/cmake/Modules/FindGlog.cmake
365 %{_datadir}/cmake/Modules/FindICU.cmake
366 %{_datadir}/cmake/Modules/FindLdap.cmake
367 %{_datadir}/cmake/Modules/FindLibAfdt.cmake
368 %{_datadir}/cmake/Modules/FindLibCh.cmake
369 %{_datadir}/cmake/Modules/FindLibDL.cmake
370 %{_datadir}/cmake/Modules/FindLibDwarf.cmake
371 %{_datadir}/cmake/Modules/FindLibElf.cmake
372 %{_datadir}/cmake/Modules/FindLibJpeg.cmake
373 %{_datadir}/cmake/Modules/FindLibMagickWand.cmake
374 %{_datadir}/cmake/Modules/FindLibNuma.cmake
375 %{_datadir}/cmake/Modules/FindLibPng.cmake
376 %{_datadir}/cmake/Modules/FindLibUODBC.cmake
377 %{_datadir}/cmake/Modules/FindLibXed.cmake
378 %{_datadir}/cmake/Modules/FindLibYaml.cmake
379 %{_datadir}/cmake/Modules/FindLibiconv.cmake
380 %{_datadir}/cmake/Modules/FindLibinotify.cmake
381 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
382 %{_datadir}/cmake/Modules/FindLibpam.cmake
383 %{_datadir}/cmake/Modules/FindMcrypt.cmake
384 %{_datadir}/cmake/Modules/FindMySQL.cmake
385 %{_datadir}/cmake/Modules/FindNcurses.cmake
386 %{_datadir}/cmake/Modules/FindOCaml.cmake
387 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
388 %{_datadir}/cmake/Modules/FindPCRE.cmake
389 %{_datadir}/cmake/Modules/FindPThread.cmake
390 %{_datadir}/cmake/Modules/FindReadline.cmake
391 %{_datadir}/cmake/Modules/FindTBB.cmake
392 %{_datadir}/cmake/Modules/FollySetup.cmake
393 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
394 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
395 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
396 %{_datadir}/cmake/Modules/HPHPSetup.cmake
397 %{_datadir}/cmake/Modules/Options.cmake
398 %{_datadir}/cmake/Modules/hphpize.cmake