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