]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
add link to hhvm ini vars
[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
745db304
ER
6# git show HHVM-3.2.0
7%define githash 01228273b8cf709aacbd3df1c51b1e690ecebac8
8%define folly 09a81a9
9%define thirdparty 2234d64
ed14b19f 10Summary: Virtual Machine, Runtime, and JIT for PHP
aa7908cc 11Name: hhvm
745db304 12Version: 3.2.0
aade5dfc 13Release: 1
3f49543c 14License: PHP 3.01
ac2930bc 15Group: Development/Languages
aa7908cc 16Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
745db304 17# Source0-md5: 791ca8c56d155a71f948387de8859f98
500006c7 18Source2: https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
745db304
ER
19# Source2-md5: 17bc7ee76939cd6a26755588d80313c9
20Source3: https://github.com/hhvm/hhvm-third-party/archive/%{thirdparty}/third_party-%{thirdparty}.tar.gz
21# Source3-md5: 9d40c3fbf1394bb1f03648d7046f8b9c
22Source4: %{name}-fcgi.init
23Source5: %{name}-fcgi.sysconfig
c3ecb766 24Source6: php.ini
991b3017 25Source100: get-source.sh
449902dc
ER
26Patch0: ccache.patch
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
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
449902dc
ER
222%patch0 -p1
223%patch1 -p1
e66c75f6 224%patch2 -p1
ed14b19f 225
c6264399 226# prefer ones from system
20e9b450 227rm CMake/FindBISON.cmake
20e9b450 228rm CMake/FindFLEX.cmake
b17fa9dd 229rm CMake/FindFreetype.cmake
ed14b19f 230
ac2930bc 231%build
c171e0ff
ER
232# also in: hphp/tools/hphpize/hphpize.cmake
233API=$(awk '/#define HHVM_API_VERSION/{v=$3; sub(/L$/, "", v); print v}' hphp/runtime/ext/extension.h)
234
235if [ $API != %{hhvm_api_version} ]; then
236 echo "Set %%define hhvm_api_version to $API and re-run."
237 exit 1
238fi
239
e883c14f 240# out of dir build broken (can't find it's tools)
ef07ca95
ER
241install -d build
242cd build
449902dc
ER
243
244# handle cmake & ccache
245# http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec
246# ASM fix: http://lists.busybox.net/pipermail/buildroot/2013-March/069436.html
247if [[ "%{__cc}" = *ccache* ]]; then
248 cc="%{__cc}"
249 cxx="%{__cxx}"
250 ccache="
251 -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \
252 -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \
253 -DCMAKE_ASM_COMPILER="${cc#ccache }" \
254 "
255fi
e883c14f 256
ef07ca95 257%cmake \
449902dc 258 $ccache \
ef07ca95 259 -DCMAKE_PREFIX_PATH=%{_prefix} \
a0922d01 260 -DUSE_JEMALLOC=OFF \
be373886 261 -DUSE_TCMALLOC=OFF \
dc7e02ed 262 -DHPHP_NOTEST=ON \
541d5ea6 263 -DENABLE_COTIRE=ON \
449902dc 264 ../
c513fdf6 265
ac3c6624 266
c513fdf6
ER
267# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
268# see hphp/util/generate-buildinfo.sh
ac3c6624 269export COMPILER_ID=HHVM-%{version}-%{release}-g%{githash}
c513fdf6
ER
270export HHVM_REPO_SCHEMA=$(date +%N_%s)
271
ac2930bc
ER
272%{__make}
273
65446f6c 274%install
745db304
ER
275# make install relinks all outputs which is very slow,
276# so to speedup rebuild, use timestamps to record states
277#test %{_specdir}/%{name}.spec -nt makeinstall.stamp && %{__rm} -f makeinstall.stamp
278if [ ! -f makeinstall.stamp -o ! -d $RPM_BUILD_ROOT ]; then
279 rm -rf makeinstall.stamp installed.stamp $RPM_BUILD_ROOT
8d9f731f 280
449902dc 281 %{__make} install -C build \
745db304
ER
282 HPHP_HOME__=$(pwd) \
283 DESTDIR=$RPM_BUILD_ROOT
284
285 touch makeinstall.stamp
286fi
287
288rm -rf $RPM_BUILD_ROOT%{_docdir}
289if [ ! -f installed.stamp ]; then
745db304 290# begin install block
9c2504b3 291
073742e0 292install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}}
c3ecb766
ER
293cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
294
3234b364
ER
295ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
296ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
297
44fcba3e 298install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 299cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 300
2347c3ae
ER
301# install fastcgi initscript
302install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
745db304
ER
303cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
304cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
2347c3ae 305
ac3c6624
ER
306install -p hphp/hack/bin/hh_{server,client} $RPM_BUILD_ROOT%{_bindir}
307
745db304 308%if 0
c6264399
ER
309# setup -devel
310install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
9c2504b3 311cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
c6264399
ER
312
313HPHP_HOME=$(pwd)
314sed -e "
315 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
316" hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
317
318oIFS=$IFS
319IFS=";"
320set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
c6264399 321IFS=$oIFS
2a7c159c
ER
322set -- $(
323 for dir in "$@"; do
324 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
325 done
326)
327
328set +x
329for dir in "$@" \
330 $HPHP_HOME/hphp/runtime \
331 $HPHP_HOME/hphp/util \
332 $HPHP_HOME/hphp/neo \
333 $HPHP_HOME/hphp/system \
334 $HPHP_HOME/hphp/parser \
335; do
336 echo "D %{_includedir}${dir#$HPHP_HOME}"
337 find $dir -name '*.h' | while read path; do
338 file=%{_includedir}${path#$HPHP_HOME}
339 echo "F $file"
340 install -Dp $path $RPM_BUILD_ROOT$file
341 done
342done
343set -x
745db304
ER
344%endif
345
346# end of install block
347touch installed.stamp; fi
f6ea7eef 348
65446f6c
ER
349%clean
350rm -rf $RPM_BUILD_ROOT
351
8d9f731f
ER
352%post -p /sbin/ldconfig
353%postun -p /sbin/ldconfig
354
2347c3ae
ER
355%post fcgi
356/sbin/chkconfig --add %{name}-fcgi
357%service %{name}-fcgi restart
358
359%preun fcgi
360if [ "$1" = "0" ]; then
361 %service -q %{name}-fcgi stop
362 /sbin/chkconfig --del %{name}-fcgi
363fi
364
65446f6c
ER
365%files
366%defattr(644,root,root,755)
1c0ae000 367%doc README.md hphp/NEWS
349ae084 368%dir %{_sysconfdir}/%{name}
c3ecb766 369%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/php.ini
8d9f731f 370%attr(755,root,root) %{_bindir}/hhvm
3234b364 371%attr(755,root,root) %{_bindir}/hphp
ac3c6624
ER
372%attr(755,root,root) %{_bindir}/hh_client
373%attr(755,root,root) %{_bindir}/hh_server
44fcba3e
ER
374
375%dir %{_datadir}/%{name}
376%dir %{_datadir}/%{name}/hdf
377%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364 378
073742e0
ER
379# dir for extensions
380%dir %{_libdir}/%{name}
381
2347c3ae
ER
382%files fcgi
383%defattr(644,root,root,755)
384%attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
385%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
386
3234b364
ER
387%files program
388%defattr(644,root,root,755)
389%attr(755,root,root) %{_bindir}/php
c6264399
ER
390
391%files devel
392%defattr(644,root,root,755)
393%attr(755,root,root) %{_bindir}/hphpize
394%{_includedir}/hphp
745db304
ER
395%dir %{_prefix}/lib/hphp
396%{_prefix}/lib/hphp/CMake
397%{_prefix}/lib/hphp/hphpize
This page took 0.144209 seconds and 4 git commands to generate.