]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
up to 3.3.0 LTS
[packages/hhvm.git] / hhvm.spec
CommitLineData
89ad59aa
ER
1# NOTES:
2# - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
073742e0 3# - patch /usr/lib/hphp/CMake/HPHPIZEFunctions.cmake for %{_libdir}/hhvm as extension dir
ac2930bc 4# TODO
59f13ffd 5# - system libmbfl, system xhp, sqlite3
6135817a
ER
6# git show HHVM-3.3.0
7%define githash 0a3cfb87b8a353fc7e1d15374f4adc413e37aba9
8# these hashes are git submodules
9%define folly 4ecd8cd
10%define thrift 378e954
11%define thirdparty 12acbba
ed14b19f 12Summary: Virtual Machine, Runtime, and JIT for PHP
aa7908cc 13Name: hhvm
6135817a
ER
14Version: 3.3.0
15Release: 0.1
16License: PHP 3.01 and BSD
ac2930bc 17Group: Development/Languages
aa7908cc 18Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
6135817a 19# Source0-md5: ca42861748d0ddace763ed20bafe7116
500006c7 20Source2: https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
6135817a 21# Source2-md5: b9d32bbccffc260cfc6752152ddf06a9
745db304 22Source3: https://github.com/hhvm/hhvm-third-party/archive/%{thirdparty}/third_party-%{thirdparty}.tar.gz
6135817a
ER
23# Source3-md5: b2c28724e4ec5e4d2ea7e87f29690da2
24Source4: https://github.com/facebook/fbthrift/archive/%{thrift}/thrift-%{thrift}.tar.gz
25# Source4-md5: 872f84f6ec0cc3d4f6c8471d99fcc7df
26Source5: %{name}-fcgi.init
27Source6: %{name}-fcgi.sysconfig
28Source7: php.ini
991b3017 29Source100: get-source.sh
449902dc 30Patch1: no-debug.patch
e66c75f6 31Patch2: hphpize.patch
ff452300 32URL: https://github.com/facebook/hhvm/wiki
f7556a8c 33BuildRequires: ImageMagick-devel
9256e518 34BuildRequires: a52dec-libs-devel
b05f3896
ER
35BuildRequires: apr-devel
36BuildRequires: autoconf
3f49543c 37BuildRequires: binutils-devel
6135817a
ER
38# CMake/HPHPFindLibs.cmake:364 - FIND_LIBRARY (BFD_LIB libbfd.a)
39BuildRequires: binutils-static
ed14b19f 40BuildRequires: boost-devel >= 1.50
745db304 41BuildRequires: cmake >= 2.8.5
ed14b19f
ER
42BuildRequires: curl-devel >= 7.29.0
43BuildRequires: elfutils-devel
3f49543c 44BuildRequires: expat-devel
5c61d46f 45BuildRequires: gcc >= 6:4.6.0
3f49543c 46BuildRequires: gd-devel
ed14b19f
ER
47BuildRequires: glog-devel >= 0.3.2
48BuildRequires: imap-devel >= 1:2007
991b3017 49#BuildRequires: jemalloc-devel >= 3.0.0
3f49543c 50BuildRequires: libcap-devel
04f13235 51BuildRequires: libdwarf-devel >= 20130729
ac2930bc 52BuildRequires: libicu-devel >= 4.2
be373886 53#BuildRequires: libmbfl-devel
ed14b19f 54BuildRequires: libmcrypt-devel
e883c14f 55BuildRequires: libmemcached-devel >= 1.0.4
491a5eb9 56BuildRequires: libstdc++-devel >= 6:4.8
ed14b19f 57BuildRequires: libunwind-devel
ac2930bc 58BuildRequires: libxml2-devel
9256e518 59BuildRequires: libxslt-devel
3f49543c 60BuildRequires: mysql-devel
04f13235 61BuildRequires: ocaml-findlib
ac2930bc 62BuildRequires: oniguruma-devel
3f49543c
ER
63BuildRequires: openssl-devel
64BuildRequires: pcre-devel
ed14b19f 65#BuildRequires: php-xhp-devel >= 1.3.9-6
ed14b19f 66BuildRequires: readline-devel
89ad59aa 67BuildRequires: rpmbuild(macros) >= 1.675
ed14b19f 68BuildRequires: tbb-devel >= 4.0.6000
3f49543c 69BuildRequires: zlib-devel
21df9de7
ER
70# check later, seem unused
71#BuildRequires: bison >= 2.3
72#BuildRequires: flex >= 2.5.35
73#BuildRequires: libafdt-devel >= 0.1.0
74#BuildRequires: re2c >= 0.13.0
9c2504b3 75# foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
87330af7 76Provides: %{name}(api) = %{hhvm_api_version}
9c2504b3 77Provides: php(apache)
206caaaf
ER
78Provides: php(apc)
79Provides: php(bcmath)
991b3017 80Provides: php(bz2)
745db304 81Provides: php(calendar)
87330af7 82Provides: php(core) = %{php_version}
206caaaf
ER
83Provides: php(ctype)
84Provides: php(curl)
85Provides: php(date)
9c2504b3 86Provides: php(debugger)
206caaaf
ER
87Provides: php(dom)
88Provides: php(exif)
89Provides: php(fb)
991b3017 90Provides: php(fileinfo)
206caaaf 91Provides: php(filter)
745db304 92Provides: php(ftp)
206caaaf 93Provides: php(gd)
745db304 94Provides: php(gettext)
206caaaf 95Provides: php(hash)
9c2504b3
ER
96Provides: php(hh)
97Provides: php(hhvm.debugger)
98Provides: php(hhvm.ini)
206caaaf
ER
99Provides: php(hotprofiler)
100Provides: php(iconv)
206caaaf 101Provides: php(idn)
9c2504b3 102Provides: php(imagick)
206caaaf 103Provides: php(imap)
9c2504b3 104Provides: php(intl)
206caaaf
ER
105Provides: php(json)
106Provides: php(ldap)
9c2504b3 107Provides: php(libxml)
206caaaf
ER
108Provides: php(mbstring)
109Provides: php(mcrypt)
110Provides: php(memcache)
111Provides: php(memcached)
9c2504b3 112Provides: php(misc)
206caaaf 113Provides: php(mysql)
9c2504b3 114Provides: php(mysqli)
745db304 115Provides: php(oauth)
206caaaf
ER
116Provides: php(openssl)
117Provides: php(pcntl)
118Provides: php(pcre)
745db304 119Provides: php(pcre_zend_compat)
206caaaf
ER
120Provides: php(pdo)
121Provides: php(pdo_mysql)
122Provides: php(pdo_sqlite)
123Provides: php(phar)
124Provides: php(posix)
9c2504b3 125Provides: php(redis)
206caaaf
ER
126Provides: php(reflection)
127Provides: php(server)
128Provides: php(session)
129Provides: php(simplexml)
130Provides: php(soap)
131Provides: php(sockets)
132Provides: php(spl)
133Provides: php(sqlite3)
745db304
ER
134Provides: php(standard)
135Provides: php(standard_zend_compat)
9c2504b3 136Provides: php(stream)
206caaaf
ER
137Provides: php(sysvmsg)
138Provides: php(sysvsem)
139Provides: php(sysvshm)
140Provides: php(thread)
141Provides: php(thrift_protocol)
142Provides: php(tokenizer)
9c2504b3 143Provides: php(url)
745db304
ER
144Provides: php(wddx)
145Provides: php(xenon)
206caaaf
ER
146Provides: php(xhprof)
147Provides: php(xml)
148Provides: php(xmlreader)
149Provides: php(xmlwriter)
9c2504b3 150Provides: php(xsl)
745db304 151Provides: php(yaml)
991b3017 152Provides: php(zip)
206caaaf 153Provides: php(zlib)
991b3017 154Obsoletes: hiphop-php < 2.3.2-0.2
17c75ade 155ExclusiveArch: %{x8664}
65446f6c
ER
156BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
157
c171e0ff 158# must be in sync with source. extra check ensuring that it is so is done in %%build
6135817a 159%define hhvm_api_version 20140829
87330af7
ER
160# hphp/system/idl/constants.idl.json defines it as 5.6.99-hhvm, but use some saner value
161%define php_version 5.6.0
c171e0ff 162
6135817a
ER
163%define hhvm_extensiondir %{_libdir}/hhvm
164
65446f6c 165%description
aa7908cc
ER
166HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
167machine designed for executing programs written in PHP. HHVM uses a
168just-in-time compilation approach to achieve superior performance
169while maintaining the flexibility that PHP developers are accustomed
170to. To date, HHVM (and its predecessor HPHPc before it) has realized
171over a 9x increase in web request throughput and over a 5x reduction
172in memory consumption for Facebook compared with the Zend PHP 5.2
173engine + APC.
174
175HHVM can be run as a standalone webserver (i.e. without the Apache
176webserver and the "mod_php" extension). HHVM can also be used together
177with a FastCGI-based webserver, and work is in progress to make HHVM
178work smoothly with Apache.
65446f6c 179
2347c3ae
ER
180%package fcgi
181Summary: Init script to start HHVM as FastCGI daemon
182Group: Development/Languages/PHP
183Requires: %{name} = %{version}-%{release}
184Provides: php(fcgi)
185Requires(post,preun): /sbin/chkconfig
186Requires: rc-scripts
187
188%description fcgi
189Init script to start HHVM as FastCGI daemon
190
3234b364
ER
191%package program
192Summary: /usr/bin/php symlink
193Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
194Group: Development/Languages/PHP
195Requires: %{name} = %{version}-%{release}
196Obsoletes: /usr/bin/php
197
198%description program
199Package providing /usr/bin/php symlink to PHP CLI.
200
201%description program -l pl.UTF-8
202Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
203
c6264399
ER
204%package devel
205Summary: Files for HHVM modules development
206Group: Development/Languages/PHP
207URL: https://github.com/facebook/hhvm/wiki/Extension-API
f6ea7eef 208Requires: boost-devel >= 1.50
c6264399 209Requires: cmake >= 2.8.5
f6ea7eef 210Requires: glog-devel >= 0.3.2
e7779ee6 211Requires: libstdc++-devel >= 6:4.3
f6ea7eef
ER
212Requires: tbb-devel >= 4.0.6000
213Requires: zlib-devel
c6264399
ER
214
215%description devel
216HHVM provides a set of APIs for adding built-in functionality to the
217runtime either by way of pure PHP code, or a combination of PHP and
218C++.
219
65446f6c 220%prep
6135817a 221%setup -q -n %{name}-HHVM-%{version} -a2 -a3 -a4
991b3017 222
745db304
ER
223# handle git submodules
224rmdir third-party
225mv hhvm-third-party-* third-party
226rmdir third-party/folly/src
227mv folly-* third-party/folly/src
6135817a
ER
228rmdir third-party/thrift/src
229mv fbthrift-* third-party/thrift/src
f8472382 230
449902dc 231%patch1 -p1
e66c75f6 232%patch2 -p1
ed14b19f 233
c6264399 234# prefer ones from system
20e9b450 235rm CMake/FindBISON.cmake
20e9b450 236rm CMake/FindFLEX.cmake
b17fa9dd 237rm CMake/FindFreetype.cmake
ed14b19f 238
ac2930bc 239%build
c171e0ff
ER
240# also in: hphp/tools/hphpize/hphpize.cmake
241API=$(awk '/#define HHVM_API_VERSION/{v=$3; sub(/L$/, "", v); print v}' hphp/runtime/ext/extension.h)
242
243if [ $API != %{hhvm_api_version} ]; then
244 echo "Set %%define hhvm_api_version to $API and re-run."
245 exit 1
246fi
247
e883c14f 248# out of dir build broken (can't find it's tools)
ef07ca95
ER
249install -d build
250cd build
449902dc
ER
251
252# handle cmake & ccache
253# http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec
254# ASM fix: http://lists.busybox.net/pipermail/buildroot/2013-March/069436.html
255if [[ "%{__cc}" = *ccache* ]]; then
256 cc="%{__cc}"
257 cxx="%{__cxx}"
258 ccache="
259 -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \
260 -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \
261 -DCMAKE_ASM_COMPILER="${cc#ccache }" \
262 "
263fi
e883c14f 264
ef07ca95 265%cmake \
449902dc 266 $ccache \
ef07ca95 267 -DCMAKE_PREFIX_PATH=%{_prefix} \
6135817a 268 -DHHVM_DYNAMIC_EXTENSION_DIR=%{hhvm_extensiondir} \
a0922d01 269 -DUSE_JEMALLOC=OFF \
be373886 270 -DUSE_TCMALLOC=OFF \
dc7e02ed 271 -DHPHP_NOTEST=ON \
541d5ea6 272 -DENABLE_COTIRE=ON \
449902dc 273 ../
c513fdf6 274
ac3c6624 275
c513fdf6
ER
276# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
277# see hphp/util/generate-buildinfo.sh
ac3c6624 278export COMPILER_ID=HHVM-%{version}-%{release}-g%{githash}
c513fdf6
ER
279export HHVM_REPO_SCHEMA=$(date +%N_%s)
280
ac2930bc
ER
281%{__make}
282
65446f6c 283%install
745db304
ER
284# make install relinks all outputs which is very slow,
285# so to speedup rebuild, use timestamps to record states
286#test %{_specdir}/%{name}.spec -nt makeinstall.stamp && %{__rm} -f makeinstall.stamp
287if [ ! -f makeinstall.stamp -o ! -d $RPM_BUILD_ROOT ]; then
288 rm -rf makeinstall.stamp installed.stamp $RPM_BUILD_ROOT
8d9f731f 289
449902dc 290 %{__make} install -C build \
745db304
ER
291 HPHP_HOME__=$(pwd) \
292 DESTDIR=$RPM_BUILD_ROOT
293
294 touch makeinstall.stamp
295fi
296
297rm -rf $RPM_BUILD_ROOT%{_docdir}
298if [ ! -f installed.stamp ]; then
745db304 299# begin install block
9c2504b3 300
073742e0 301install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}}
6135817a 302cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
c3ecb766 303
3234b364
ER
304ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
305ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
306
44fcba3e 307install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 308cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 309
2347c3ae
ER
310# install fastcgi initscript
311install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
6135817a
ER
312cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
313cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
2347c3ae 314
ac3c6624
ER
315install -p hphp/hack/bin/hh_{server,client} $RPM_BUILD_ROOT%{_bindir}
316
745db304 317%if 0
c6264399
ER
318# setup -devel
319install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
9c2504b3 320cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
c6264399
ER
321
322HPHP_HOME=$(pwd)
323sed -e "
324 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
325" hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
326
327oIFS=$IFS
328IFS=";"
329set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
c6264399 330IFS=$oIFS
2a7c159c
ER
331set -- $(
332 for dir in "$@"; do
333 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
334 done
335)
336
337set +x
338for dir in "$@" \
339 $HPHP_HOME/hphp/runtime \
340 $HPHP_HOME/hphp/util \
341 $HPHP_HOME/hphp/neo \
342 $HPHP_HOME/hphp/system \
343 $HPHP_HOME/hphp/parser \
344; do
345 echo "D %{_includedir}${dir#$HPHP_HOME}"
346 find $dir -name '*.h' | while read path; do
347 file=%{_includedir}${path#$HPHP_HOME}
348 echo "F $file"
349 install -Dp $path $RPM_BUILD_ROOT$file
350 done
351done
352set -x
745db304
ER
353%endif
354
355# end of install block
356touch installed.stamp; fi
f6ea7eef 357
65446f6c
ER
358%clean
359rm -rf $RPM_BUILD_ROOT
360
8d9f731f
ER
361%post -p /sbin/ldconfig
362%postun -p /sbin/ldconfig
363
2347c3ae
ER
364%post fcgi
365/sbin/chkconfig --add %{name}-fcgi
366%service %{name}-fcgi restart
367
368%preun fcgi
369if [ "$1" = "0" ]; then
370 %service -q %{name}-fcgi stop
371 /sbin/chkconfig --del %{name}-fcgi
372fi
373
65446f6c
ER
374%files
375%defattr(644,root,root,755)
1c0ae000 376%doc README.md hphp/NEWS
349ae084 377%dir %{_sysconfdir}/%{name}
c3ecb766 378%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/php.ini
8d9f731f 379%attr(755,root,root) %{_bindir}/hhvm
3234b364 380%attr(755,root,root) %{_bindir}/hphp
ac3c6624
ER
381%attr(755,root,root) %{_bindir}/hh_client
382%attr(755,root,root) %{_bindir}/hh_server
44fcba3e
ER
383
384%dir %{_datadir}/%{name}
385%dir %{_datadir}/%{name}/hdf
386%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364 387
073742e0
ER
388# dir for extensions
389%dir %{_libdir}/%{name}
390
2347c3ae
ER
391%files fcgi
392%defattr(644,root,root,755)
393%attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
394%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
395
3234b364
ER
396%files program
397%defattr(644,root,root,755)
398%attr(755,root,root) %{_bindir}/php
c6264399
ER
399
400%files devel
401%defattr(644,root,root,755)
402%attr(755,root,root) %{_bindir}/hphpize
403%{_includedir}/hphp
745db304
ER
404%dir %{_prefix}/lib/hphp
405%{_prefix}/lib/hphp/CMake
406%{_prefix}/lib/hphp/hphpize
This page took 0.090139 seconds and 4 git commands to generate.