From 223bca630ec11185f2b22efc3fc538d1dda45deb Mon Sep 17 00:00:00 2001
From: Mathieu Parent <math.parent@gmail.com>
Date: Thu, 16 May 2013 15:27:32 +0200
Subject: [PATCH 2/7] phppear: Check for channel.xml

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

diff --git a/checks/phppear b/checks/phppear
index 5dd4903..392cd55 100644
--- a/checks/phppear
+++ b/checks/phppear
@@ -39,6 +39,14 @@ sub run {
       tag 'pear-package-without-pkg-php-tools-builddep';
     }
   }
+  # PEAR channel
+  my $channel_xml = $info->index('channel.xml');
+  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

