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