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