]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
add -program subpackage, providing zend compat functionality (php binary)
[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
991b3017 10Release: 0.2
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
991b3017
ER
18Source2: https://github.com/facebook/folly/archive/4d6d659/folly-%{version}-4d6d659.tar.gz
19Source100: get-source.sh
59f13ffd 20Patch0: cmake-missing-library.patch
be373886 21Patch1: libevent14.patch
ef07ca95
ER
22Patch3: system-xhp.patch
23Patch4: system-libafdt.patch
6147aa3c 24Patch5: system-folly.patch
457edd58
ER
25Patch6: checksum.patch
26Patch7: imap-gss.patch
3f49543c
ER
27URL: http://wiki.github.com/facebook/hiphop-php/
28BuildRequires: binutils-devel
59f13ffd 29BuildRequires: bison >= 2.3
ed14b19f 30BuildRequires: boost-devel >= 1.50
991b3017 31BuildRequires: cmake >= 2.8.7
ed14b19f
ER
32BuildRequires: curl-devel >= 7.29.0
33BuildRequires: elfutils-devel
3f49543c 34BuildRequires: expat-devel
59f13ffd 35BuildRequires: flex >= 2.5.35
5c61d46f 36BuildRequires: gcc >= 6:4.6.0
3f49543c 37BuildRequires: gd-devel
ed14b19f
ER
38BuildRequires: glog-devel >= 0.3.2
39BuildRequires: imap-devel >= 1:2007
991b3017 40#BuildRequires: jemalloc-devel >= 3.0.0
ef07ca95 41BuildRequires: libafdt-devel >= 0.1.0
3f49543c 42BuildRequires: libcap-devel
ed14b19f
ER
43BuildRequires: libdwarf-devel
44#BuildRequires: libevent-devel >= 1.4.14
ac2930bc 45BuildRequires: libicu-devel >= 4.2
be373886 46#BuildRequires: libmbfl-devel
ed14b19f 47BuildRequires: libmcrypt-devel
e883c14f 48BuildRequires: libmemcached-devel >= 1.0.4
ef07ca95 49BuildRequires: libstdc++-devel >= 6:4.3
ed14b19f 50BuildRequires: libunwind-devel
ac2930bc 51BuildRequires: libxml2-devel
3f49543c 52BuildRequires: mysql-devel
ac2930bc 53BuildRequires: oniguruma-devel
3f49543c
ER
54BuildRequires: openssl-devel
55BuildRequires: pcre-devel
ed14b19f 56#BuildRequires: php-xhp-devel >= 1.3.9-6
3f49543c 57BuildRequires: re2c >= 0.13.0
ed14b19f 58BuildRequires: readline-devel
89ad59aa 59BuildRequires: rpmbuild(macros) >= 1.675
ed14b19f 60BuildRequires: tbb-devel >= 4.0.6000
3f49543c 61BuildRequires: zlib-devel
206caaaf
ER
62Provides: php(apc)
63Provides: php(bcmath)
991b3017 64Provides: php(bz2)
206caaaf
ER
65Provides: php(ctype)
66Provides: php(curl)
67Provides: php(date)
68Provides: php(dom)
69Provides: php(exif)
70Provides: php(fb)
991b3017 71Provides: php(fileinfo)
206caaaf
ER
72Provides: php(filter)
73Provides: php(gd)
74Provides: php(hash)
75Provides: php(hotprofiler)
76Provides: php(iconv)
991b3017 77Provides: php(icu_num_fmt)
206caaaf
ER
78Provides: php(icu_ucsdet)
79Provides: php(icu_uspoof)
80Provides: php(idn)
81Provides: php(imap)
82Provides: php(json)
83Provides: php(ldap)
84Provides: php(mbstring)
85Provides: php(mcrypt)
86Provides: php(memcache)
87Provides: php(memcached)
88Provides: php(mysql)
89Provides: php(openssl)
90Provides: php(pcntl)
91Provides: php(pcre)
92Provides: php(pdo)
93Provides: php(pdo_mysql)
94Provides: php(pdo_sqlite)
95Provides: php(phar)
96Provides: php(posix)
97Provides: php(reflection)
98Provides: php(server)
99Provides: php(session)
100Provides: php(simplexml)
101Provides: php(soap)
102Provides: php(sockets)
103Provides: php(spl)
104Provides: php(sqlite3)
105Provides: php(sysvmsg)
106Provides: php(sysvsem)
107Provides: php(sysvshm)
108Provides: php(thread)
109Provides: php(thrift_protocol)
110Provides: php(tokenizer)
111Provides: php(xhprof)
112Provides: php(xml)
113Provides: php(xmlreader)
114Provides: php(xmlwriter)
991b3017 115Provides: php(zip)
206caaaf 116Provides: php(zlib)
991b3017 117Obsoletes: hiphop-php < 2.3.2-0.2
17c75ade 118ExclusiveArch: %{x8664}
65446f6c
ER
119BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
120
121%description
aa7908cc
ER
122HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
123machine designed for executing programs written in PHP. HHVM uses a
124just-in-time compilation approach to achieve superior performance
125while maintaining the flexibility that PHP developers are accustomed
126to. To date, HHVM (and its predecessor HPHPc before it) has realized
127over a 9x increase in web request throughput and over a 5x reduction
128in memory consumption for Facebook compared with the Zend PHP 5.2
129engine + APC.
130
131HHVM can be run as a standalone webserver (i.e. without the Apache
132webserver and the "mod_php" extension). HHVM can also be used together
133with a FastCGI-based webserver, and work is in progress to make HHVM
134work smoothly with Apache.
65446f6c 135
3234b364
ER
136%package program
137Summary: /usr/bin/php symlink
138Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
139Group: Development/Languages/PHP
140Requires: %{name} = %{version}-%{release}
141Obsoletes: /usr/bin/php
142
143%description program
144Package providing /usr/bin/php symlink to PHP CLI.
145
146%description program -l pl.UTF-8
147Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
148
65446f6c 149%prep
991b3017
ER
150%setup -q -a1 -a2 -n %{name}-HHVM-%{version}
151
152mv folly-*/* hphp/submodules/folly
f8472382 153
457edd58
ER
154%patch6 -p1
155%patch7 -p1
156
f8472382 157#%patch5 -p1
ed14b19f
ER
158
159ln -s libevent-1.4.*-stable libevent
160%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
161
162%if 0
59f13ffd 163%patch0 -p1
be373886 164%patch1 -p1
ef07ca95
ER
165#%patch3 -p1
166%patch4 -p1
167
59f13ffd 168
be373886
ER
169#rm -rf src/third_party/libmbfl
170#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
171
ef07ca95
ER
172rm -rf src/third_party/xhp
173rm -rf src/third_party/libafdt
ed14b19f 174%endif
ac2930bc
ER
175
176%build
ef07ca95
ER
177# build libevent 1.4 with fb patches
178if [ ! -d libevent/.libs ]; then
179 cd libevent
180 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
181 %configure \
182 %{?0:--enable-static} \
183 %{?0:--disable-shared}
184 %{__make}
185 ln -s .libs lib
186 ln -s . include
187 cd ..
188fi
189
ac2930bc
ER
190export HPHP_HOME=$(pwd)
191export HPHP_LIB=$HPHP_HOME/bin
991b3017 192install -d $HPHP_LIB
ac2930bc 193
89ad59aa
ER
194# asm linking breaks on $CC containing spaces
195if [[ "%{__cc}" = *ccache* ]]; then
196 cat <<-'EOF' > $HPHP_LIB/gcc
197 #!/bin/sh
198 exec %{__cc} "$@"
199 EOF
200 chmod +x $HPHP_LIB/gcc
201 CC=$HPHP_LIB/gcc
202fi
203
ed14b19f
ER
204%if 0
205export LIBEVENT_PREFIX=$HPHP_HOME/libevent
206
207 -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
208 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
209 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
210%endif
211
e883c14f
ER
212%if 0
213# out of dir build broken (can't find it's tools)
ef07ca95
ER
214install -d build
215cd build
e883c14f
ER
216%endif
217
ef07ca95 218%cmake \
ed14b19f 219 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 220 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95
ER
221 -DCMAKE_PREFIX_PATH=%{_prefix} \
222 -DSKIP_BUNDLED_XHP=ON \
a0922d01 223 -DUSE_JEMALLOC=OFF \
be373886 224 -DUSE_TCMALLOC=OFF \
e883c14f 225 ./
c513fdf6
ER
226
227# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
228# see hphp/util/generate-buildinfo.sh
991b3017 229export COMPILER_ID=HPHP-%{version}-%{release}-%{githash}
c513fdf6
ER
230export HHVM_REPO_SCHEMA=$(date +%N_%s)
231
ac2930bc
ER
232%{__make}
233
65446f6c
ER
234%install
235rm -rf $RPM_BUILD_ROOT
8d9f731f 236%{__make} install \
05199c54 237 HPHP_HOME=$(pwd) \
8d9f731f
ER
238 DESTDIR=$RPM_BUILD_ROOT
239
3234b364
ER
240ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
241ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
242
44fcba3e 243install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 244cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 245
8d9f731f
ER
246# install our libevent for now
247install -d $RPM_BUILD_ROOT%{_libdir}
248libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
249%{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
65446f6c
ER
250
251%clean
252rm -rf $RPM_BUILD_ROOT
253
8d9f731f
ER
254%post -p /sbin/ldconfig
255%postun -p /sbin/ldconfig
256
65446f6c
ER
257%files
258%defattr(644,root,root,755)
1c0ae000 259%doc README.md hphp/NEWS
8d9f731f 260%attr(755,root,root) %{_bindir}/hhvm
3234b364 261%attr(755,root,root) %{_bindir}/hphp
8d9f731f
ER
262%attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
263%ghost %{_libdir}/libevent-1.4.so.2
44fcba3e
ER
264
265%dir %{_datadir}/%{name}
266%dir %{_datadir}/%{name}/hdf
267%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364
ER
268
269%files program
270%defattr(644,root,root,755)
271%attr(755,root,root) %{_bindir}/php
This page took 0.077518 seconds and 4 git commands to generate.