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