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: 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));
75 Provides: php(debugger)
79 Provides: php(fileinfo)
81 Provides: php(function)
85 Provides: php(hhvm.debugger)
86 Provides: php(hhvm.ini)
87 Provides: php(hotprofiler)
90 Provides: php(imagick)
96 Provides: php(mbstring)
98 Provides: php(memcache)
99 Provides: php(memcached)
102 Provides: php(mysqli)
103 Provides: php(openssl)
107 Provides: php(pdo_mysql)
108 Provides: php(pdo_sqlite)
112 Provides: php(reflection)
113 Provides: php(server)
114 Provides: php(session)
115 Provides: php(simplexml)
117 Provides: php(sockets)
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)
128 Provides: php(xhprof)
130 Provides: php(xmlreader)
131 Provides: php(xmlwriter)
135 Obsoletes: hiphop-php < 2.3.2-0.2
136 ExclusiveArch: %{x8664}
137 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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.
155 Summary: Init script to start HHVM as FastCGI daemon
156 Group: Development/Languages/PHP
157 Requires: %{name} = %{version}-%{release}
159 Requires(post,preun): /sbin/chkconfig
163 Init script to start HHVM as FastCGI daemon
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
173 Package providing /usr/bin/php symlink to PHP CLI.
175 %description program -l pl.UTF-8
176 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
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
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
195 %setup -q -a2 -n %{name}-HHVM-%{version}
197 mv folly-*/* hphp/submodules/folly
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
216 #rm -rf src/third_party/libmbfl
217 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
219 rm -rf src/third_party/xhp
220 rm -rf src/third_party/libafdt
224 export HPHP_HOME=$(pwd)
225 export HPHP_LIB=$HPHP_HOME/bin
228 # asm linking breaks on $CC containing spaces
229 if [[ "%{__cc}" = *ccache* ]]; then
230 cat <<-'EOF' > $HPHP_LIB/gcc
234 chmod +x $HPHP_LIB/gcc
239 # out of dir build broken (can't find it's tools)
245 -DCMAKE_PREFIX_PATH=%{_prefix} \
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)
259 rm -rf $RPM_BUILD_ROOT
260 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
263 DESTDIR=$RPM_BUILD_ROOT
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
271 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
272 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
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
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
283 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
284 cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
288 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
289 " hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
293 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
297 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
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 \
309 echo "D %{_includedir}${dir#$HPHP_HOME}"
310 find $dir -name '*.h' | while read path; do
311 file=%{_includedir}${path#$HPHP_HOME}
313 install -Dp $path $RPM_BUILD_ROOT$file
319 rm -rf $RPM_BUILD_ROOT
321 %post -p /sbin/ldconfig
322 %postun -p /sbin/ldconfig
325 /sbin/chkconfig --add %{name}-fcgi
326 %service %{name}-fcgi restart
329 if [ "$1" = "0" ]; then
330 %service -q %{name}-fcgi stop
331 /sbin/chkconfig --del %{name}-fcgi
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
341 %dir %{_datadir}/%{name}
342 %dir %{_datadir}/%{name}/hdf
343 %{_datadir}/%{name}/hdf/static.mime-types.hdf
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
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_bindir}/php
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_bindir}/hphpize
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