]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- allow setting minimum php version
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 7 Dec 2009 19:24:20 +0000 (19:24 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-php-requires.php -> 1.13

rpm-php-requires.php

index 716490f57521532f2f20c097cbfaada05d7c1e3b..0a0050330a3807de3f1133cc4554697e2236d3fc 100644 (file)
@@ -116,12 +116,16 @@ function extdeps($files) {
        $info = new PHP_CompatInfo('null');
        $res = $info->parseData($files);
 
-       if (version_compare($res['version'], '5.0.0', 'ge')) {
+       // minimum php version we accept
+       // "%define php_min_version 5.1.2" in spec to minimum version to be 5.1.2
+       $version = max(PHP_MIN_VERSION, $res['version']);
+
+       if (version_compare($version, '5.0.0', 'ge')) {
                $epoch = 4;
        } else {
                $epoch = 3;
        }
-       echo "php-common >= ", $epoch, ":", $res['version'], "\n";
+       echo "php-common >= ", $epoch, ":", $version, "\n";
 
        // process extensions
        foreach ($res['extensions'] as $ext) {
@@ -129,12 +133,14 @@ function extdeps($files) {
                if ($ext == 'bz2') {
                        $ext = 'bzip2';
                }
+
                echo "php(", $ext, ")\n";
        }
 }
 
 define('RPM_BUILD_ROOT', getenv('RPM_BUILD_ROOT'));
 define('PHP_PEAR_DIR', '/usr/share/pear');
+define('PHP_MIN_VERSION', getenv('PHP_MIN_VERSION'));
 
 if ($argc > 1) {
        $files = array_splice($argv, 1);
This page took 0.039926 seconds and 4 git commands to generate.