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