From c171e0ff090e6f1c46c722aba7d3d364973983a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 10 Aug 2014 22:52:50 +0300 Subject: [PATCH] add HHVM_API_VERSION check --- hhvm.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hhvm.spec b/hhvm.spec index 9bea69e..d3a3c74 100644 --- 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 -- 2.44.0