]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
cleanups
[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
11ccead6 4# - system libevent2: https://github.com/facebook/hiphop-php/pull/421
59f13ffd 5# - system libmbfl, system xhp, sqlite3
aa7908cc 6%define githash f951cb8d8812c59344d5322454853b584b668636
ed14b19f 7Summary: Virtual Machine, Runtime, and JIT for PHP
aa7908cc
ER
8Name: hhvm
9Version: 2.3.2
20e9b450 10Release: 0.8
3f49543c 11License: PHP 3.01
ac2930bc 12Group: Development/Languages
aa7908cc
ER
13Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
14# Source0-md5: 471961d38ba52c66b7038c556b2b7bd8
ef07ca95
ER
15# need fb.changes.patch, which is available for 1.4 only
16Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
17# Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c
f3c0b66f
ER
18Source2: https://github.com/facebook/folly/archive/4d6d659/folly-0.1-4d6d659.tar.gz
19# Source2-md5: 2e7c941f737c8e0a449b8116e7615656
991b3017 20Source100: get-source.sh
59f13ffd 21Patch0: cmake-missing-library.patch
be373886 22Patch1: libevent14.patch
ef07ca95
ER
23Patch3: system-xhp.patch
24Patch4: system-libafdt.patch
6147aa3c 25Patch5: system-folly.patch
457edd58
ER
26Patch6: checksum.patch
27Patch7: imap-gss.patch
c6264399 28Patch8: hphpize.patch
3f49543c 29URL: http://wiki.github.com/facebook/hiphop-php/
b05f3896
ER
30BuildRequires: apr-devel
31BuildRequires: autoconf
3f49543c 32BuildRequires: binutils-devel
ed14b19f 33BuildRequires: boost-devel >= 1.50
991b3017 34BuildRequires: cmake >= 2.8.7
ed14b19f
ER
35BuildRequires: curl-devel >= 7.29.0
36BuildRequires: elfutils-devel
3f49543c 37BuildRequires: expat-devel
5c61d46f 38BuildRequires: gcc >= 6:4.6.0
3f49543c 39BuildRequires: gd-devel
ed14b19f
ER
40BuildRequires: glog-devel >= 0.3.2
41BuildRequires: imap-devel >= 1:2007
991b3017 42#BuildRequires: jemalloc-devel >= 3.0.0
3f49543c 43BuildRequires: libcap-devel
ed14b19f
ER
44BuildRequires: libdwarf-devel
45#BuildRequires: libevent-devel >= 1.4.14
ac2930bc 46BuildRequires: libicu-devel >= 4.2
be373886 47#BuildRequires: libmbfl-devel
ed14b19f 48BuildRequires: libmcrypt-devel
e883c14f 49BuildRequires: libmemcached-devel >= 1.0.4
ef07ca95 50BuildRequires: libstdc++-devel >= 6:4.3
ed14b19f 51BuildRequires: libunwind-devel
ac2930bc 52BuildRequires: libxml2-devel
3f49543c 53BuildRequires: mysql-devel
ac2930bc 54BuildRequires: oniguruma-devel
3f49543c
ER
55BuildRequires: openssl-devel
56BuildRequires: pcre-devel
ed14b19f 57#BuildRequires: php-xhp-devel >= 1.3.9-6
ed14b19f 58BuildRequires: readline-devel
89ad59aa 59BuildRequires: rpmbuild(macros) >= 1.675
ed14b19f 60BuildRequires: tbb-devel >= 4.0.6000
3f49543c 61BuildRequires: zlib-devel
21df9de7
ER
62# check later, seem unused
63#BuildRequires: bison >= 2.3
64#BuildRequires: flex >= 2.5.35
65#BuildRequires: libafdt-devel >= 0.1.0
66#BuildRequires: re2c >= 0.13.0
206caaaf
ER
67Provides: php(apc)
68Provides: php(bcmath)
991b3017 69Provides: php(bz2)
206caaaf
ER
70Provides: php(ctype)
71Provides: php(curl)
72Provides: php(date)
73Provides: php(dom)
74Provides: php(exif)
75Provides: php(fb)
991b3017 76Provides: php(fileinfo)
206caaaf
ER
77Provides: php(filter)
78Provides: php(gd)
79Provides: php(hash)
80Provides: php(hotprofiler)
81Provides: php(iconv)
991b3017 82Provides: php(icu_num_fmt)
206caaaf
ER
83Provides: php(icu_ucsdet)
84Provides: php(icu_uspoof)
85Provides: php(idn)
86Provides: php(imap)
87Provides: php(json)
88Provides: php(ldap)
89Provides: php(mbstring)
90Provides: php(mcrypt)
91Provides: php(memcache)
92Provides: php(memcached)
93Provides: php(mysql)
94Provides: php(openssl)
95Provides: php(pcntl)
96Provides: php(pcre)
97Provides: php(pdo)
98Provides: php(pdo_mysql)
99Provides: php(pdo_sqlite)
100Provides: php(phar)
101Provides: php(posix)
102Provides: php(reflection)
103Provides: php(server)
104Provides: php(session)
105Provides: php(simplexml)
106Provides: php(soap)
107Provides: php(sockets)
108Provides: php(spl)
109Provides: php(sqlite3)
110Provides: php(sysvmsg)
111Provides: php(sysvsem)
112Provides: php(sysvshm)
113Provides: php(thread)
114Provides: php(thrift_protocol)
115Provides: php(tokenizer)
116Provides: php(xhprof)
117Provides: php(xml)
118Provides: php(xmlreader)
119Provides: php(xmlwriter)
991b3017 120Provides: php(zip)
206caaaf 121Provides: php(zlib)
991b3017 122Obsoletes: hiphop-php < 2.3.2-0.2
17c75ade 123ExclusiveArch: %{x8664}
65446f6c
ER
124BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
125
126%description
aa7908cc
ER
127HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
128machine designed for executing programs written in PHP. HHVM uses a
129just-in-time compilation approach to achieve superior performance
130while maintaining the flexibility that PHP developers are accustomed
131to. To date, HHVM (and its predecessor HPHPc before it) has realized
132over a 9x increase in web request throughput and over a 5x reduction
133in memory consumption for Facebook compared with the Zend PHP 5.2
134engine + APC.
135
136HHVM can be run as a standalone webserver (i.e. without the Apache
137webserver and the "mod_php" extension). HHVM can also be used together
138with a FastCGI-based webserver, and work is in progress to make HHVM
139work smoothly with Apache.
65446f6c 140
3234b364
ER
141%package program
142Summary: /usr/bin/php symlink
143Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
144Group: Development/Languages/PHP
145Requires: %{name} = %{version}-%{release}
146Obsoletes: /usr/bin/php
147
148%description program
149Package providing /usr/bin/php symlink to PHP CLI.
150
151%description program -l pl.UTF-8
152Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
153
c6264399
ER
154%package devel
155Summary: Files for HHVM modules development
156Group: Development/Languages/PHP
157URL: https://github.com/facebook/hhvm/wiki/Extension-API
f6ea7eef 158Requires: boost-devel >= 1.50
c6264399 159Requires: cmake >= 2.8.5
f6ea7eef 160Requires: glog-devel >= 0.3.2
e7779ee6 161Requires: libstdc++-devel >= 6:4.3
f6ea7eef
ER
162Requires: tbb-devel >= 4.0.6000
163Requires: zlib-devel
c6264399
ER
164
165%description devel
166HHVM provides a set of APIs for adding built-in functionality to the
167runtime either by way of pure PHP code, or a combination of PHP and
168C++.
169
65446f6c 170%prep
991b3017
ER
171%setup -q -a1 -a2 -n %{name}-HHVM-%{version}
172
173mv folly-*/* hphp/submodules/folly
598089d9
ER
174# https://github.com/facebook/folly/pull/44
175sed -i -e '21 d' hphp/third_party/folly/folly/detail/Malloc.h
f8472382 176
457edd58
ER
177%patch6 -p1
178%patch7 -p1
c6264399 179%patch8 -p1
f8472382 180#%patch5 -p1
ed14b19f 181
c6264399 182# prefer ones from system
20e9b450
ER
183rm CMake/FindBISON.cmake
184rm CMake/FindBoost.cmake
185rm CMake/FindFLEX.cmake
c6264399 186
ed14b19f
ER
187ln -s libevent-1.4.*-stable libevent
188%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
189
190%if 0
59f13ffd 191%patch0 -p1
be373886 192%patch1 -p1
ef07ca95
ER
193#%patch3 -p1
194%patch4 -p1
195
be373886
ER
196#rm -rf src/third_party/libmbfl
197#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
198
ef07ca95
ER
199rm -rf src/third_party/xhp
200rm -rf src/third_party/libafdt
ed14b19f 201%endif
ac2930bc
ER
202
203%build
ef07ca95
ER
204# build libevent 1.4 with fb patches
205if [ ! -d libevent/.libs ]; then
206 cd libevent
207 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
208 %configure \
209 %{?0:--enable-static} \
210 %{?0:--disable-shared}
211 %{__make}
212 ln -s .libs lib
213 ln -s . include
214 cd ..
215fi
216
ac2930bc
ER
217export HPHP_HOME=$(pwd)
218export HPHP_LIB=$HPHP_HOME/bin
991b3017 219install -d $HPHP_LIB
ac2930bc 220
89ad59aa
ER
221# asm linking breaks on $CC containing spaces
222if [[ "%{__cc}" = *ccache* ]]; then
223 cat <<-'EOF' > $HPHP_LIB/gcc
224 #!/bin/sh
225 exec %{__cc} "$@"
226 EOF
227 chmod +x $HPHP_LIB/gcc
228 CC=$HPHP_LIB/gcc
229fi
230
e883c14f
ER
231%if 0
232# out of dir build broken (can't find it's tools)
ef07ca95
ER
233install -d build
234cd build
e883c14f
ER
235%endif
236
ef07ca95 237%cmake \
ed14b19f 238 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 239 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95 240 -DCMAKE_PREFIX_PATH=%{_prefix} \
a0922d01 241 -DUSE_JEMALLOC=OFF \
be373886 242 -DUSE_TCMALLOC=OFF \
e883c14f 243 ./
c513fdf6
ER
244
245# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
246# see hphp/util/generate-buildinfo.sh
991b3017 247export COMPILER_ID=HPHP-%{version}-%{release}-%{githash}
c513fdf6
ER
248export HHVM_REPO_SCHEMA=$(date +%N_%s)
249
ac2930bc
ER
250%{__make}
251
65446f6c
ER
252%install
253rm -rf $RPM_BUILD_ROOT
8d9f731f 254%{__make} install \
05199c54 255 HPHP_HOME=$(pwd) \
8d9f731f
ER
256 DESTDIR=$RPM_BUILD_ROOT
257
3234b364
ER
258ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
259ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
260
44fcba3e 261install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 262cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 263
8d9f731f
ER
264# install our libevent for now
265install -d $RPM_BUILD_ROOT%{_libdir}
266libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
267%{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
65446f6c 268
c6264399
ER
269# setup -devel
270install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
271cp -a CMake/* $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
272
273HPHP_HOME=$(pwd)
274sed -e "
275 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
276" hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
277
278oIFS=$IFS
279IFS=";"
280set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
c6264399 281IFS=$oIFS
2a7c159c
ER
282set -- $(
283 for dir in "$@"; do
284 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
285 done
286)
287
288set +x
289for dir in "$@" \
290 $HPHP_HOME/hphp/runtime \
291 $HPHP_HOME/hphp/util \
292 $HPHP_HOME/hphp/neo \
293 $HPHP_HOME/hphp/system \
294 $HPHP_HOME/hphp/parser \
295; do
296 echo "D %{_includedir}${dir#$HPHP_HOME}"
297 find $dir -name '*.h' | while read path; do
298 file=%{_includedir}${path#$HPHP_HOME}
299 echo "F $file"
300 install -Dp $path $RPM_BUILD_ROOT$file
301 done
302done
303set -x
f6ea7eef 304
65446f6c
ER
305%clean
306rm -rf $RPM_BUILD_ROOT
307
8d9f731f
ER
308%post -p /sbin/ldconfig
309%postun -p /sbin/ldconfig
310
65446f6c
ER
311%files
312%defattr(644,root,root,755)
1c0ae000 313%doc README.md hphp/NEWS
8d9f731f 314%attr(755,root,root) %{_bindir}/hhvm
3234b364 315%attr(755,root,root) %{_bindir}/hphp
8d9f731f
ER
316%attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
317%ghost %{_libdir}/libevent-1.4.so.2
44fcba3e
ER
318
319%dir %{_datadir}/%{name}
320%dir %{_datadir}/%{name}/hdf
321%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364
ER
322
323%files program
324%defattr(644,root,root,755)
325%attr(755,root,root) %{_bindir}/php
c6264399
ER
326
327%files devel
328%defattr(644,root,root,755)
329%attr(755,root,root) %{_bindir}/hphpize
330%{_includedir}/hphp
331%{_datadir}/cmake/Modules/hphpize.cmake
332%{_datadir}/cmake/Modules/FindCClient.cmake
333%{_datadir}/cmake/Modules/FindEditline.cmake
334%{_datadir}/cmake/Modules/FindGD.cmake
335%{_datadir}/cmake/Modules/FindGlog.cmake
336%{_datadir}/cmake/Modules/FindICU.cmake
337%{_datadir}/cmake/Modules/FindLdap.cmake
338%{_datadir}/cmake/Modules/FindLibAfdt.cmake
339%{_datadir}/cmake/Modules/FindLibCh.cmake
340%{_datadir}/cmake/Modules/FindLibDL.cmake
341%{_datadir}/cmake/Modules/FindLibDwarf.cmake
342%{_datadir}/cmake/Modules/FindLibElf.cmake
343%{_datadir}/cmake/Modules/FindLibEvent.cmake
344%{_datadir}/cmake/Modules/FindLibEvent.cmake.bak
345%{_datadir}/cmake/Modules/FindLibNuma.cmake
346%{_datadir}/cmake/Modules/FindLibXed.cmake
347%{_datadir}/cmake/Modules/FindLibiconv.cmake
348%{_datadir}/cmake/Modules/FindLibinotify.cmake
349%{_datadir}/cmake/Modules/FindLibmemcached.cmake
350%{_datadir}/cmake/Modules/FindLibpam.cmake
351%{_datadir}/cmake/Modules/FindMcrypt.cmake
352%{_datadir}/cmake/Modules/FindMySQL.cmake
353%{_datadir}/cmake/Modules/FindNcurses.cmake
354%{_datadir}/cmake/Modules/FindONIGURUMA.cmake
355%{_datadir}/cmake/Modules/FindPCRE.cmake
356%{_datadir}/cmake/Modules/FindPThread.cmake
357%{_datadir}/cmake/Modules/FindReadline.cmake
358%{_datadir}/cmake/Modules/FindTBB.cmake
359%{_datadir}/cmake/Modules/FollySetup.cmake
360%{_datadir}/cmake/Modules/HPHPCompiler.cmake
361%{_datadir}/cmake/Modules/HPHPFindLibs.cmake
362%{_datadir}/cmake/Modules/HPHPFunctions.cmake
363%{_datadir}/cmake/Modules/HPHPSetup.cmake
364%{_datadir}/cmake/Modules/Options.cmake
This page took 0.085749 seconds and 4 git commands to generate.