From d7297a62d57c0cb357ac3e58845129b803e96d46 Mon Sep 17 00:00:00 2001
From: Mathieu Parent <mathieu.parent@nantesmetropole.fr>
Date: Thu, 16 May 2013 15:27:32 +0200
Subject: [PATCH 2/6] phppear: Check for channel.xml

---
 checks/phppear      |    7 +++++++
 checks/phppear.desc |    9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/checks/phppear b/checks/phppear
index 88c3edb..58738ab 100644
--- a/checks/phppear
+++ b/checks/phppear
@@ -32,6 +32,7 @@ sub run {
 
   my $package_xml = $info->index('package.xml');
   my $package2_xml = $info->index('package2.xml');
+  my $channel_xml = $info->index('channel.xml');
   if (defined($package_xml) || defined($package2_xml)) {
     # Checking source builddep
     my $bdepends = $info->relation('build-depends');
@@ -39,6 +40,12 @@ sub run {
       tag 'pear-package-without-pkg-php-tools-builddep';
     }
   }
+  if (defined($channel_xml)) {
+    my $bdepends = $info->binary_relation('build-depends');
+    if (!$bdepends->implies('pkg-php-tools')) {
+      tag 'pear-channel-without-pkg-php-tools-builddep';
+    }
+  }
 }
 
 1;
diff --git a/checks/phppear.desc b/checks/phppear.desc
index db27cac..f99552f 100644
--- a/checks/phppear.desc
+++ b/checks/phppear.desc
@@ -15,3 +15,12 @@ Info: The package contains an package.xml or package2.xml file but doesn't
  pkg-php-tools is the recommended tool for building PEAR and PECL packages. For
  more information, install it and read the included README.Debian.
 
+Tag: pear-channel-without-pkg-php-tools-builddep
+Severity: normal
+Certainty: possible
+Info: The package contains an channel.xml file but doesn't build-depend on
+ pkg-php-tools.
+ .
+ pkg-php-tools is the recommended tool for building PEAR and PECL packages. For
+ more information, install it and read the included README.Debian.
+
-- 
1.7.10.4

