]> git.pld-linux.org Git - packages/hhvm.git/commitdiff
add HHVM_API_VERSION check
authorElan Ruusamäe <glen@delfi.ee>
Sun, 10 Aug 2014 19:52:50 +0000 (22:52 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 10 Aug 2014 19:55:12 +0000 (22:55 +0300)
hhvm.spec

index 9bea69e843302143368d0b1b0171035ebfccb9b0..d3a3c741aa777a60555dd714602da22eb3ff09b7 100644 (file)
--- a/hhvm.spec
+++ b/hhvm.spec
@@ -67,6 +67,7 @@ BuildRequires:        zlib-devel
 #BuildRequires:        flex >= 2.5.35
 #BuildRequires:        libafdt-devel >= 0.1.0
 #BuildRequires:        re2c >= 0.13.0
+Provides:      %{name}(api) = %{hhvm_api_version}
 # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
 Provides:      php(apache)
 Provides:      php(apc)
@@ -148,6 +149,9 @@ Obsoletes:  hiphop-php < 2.3.2-0.2
 ExclusiveArch: %{x8664}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# must be in sync with source. extra check ensuring that it is so is done in %%build
+%define                hhvm_api_version                20140702
+
 %description
 HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
 machine designed for executing programs written in PHP. HHVM uses a
@@ -234,6 +238,14 @@ rm -rf src/third_party/libafdt
 %endif
 
 %build
+# also in: hphp/tools/hphpize/hphpize.cmake
+API=$(awk '/#define HHVM_API_VERSION/{v=$3; sub(/L$/, "", v); print v}' hphp/runtime/ext/extension.h)
+
+if [ $API != %{hhvm_api_version} ]; then
+       echo "Set %%define hhvm_api_version to $API and re-run."
+       exit 1
+fi
+
 export HPHP_HOME=$(pwd)
 export HPHP_LIB=$HPHP_HOME/bin
 install -d $HPHP_LIB
This page took 0.10224 seconds and 4 git commands to generate.