summaryrefslogtreecommitdiffstats
path: root/php-bartlett-php-compatinfo-db.spec
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-12-10 18:54:53 +0100
committerRemi Collet <fedora@famillecollet.com>2015-12-10 18:54:53 +0100
commit8bce1aacf66e3db12799c29084f9c920e265ce46 (patch)
treefd06447c7b151ae6323e051204ca04d5e0c92d2f /php-bartlett-php-compatinfo-db.spec
parentdd8d81e41d41f66ce0d437f4bcb1d2c02963f7f5 (diff)
php-bartlett-php-compatinfo-db: awfull tweak for PHP RC version
Diffstat (limited to 'php-bartlett-php-compatinfo-db.spec')
-rw-r--r--php-bartlett-php-compatinfo-db.spec42
1 files changed, 41 insertions, 1 deletions
diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec
index 0aa23b9..4a7918e 100644
--- a/php-bartlett-php-compatinfo-db.spec
+++ b/php-bartlett-php-compatinfo-db.spec
@@ -24,7 +24,7 @@
Name: php-%{c_vendor}-%{c_project}
Version: 1.2.0
-%global specrel 1
+%global specrel 2
Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
Summary: Reference Database to be used with php-compatinfo library
@@ -109,6 +109,42 @@ find src -name \*rpm -delete -print
%build
+: Ensure current version is known by reference
+OPT=$(php -r '
+ require "src/%{ns_vendor}/%{ns_project}/autoload.php";
+
+ switch (PHP_MAJOR_VERSION . PHP_MINOR_VERSION) {
+ case "54":
+ $max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_4;
+ break;
+ case "55":
+ $max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_5;
+ break;
+ case "56":
+ $max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_5_6;
+ break;
+ case "70":
+ $max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_0;
+ break;
+ default:
+ exit(0);
+ }
+ if (version_compare(PHP_VERSION, $max, ">")) {
+ fputs(STDERR, "Current: " . PHP_VERSION . " > Known: $max\n\n");
+ echo "/LATEST_PHP_" . PHP_MAJOR_VERSION . "_" . PHP_MINOR_VERSION .
+ "/s/" . PHP_MAJOR_VERSION . "\." .PHP_MINOR_VERSION . "\.[0-9]*/" . PHP_VERSION . "/";
+ } else {
+ fputs(STDERR, "Current: " . PHP_VERSION . " = Known: $max\n\n");
+ }
+')
+if [ -n "$OPT" ]; then
+ sed -e "$OPT" -i src/Bartlett/CompatInfoDb/ExtensionFactory.php
+fi
+grep " LATEST" src/Bartlett/CompatInfoDb/ExtensionFactory.php
+
+: Fix references database
+%{_bindir}/php -d date.timezone=Europe/Paris data/handleDB.php db:release:php
+
: Generate the references database
%{_bindir}/php -d date.timezone=Europe/Paris data/handleDB.php db:init
@@ -141,6 +177,10 @@ export BARTLETT_COMPATINFO_DB=%{buildroot}%{_datadir}/%{name}/compatinfo.sqlite
%changelog
+* Thu Dec 10 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-2
+- fix reference to ensure current version is known
+ as we usually build RC version in rawhide.
+
* Sat Dec 5 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-1
- update to 1.2.0
- add dependency on composer/semver