PECL_VERSION ?= $(shell echo $(PECL) | cut -d: -f3 -s)
PECL_INI = $(with_config_file_scan_dir)/pecl.ini
-PHP_VERSION ?= $(shell test -e $(srcdir)/php-versions.json && cat $(srcdir)/php-versions.json | /usr/bin/php $(srcdir)/php-version.php $(PHP))
+PHP_VERSION ?= $(shell test -e $(srcdir)/php-versions.json && cat $(srcdir)/php-versions.json | $(srcdir)/php-version.php $(PHP))
.PHONY: all php check clean reconf pecl ext test
.SUFFIXES:
php: check $(bindir)/php
$(srcdir)/php-versions.json: $(srcdir)/php-version.php
- curl -Sso $@ http://php.net/releases/active.php
+ curl -Sso $@ "http://php.net/releases/index.php?json&version=5&max=-1"
$(srcdir)/php-$(PHP_VERSION)/configure: | $(srcdir)/php-versions.json
curl -Ss $(PHP_MIRROR)/php-$(PHP_VERSION).tar.bz2 | tar xj -C $(srcdir)
grep -q extension=$(PECL_SONAME).so $(PECL_INI) || echo extension=$(PECL_SONAME).so >> $(PECL_INI)
ext: pecl-check $(srcdir)/pecl-$(PECL_EXTENSION) pecl
+ $(srcdir)/check-packagexml.php package.xml
test: php
REPORT_EXIT_STATUS=1 NO_INTERACTION=1 $(bindir)/php run-tests.php -p $(bindir)/php --show-diff tests
--- /dev/null
+#!/usr/bin/env php
+<?php
+
+error_reporting(E_ALL & ~(E_DEPRECATED|E_STRICT));
+
+if ($argc < 2) {
+ fprintf(STDERR, "Usage: %s <path/to/package.xml>\n", $argv[0]);
+ exit(1);
+}
+
+require_once "PEAR/Config.php";
+require_once "PEAR/PackageFile.php";
+
+define("PACKAGE_XML", $argv[1]);
+define("PACKAGE_DIR", dirname(PACKAGE_XML));
+
+$factory = new PEAR_PackageFile(PEAR_Config::singleton());
+$pf = $factory->fromPackageFile($argv[1], PEAR_VALIDATE_NORMAL);
+
+if (PEAR::isError($pf)) {
+ fprintf(STDERR, "ERROR: %s\n", $pf->getMessage());
+ exit(1);
+}
+
+foreach ($pf->getValidationWarnings() as $warning) {
+ fprintf(STDERR, "%s: %s\n", strtoupper($warning["level"]), $warning["message"]);
+}
+
+$exit = 0;
+foreach ($pf->getFilelist() as $file => $attr) {
+ if (!file_exists(PACKAGE_DIR."/".$file)) {
+ $exit++;
+ fprintf(STDERR, "File '%s' with role '%s' not found in '%s'\n",
+ $file, $attr["role"], PACKAGE_DIR);
+ }
+}
+
+if ($exit) {
+ fprintf(STDERR, "%3d failure(s)\n", $exit);
+ exit(1);
+}