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