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