]> git.pld-linux.org Git - packages/hhvm.git/blob - hhvm.spec
up to 3.0.1
[packages/hhvm.git] / hhvm.spec
1 # NOTES:
2 # - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
3 # TODO
4 # - system libmbfl, system xhp, sqlite3
5 # git show HHVM-3.0.1
6 %define         githash c2284b1fc46454432969bfe1b1c205713f7a69e8
7 %define         folly   d9c79af
8 Summary:        Virtual Machine, Runtime, and JIT for PHP
9 Name:           hhvm
10 Version:        3.0.1
11 Release:        0.1
12 License:        PHP 3.01
13 Group:          Development/Languages
14 Source0:        https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
15 # Source0-md5:  55cbeb7fdb365972e3cb72ba59558453
16 # need fb.changes.patch, which is available for 1.4 only
17 Source2:        https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
18 # Source2-md5:  e14ff4b87c986dbe095547bdf0761dd1
19 Source3:        %{name}-fcgi.init
20 Source4:        %{name}-fcgi.sysconfig
21 Source100:      get-source.sh
22 Patch0:         cmake-missing-library.patch
23 Patch3:         system-xhp.patch
24 Patch4:         system-libafdt.patch
25 Patch5:         system-folly.patch
26 Patch8:         hphpize.patch
27 Patch9:         notest.patch
28 Patch10:        no-debug.patch
29 URL:            https://github.com/facebook/hhvm/wiki
30 BuildRequires:  a52dec-libs-devel
31 BuildRequires:  apr-devel
32 BuildRequires:  autoconf
33 BuildRequires:  binutils-devel
34 BuildRequires:  boost-devel >= 1.50
35 BuildRequires:  cmake >= 2.8.7
36 BuildRequires:  curl-devel >= 7.29.0
37 BuildRequires:  elfutils-devel
38 BuildRequires:  expat-devel
39 BuildRequires:  gcc >= 6:4.6.0
40 BuildRequires:  gd-devel
41 BuildRequires:  glog-devel >= 0.3.2
42 BuildRequires:  imap-devel >= 1:2007
43 #BuildRequires: jemalloc-devel >= 3.0.0
44 BuildRequires:  libcap-devel
45 BuildRequires:  libdwarf-devel >= 20130729
46 BuildRequires:  libicu-devel >= 4.2
47 #BuildRequires: libmbfl-devel
48 BuildRequires:  libmcrypt-devel
49 BuildRequires:  libmemcached-devel >= 1.0.4
50 BuildRequires:  libstdc++-devel >= 6:4.3
51 BuildRequires:  libunwind-devel
52 BuildRequires:  libxml2-devel
53 BuildRequires:  ImageMagick-devel
54 BuildRequires:  libxslt-devel
55 BuildRequires:  mysql-devel
56 BuildRequires:  ocaml-findlib
57 BuildRequires:  oniguruma-devel
58 BuildRequires:  openssl-devel
59 BuildRequires:  pcre-devel
60 #BuildRequires: php-xhp-devel >= 1.3.9-6
61 BuildRequires:  readline-devel
62 BuildRequires:  rpmbuild(macros) >= 1.675
63 BuildRequires:  tbb-devel >= 4.0.6000
64 BuildRequires:  zlib-devel
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
70 # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
71 Provides:       php(apache)
72 Provides:       php(apc)
73 Provides:       php(bcmath)
74 Provides:       php(bz2)
75 Provides:       php(ctype)
76 Provides:       php(curl)
77 Provides:       php(date)
78 Provides:       php(debugger)
79 Provides:       php(dom)
80 Provides:       php(exif)
81 Provides:       php(fb)
82 Provides:       php(fileinfo)
83 Provides:       php(filter)
84 Provides:       php(function)
85 Provides:       php(gd)
86 Provides:       php(hash)
87 Provides:       php(hh)
88 Provides:       php(hhvm.debugger)
89 Provides:       php(hhvm.ini)
90 Provides:       php(hotprofiler)
91 Provides:       php(iconv)
92 Provides:       php(idn)
93 Provides:       php(imagick)
94 Provides:       php(imap)
95 Provides:       php(intl)
96 Provides:       php(json)
97 Provides:       php(ldap)
98 Provides:       php(libxml)
99 Provides:       php(mbstring)
100 Provides:       php(mcrypt)
101 Provides:       php(memcache)
102 Provides:       php(memcached)
103 Provides:       php(misc)
104 Provides:       php(mysql)
105 Provides:       php(mysqli)
106 Provides:       php(openssl)
107 Provides:       php(pcntl)
108 Provides:       php(pcre)
109 Provides:       php(pdo)
110 Provides:       php(pdo_mysql)
111 Provides:       php(pdo_sqlite)
112 Provides:       php(phar)
113 Provides:       php(posix)
114 Provides:       php(redis)
115 Provides:       php(reflection)
116 Provides:       php(server)
117 Provides:       php(session)
118 Provides:       php(simplexml)
119 Provides:       php(soap)
120 Provides:       php(sockets)
121 Provides:       php(spl)
122 Provides:       php(sqlite3)
123 Provides:       php(stream)
124 Provides:       php(sysvmsg)
125 Provides:       php(sysvsem)
126 Provides:       php(sysvshm)
127 Provides:       php(thread)
128 Provides:       php(thrift_protocol)
129 Provides:       php(tokenizer)
130 Provides:       php(url)
131 Provides:       php(xhprof)
132 Provides:       php(xml)
133 Provides:       php(xmlreader)
134 Provides:       php(xmlwriter)
135 Provides:       php(xsl)
136 Provides:       php(zip)
137 Provides:       php(zlib)
138 Obsoletes:      hiphop-php < 2.3.2-0.2
139 ExclusiveArch:  %{x8664}
140 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
141
142 %description
143 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
144 machine designed for executing programs written in PHP. HHVM uses a
145 just-in-time compilation approach to achieve superior performance
146 while maintaining the flexibility that PHP developers are accustomed
147 to. To date, HHVM (and its predecessor HPHPc before it) has realized
148 over a 9x increase in web request throughput and over a 5x reduction
149 in memory consumption for Facebook compared with the Zend PHP 5.2
150 engine + APC.
151
152 HHVM can be run as a standalone webserver (i.e. without the Apache
153 webserver and the "mod_php" extension). HHVM can also be used together
154 with a FastCGI-based webserver, and work is in progress to make HHVM
155 work smoothly with Apache.
156
157 %package fcgi
158 Summary:        Init script to start HHVM as FastCGI daemon
159 Group:          Development/Languages/PHP
160 Requires:       %{name} = %{version}-%{release}
161 Provides:       php(fcgi)
162 Requires(post,preun):   /sbin/chkconfig
163 Requires:       rc-scripts
164
165 %description fcgi
166 Init script to start HHVM as FastCGI daemon
167
168 %package program
169 Summary:        /usr/bin/php symlink
170 Summary(pl.UTF-8):      Dowiązanie symboliczne /usr/bin/php
171 Group:          Development/Languages/PHP
172 Requires:       %{name} = %{version}-%{release}
173 Obsoletes:      /usr/bin/php
174
175 %description program
176 Package providing /usr/bin/php symlink to PHP CLI.
177
178 %description program -l pl.UTF-8
179 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
180
181 %package devel
182 Summary:        Files for HHVM modules development
183 Group:          Development/Languages/PHP
184 URL:            https://github.com/facebook/hhvm/wiki/Extension-API
185 Requires:       boost-devel >= 1.50
186 Requires:       cmake >= 2.8.5
187 Requires:       glog-devel >= 0.3.2
188 Requires:       libstdc++-devel >= 6:4.3
189 Requires:       tbb-devel >= 4.0.6000
190 Requires:       zlib-devel
191
192 %description devel
193 HHVM provides a set of APIs for adding built-in functionality to the
194 runtime either by way of pure PHP code, or a combination of PHP and
195 C++.
196
197 %prep
198 %setup -q -a2 -n %{name}-HHVM-%{version}
199
200 mv folly-*/* hphp/submodules/folly
201
202 %patch8 -p1
203 %patch9 -p1
204 %patch10 -p1
205 #%patch5 -p1
206
207 # prefer ones from system
208 rm CMake/FindBISON.cmake
209 rm CMake/FindFLEX.cmake
210 rm CMake/FindFreetype.cmake
211
212 %if 0
213 %patch0 -p1
214 %patch1 -p1
215 #%patch3 -p1
216 %patch4 -p1
217
218 #rm -rf src/third_party/libmbfl
219 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
220
221 rm -rf src/third_party/xhp
222 rm -rf src/third_party/libafdt
223 %endif
224
225 %build
226 export HPHP_HOME=$(pwd)
227 export HPHP_LIB=$HPHP_HOME/bin
228 install -d $HPHP_LIB
229
230 # asm linking breaks on $CC containing spaces
231 if [[ "%{__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
238 fi
239
240 %if 0
241 # out of dir build broken (can't find it's tools)
242 install -d build
243 cd build
244 %endif
245
246 %cmake \
247         -DCMAKE_PREFIX_PATH=%{_prefix} \
248         -DUSE_JEMALLOC=OFF \
249         -DUSE_TCMALLOC=OFF \
250         -DHPHP_NOTEST=ON \
251         ./
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
255 export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
256 export HHVM_REPO_SCHEMA=$(date +%N_%s)
257
258 %{__make}
259
260 %install
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
263 %{__make} install \
264         HPHP_HOME=$(pwd) \
265         DESTDIR=$RPM_BUILD_ROOT
266
267 # not packaged here
268 rm $RPM_BUILD_ROOT%{_includedir}/zip.h
269 rm $RPM_BUILD_ROOT%{_includedir}/zipconf.h
270 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.a
271 rm $RPM_BUILD_ROOT%{_prefix}/lib/libzip.so
272
273 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
274 ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
275
276 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
277 cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
278
279 # install fastcgi initscript
280 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
281 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
282 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
283
284 # setup -devel
285 install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
286 cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
287
288 HPHP_HOME=$(pwd)
289 sed -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
293 oIFS=$IFS
294 IFS=";"
295 set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
296 IFS=$oIFS
297 set -- $(
298         for dir in "$@"; do
299                 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
300         done
301 )
302
303 set +x
304 for 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
317 done
318 set -x
319
320 %clean
321 rm -rf $RPM_BUILD_ROOT
322
323 %post   -p /sbin/ldconfig
324 %postun -p /sbin/ldconfig
325
326 %post fcgi
327 /sbin/chkconfig --add %{name}-fcgi
328 %service %{name}-fcgi restart
329
330 %preun fcgi
331 if [ "$1" = "0" ]; then
332         %service -q %{name}-fcgi stop
333         /sbin/chkconfig --del %{name}-fcgi
334 fi
335
336 %files
337 %defattr(644,root,root,755)
338 %doc README.md hphp/NEWS
339 %dir %{_sysconfdir}/%{name}
340 %attr(755,root,root) %{_bindir}/hhvm
341 %attr(755,root,root) %{_bindir}/hphp
342
343 %dir %{_datadir}/%{name}
344 %dir %{_datadir}/%{name}/hdf
345 %{_datadir}/%{name}/hdf/static.mime-types.hdf
346
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
352 %files program
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/php
355
356 %files devel
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_bindir}/hphpize
359 %{_includedir}/hphp
360 %{_datadir}/cmake/Modules/ExtZendCompat.cmake
361 %{_datadir}/cmake/Modules/FindCClient.cmake
362 %{_datadir}/cmake/Modules/FindEditline.cmake
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
371 %{_datadir}/cmake/Modules/FindLibJpeg.cmake
372 %{_datadir}/cmake/Modules/FindLibMagickWand.cmake
373 %{_datadir}/cmake/Modules/FindLibNuma.cmake
374 %{_datadir}/cmake/Modules/FindLibPng.cmake
375 %{_datadir}/cmake/Modules/FindLibUODBC.cmake
376 %{_datadir}/cmake/Modules/FindLibXed.cmake
377 %{_datadir}/cmake/Modules/FindLibYaml.cmake
378 %{_datadir}/cmake/Modules/FindLibiconv.cmake
379 %{_datadir}/cmake/Modules/FindLibinotify.cmake
380 %{_datadir}/cmake/Modules/FindLibmemcached.cmake
381 %{_datadir}/cmake/Modules/FindLibpam.cmake
382 %{_datadir}/cmake/Modules/FindMcrypt.cmake
383 %{_datadir}/cmake/Modules/FindMySQL.cmake
384 %{_datadir}/cmake/Modules/FindNcurses.cmake
385 %{_datadir}/cmake/Modules/FindOCaml.cmake
386 %{_datadir}/cmake/Modules/FindONIGURUMA.cmake
387 %{_datadir}/cmake/Modules/FindPCRE.cmake
388 %{_datadir}/cmake/Modules/FindPThread.cmake
389 %{_datadir}/cmake/Modules/FindReadline.cmake
390 %{_datadir}/cmake/Modules/FindTBB.cmake
391 %{_datadir}/cmake/Modules/FollySetup.cmake
392 %{_datadir}/cmake/Modules/HPHPCompiler.cmake
393 %{_datadir}/cmake/Modules/HPHPFindLibs.cmake
394 %{_datadir}/cmake/Modules/HPHPFunctions.cmake
395 %{_datadir}/cmake/Modules/HPHPSetup.cmake
396 %{_datadir}/cmake/Modules/Options.cmake
397 %{_datadir}/cmake/Modules/hphpize.cmake
This page took 0.05691 seconds and 4 git commands to generate.