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/4d6d659/folly-0.1-4d6d659.tar.gz
19 # Source2-md5: 2e7c941f737c8e0a449b8116e7615656
20 Source100: get-source.sh
21 Patch0: cmake-missing-library.patch
22 Patch1: libevent14.patch
23 Patch3: system-xhp.patch
24 Patch4: system-libafdt.patch
25 Patch5: system-folly.patch
26 Patch6: checksum.patch
27 Patch7: imap-gss.patch
29 URL: http://wiki.github.com/facebook/hiphop-php/
30 BuildRequires: apr-devel
31 BuildRequires: autoconf
32 BuildRequires: binutils-devel
33 BuildRequires: bison >= 2.3
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: flex >= 2.5.35
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: libafdt-devel >= 0.1.0
46 BuildRequires: libcap-devel
47 BuildRequires: libdwarf-devel
48 #BuildRequires: libevent-devel >= 1.4.14
49 BuildRequires: libicu-devel >= 4.2
50 #BuildRequires: libmbfl-devel
51 BuildRequires: libmcrypt-devel
52 BuildRequires: libmemcached-devel >= 1.0.4
53 BuildRequires: libstdc++-devel >= 6:4.3
54 BuildRequires: libunwind-devel
55 BuildRequires: libxml2-devel
56 BuildRequires: mysql-devel
57 BuildRequires: oniguruma-devel
58 BuildRequires: openssl-devel
59 BuildRequires: pcre-devel
60 #BuildRequires: php-xhp-devel >= 1.3.9-6
61 BuildRequires: re2c >= 0.13.0
62 BuildRequires: readline-devel
63 BuildRequires: rpmbuild(macros) >= 1.675
64 BuildRequires: tbb-devel >= 4.0.6000
65 BuildRequires: zlib-devel
75 Provides: php(fileinfo)
79 Provides: php(hotprofiler)
81 Provides: php(icu_num_fmt)
82 Provides: php(icu_ucsdet)
83 Provides: php(icu_uspoof)
88 Provides: php(mbstring)
90 Provides: php(memcache)
91 Provides: php(memcached)
93 Provides: php(openssl)
97 Provides: php(pdo_mysql)
98 Provides: php(pdo_sqlite)
101 Provides: php(reflection)
102 Provides: php(server)
103 Provides: php(session)
104 Provides: php(simplexml)
106 Provides: php(sockets)
108 Provides: php(sqlite3)
109 Provides: php(sysvmsg)
110 Provides: php(sysvsem)
111 Provides: php(sysvshm)
112 Provides: php(thread)
113 Provides: php(thrift_protocol)
114 Provides: php(tokenizer)
115 Provides: php(xhprof)
117 Provides: php(xmlreader)
118 Provides: php(xmlwriter)
121 Obsoletes: hiphop-php < 2.3.2-0.2
122 ExclusiveArch: %{x8664}
123 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
126 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
127 machine designed for executing programs written in PHP. HHVM uses a
128 just-in-time compilation approach to achieve superior performance
129 while maintaining the flexibility that PHP developers are accustomed
130 to. To date, HHVM (and its predecessor HPHPc before it) has realized
131 over a 9x increase in web request throughput and over a 5x reduction
132 in memory consumption for Facebook compared with the Zend PHP 5.2
135 HHVM can be run as a standalone webserver (i.e. without the Apache
136 webserver and the "mod_php" extension). HHVM can also be used together
137 with a FastCGI-based webserver, and work is in progress to make HHVM
138 work smoothly with Apache.
141 Summary: /usr/bin/php symlink
142 Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
143 Group: Development/Languages/PHP
144 Requires: %{name} = %{version}-%{release}
145 Obsoletes: /usr/bin/php
148 Package providing /usr/bin/php symlink to PHP CLI.
150 %description program -l pl.UTF-8
151 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
154 Summary: Files for HHVM modules development
155 Group: Development/Languages/PHP
156 URL: https://github.com/facebook/hhvm/wiki/Extension-API
157 Requires: boost-devel >= 1.50
158 Requires: cmake >= 2.8.5
159 Requires: glog-devel >= 0.3.2
160 Requires: libstdc++-devel >= 6:4.3
161 Requires: tbb-devel >= 4.0.6000
165 HHVM provides a set of APIs for adding built-in functionality to the
166 runtime either by way of pure PHP code, or a combination of PHP and
170 %setup -q -a1 -a2 -n %{name}-HHVM-%{version}
172 mv folly-*/* hphp/submodules/folly
173 # https://github.com/facebook/folly/pull/44
174 sed -i -e '21 d' hphp/third_party/folly/folly/detail/Malloc.h
181 # prefer ones from system
182 rm CMake/FindBISON.cmake
183 rm CMake/FindBoost.cmake
184 rm CMake/FindFLEX.cmake
186 ln -s libevent-1.4.*-stable libevent
187 %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
196 #rm -rf src/third_party/libmbfl
197 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
199 rm -rf src/third_party/xhp
200 rm -rf src/third_party/libafdt
204 # build libevent 1.4 with fb patches
205 if [ ! -d libevent/.libs ]; then
207 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
209 %{?0:--enable-static} \
210 %{?0:--disable-shared}
217 export HPHP_HOME=$(pwd)
218 export HPHP_LIB=$HPHP_HOME/bin
221 # asm linking breaks on $CC containing spaces
222 if [[ "%{__cc}" = *ccache* ]]; then
223 cat <<-'EOF' > $HPHP_LIB/gcc
227 chmod +x $HPHP_LIB/gcc
232 export LIBEVENT_PREFIX=$HPHP_HOME/libevent
234 -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
235 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
236 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
240 # out of dir build broken (can't find it's tools)
246 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
247 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
248 -DCMAKE_PREFIX_PATH=%{_prefix} \
249 -DSKIP_BUNDLED_XHP=ON \
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=HPHP-%{version}-%{release}-%{githash}
257 export HHVM_REPO_SCHEMA=$(date +%N_%s)
262 rm -rf $RPM_BUILD_ROOT
265 DESTDIR=$RPM_BUILD_ROOT
267 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
268 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
270 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
271 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
273 # install our libevent for now
274 install -d $RPM_BUILD_ROOT%{_libdir}
275 libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
276 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
279 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
280 cp -a CMake/* $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
284 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
285 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
289 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
293 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
299 $HPHP_HOME/hphp/runtime \
300 $HPHP_HOME/hphp/util \
301 $HPHP_HOME/hphp/neo \
302 $HPHP_HOME/hphp/system \
303 $HPHP_HOME/hphp/parser \
305 echo "D %{_includedir}${dir#$HPHP_HOME}"
306 find $dir -name '*.h' | while read path; do
307 file=%{_includedir}${path#$HPHP_HOME}
309 install -Dp $path $RPM_BUILD_ROOT$file
315 rm -rf $RPM_BUILD_ROOT
317 %post -p /sbin/ldconfig
318 %postun -p /sbin/ldconfig
321 %defattr(644,root,root,755)
322 %doc README.md hphp/NEWS
323 %attr(755,root,root) %{_bindir}/hhvm
324 %attr(755,root,root) %{_bindir}/hphp
325 %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
326 %ghost %{_libdir}/libevent-1.4.so.2
328 %dir %{_datadir}/%{name}
329 %dir %{_datadir}/%{name}/hdf
330 %{_datadir}/%{name}/hdf/static.mime-types.hdf
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_bindir}/php
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_bindir}/hphpize
340 %{_datadir}/cmake/Modules/hphpize.cmake
341 %{_datadir}/cmake/Modules/FindCClient.cmake
342 %{_datadir}/cmake/Modules/FindEditline.cmake
343 %{_datadir}/cmake/Modules/FindGD.cmake
344 %{_datadir}/cmake/Modules/FindGlog.cmake
345 %{_datadir}/cmake/Modules/FindICU.cmake
346 %{_datadir}/cmake/Modules/FindLdap.cmake
347 %{_datadir}/cmake/Modules/FindLibAfdt.cmake
348 %{_datadir}/cmake/Modules/FindLibCh.cmake
349 %{_datadir}/cmake/Modules/FindLibDL.cmake
350 %{_datadir}/cmake/Modules/FindLibDwarf.cmake
351 %{_datadir}/cmake/Modules/FindLibElf.cmake
352 %{_datadir}/cmake/Modules/FindLibEvent.cmake
353 %{_datadir}/cmake/Modules/FindLibEvent.cmake.bak
354 %{_datadir}/cmake/Modules/FindLibNuma.cmake
355 %{_datadir}/cmake/Modules/FindLibXed.cmake
356 %{_datadir}/cmake/Modules/FindLibiconv.cmake
357 %{_datadir}/cmake/Modules/FindLibinotify.cmake
358 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
359 %{_datadir}/cmake/Modules/FindLibpam.cmake
360 %{_datadir}/cmake/Modules/FindMcrypt.cmake
361 %{_datadir}/cmake/Modules/FindMySQL.cmake
362 %{_datadir}/cmake/Modules/FindNcurses.cmake
363 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
364 %{_datadir}/cmake/Modules/FindPCRE.cmake
365 %{_datadir}/cmake/Modules/FindPThread.cmake
366 %{_datadir}/cmake/Modules/FindReadline.cmake
367 %{_datadir}/cmake/Modules/FindTBB.cmake
368 %{_datadir}/cmake/Modules/FollySetup.cmake
369 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
370 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
371 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
372 %{_datadir}/cmake/Modules/HPHPSetup.cmake
373 %{_datadir}/cmake/Modules/Options.cmake