[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.14-78-g8fd63ce



The following commit has been merged in the master branch:
commit 9bca40bcea94080d178284545df1323b28bd1ca0
Author: Mathieu Parent <math.parent@gmail.com>
Date:   Fri Jul 12 14:36:54 2013 +0200

    Check for debian/rules for PHP packages
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/phppear.desc b/checks/phppear.desc
index c063bcd..975e206 100644
--- a/checks/phppear.desc
+++ b/checks/phppear.desc
@@ -55,3 +55,23 @@ Info: The package contains an composer.json file but doesn't build-depend on
  .
  pkg-php-tools is the recommended tool for building PHP Composer packages. For
  more information, install it and read the included README.Composer.
+
+Tag: missing-pkg-php-tools-buildsystem
+Severity: normal
+Certainty: possible
+Info: The package uses pkg-php-tools but dh command is called without
+ --buildsystem=phppear
+ .
+ pkg-php-tools build system is the recommended tool for building PHP PEAR
+ packages. For more information, install it and read the included README.PEAR.
+
+Tag: missing-pkg-php-tools-addon
+Severity: normal
+Certainty: possible
+Info: The package uses pkg-php-tools but dh command is called without
+ --with phppear or --with phpcomposer. A PECL package should also have
+ --with php5.
+ .
+ pkg-php-tools db addons are the recommended tool for building PHP PEAR or
+ Composer packages. For more information, install it and read the included
+ README.PEAR or README.Composer.
diff --git a/checks/phppear.pm b/checks/phppear.pm
index c1807bc..2623082 100644
--- a/checks/phppear.pm
+++ b/checks/phppear.pm
@@ -32,6 +32,8 @@ sub run {
     my ($pkg, $type, $info) = @_;
 
     my $bdepends = $info->relation('build-depends');
+    my $package_type = 'unknown';
+
     # PEAR or PECL package
     my $package_xml = $info->index('package.xml');
     my $package2_xml = $info->index('package2.xml');
@@ -80,9 +82,8 @@ sub run {
             }
             if (defined($package_xml) && $package_xml->is_regular_file) {
                 # Wild guess package type as in PEAR_PackageFile_v2::getPackageType()
-                my $package_type = 'unknown';
-               open(my $package_xml_fd, '<', $info->unpacked($package_xml));
-               while (<$package_xml_fd>) {
+                open(my $package_xml_fd, '<', $info->unpacked($package_xml));
+                while (<$package_xml_fd>) {
                     if (/^\s*<(php|extsrc|extbin|zendextsrc|zendextbin)release\s*\/?>/ ){
                         $package_type = $1;
                         last;
@@ -128,6 +129,52 @@ sub run {
                 '(>= 1.7~)', 'for Composer package support';
         }
     }
+    # Check rules
+    if (defined($package_xml) || defined($package2_xml) || defined($channel_xml) || defined($composer_json)) {
+        my $rules = $info->debfiles('rules');
+        if (!-l $rules or (-f $rules and is_ancestor_of($info->debfiles, $rules))) {
+            my $has_buildsystem_phppear = 0;
+            my $has_addon_phppear = 0;
+            my $has_addon_phpcomposer= 0;
+            my $has_addon_php5= 0;
+            open(my $rules_fd, '<', $rules);
+            while (<$rules_fd>) {
+                while (s,\\$,, and defined (my $cont = <$rules_fd>)) {
+                    $_ .= $cont;
+                }
+                next if /^\s*\#/;
+                if ( m/^\t\s*dh\s.*--buildsystem(?:=|\s+)(?:\S+,)*phppear\s/ ) {
+                    $has_buildsystem_phppear = 1;
+                }
+                if ( m/^\t\s*dh\s.*--with(?:=|\s+)(?:\S+,)*phppear\s/ ) {
+                    $has_addon_phppear = 1;
+                }
+                if ( m/^\t\s*dh\s.*--with(?:=|\s+)(?:\S+,)*phpcomposer\s/ ) {
+                    $has_addon_phpcomposer = 1;
+                }
+                if ( m/^\t\s*dh\s.*--with(?:=|\s+)(?:\S+,)*php5\s/ ) {
+                    $has_addon_php5 = 1;
+                }
+            }
+            close($rules_fd);
+            if (defined($package_xml) || defined($package2_xml) || defined($channel_xml)) {
+                if (!$has_buildsystem_phppear) {
+                    tag 'missing-pkg-php-tools-buildsystem', 'phppear'
+                }
+                if (!$has_addon_phppear) {
+                    tag 'missing-pkg-php-tools-addon', 'phppear'
+                }
+                if (($package_type eq 'extsrc') and !$has_addon_php5) {
+                    tag 'missing-pkg-php-tools-addon', 'php5'
+                }
+            }
+            if (!defined($package_xml) && !defined($package2_xml) && defined($composer_json)) {
+                if (!$has_addon_phpcomposer) {
+                    tag 'missing-pkg-php-tools-addon', 'phpcomposer'
+                }
+            }
+        }
+    }
     return;
 }
 
diff --git a/debian/control b/debian/control
index bcba816..6aed692 100644
--- a/debian/control
+++ b/debian/control
@@ -47,6 +47,7 @@ Build-Depends: binutils,
                man-db,
                patchutils,
                perl,
+               pkg-php-tools (>= 1.5~),
                python,
                python-all-dev,
                python-numpy,
diff --git a/t/tests/phppear-composer/desc b/t/tests/phppear-composer/desc
index 3153526..6b0534b 100644
--- a/t/tests/phppear-composer/desc
+++ b/t/tests/phppear-composer/desc
@@ -3,5 +3,6 @@ Sequence: 6000
 Version: 1.0-1
 Description: Composer phppear tests
 Test-For:
+ missing-pkg-php-tools-addon
  composer-package-without-pkg-php-tools-builddep
 Type: non-native
diff --git a/t/tests/phppear-composer/tags b/t/tests/phppear-composer/tags
index 3a66263..5586cc4 100644
--- a/t/tests/phppear-composer/tags
+++ b/t/tests/phppear-composer/tags
@@ -1 +1,2 @@
 W: phppear-composer source: composer-package-without-pkg-php-tools-builddep
+W: phppear-composer source: missing-pkg-php-tools-addon phpcomposer
diff --git a/t/tests/phppear-general/desc b/t/tests/phppear-general/desc
index 2b50a0c..69efa9a 100644
--- a/t/tests/phppear-general/desc
+++ b/t/tests/phppear-general/desc
@@ -3,6 +3,7 @@ Sequence: 6000
 Version: 1.0-1
 Description: General phppear tests
 Test-For:
+ missing-pkg-php-tools-buildsystem
  pear-channel-without-pkg-php-tools-builddep
  pear-package-without-pkg-php-tools-builddep
 Type: non-native
diff --git a/t/tests/phppear-general/tags b/t/tests/phppear-general/tags
index 83cf56a..99b9411 100644
--- a/t/tests/phppear-general/tags
+++ b/t/tests/phppear-general/tags
@@ -1,2 +1,4 @@
+W: phppear-general source: missing-pkg-php-tools-addon phppear
+W: phppear-general source: missing-pkg-php-tools-buildsystem phppear
 W: phppear-general source: pear-channel-without-pkg-php-tools-builddep
 W: phppear-general source: pear-package-without-pkg-php-tools-builddep
diff --git a/t/tests/phppear-pear/desc b/t/tests/phppear-pear/desc
index 8e72e0b..5669ae6 100644
--- a/t/tests/phppear-pear/desc
+++ b/t/tests/phppear-pear/desc
@@ -3,6 +3,8 @@ Sequence: 6000
 Version: 1.0-1
 Description: phppear tests for PEAR packages
 Test-For:
+ missing-pkg-php-tools-addon
+ missing-pkg-php-tools-buildsystem
  pear-package-but-missing-dependency
  pear-package-feature-requires-newer-pkg-php-tools
  pear-package-not-using-substvar
diff --git a/t/tests/phppear-pear/tags b/t/tests/phppear-pear/tags
index d0b3852..b819015 100644
--- a/t/tests/phppear-pear/tags
+++ b/t/tests/phppear-pear/tags
@@ -1,3 +1,6 @@
+W: phppear-pear source: missing-pkg-php-tools-addon php5
+W: phppear-pear source: missing-pkg-php-tools-addon phppear
+W: phppear-pear source: missing-pkg-php-tools-buildsystem phppear
 W: phppear-pear source: pear-package-but-missing-dependency Breaks
 W: phppear-pear source: pear-package-but-missing-dependency Depends
 W: phppear-pear source: pear-package-but-missing-dependency Recommends
diff --git a/t/tests/description-homepage/debian/debian/control.in b/t/tests/phppear-pearok/debian/debian/control.in
old mode 100644
new mode 100755
similarity index 60%
copy from t/tests/description-homepage/debian/debian/control.in
copy to t/tests/phppear-pearok/debian/debian/control.in
index 57c1191..a1e1543
--- a/t/tests/description-homepage/debian/debian/control.in
+++ b/t/tests/phppear-pearok/debian/debian/control.in
@@ -3,15 +3,17 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 9)
+Build-Depends: debhelper (>= 9), pkg-php-tools, php5-dev, dh-php5
 
 Package: {$srcpkg}
 Architecture: {$architecture}
-Depends: $\{misc:Depends\}
-Description: {$description}
+Depends: $\{misc:Depends\}, $\{phppear:Debian-Depends\}
+Recommends: $\{phppear:Debian-Recommends\}
+Breaks: $\{phppear:Debian-Breaks\}
+Description: $\{phppear:summary\}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.  It may
  be an empty package.
  .
- See the package web site at <http://lintian.debian.org/>.
+ $\{phppear:description\}
diff --git a/t/tests/phppear-pearok/debian/debian/rules b/t/tests/phppear-pearok/debian/debian/rules
new file mode 100755
index 0000000..02621c3
--- /dev/null
+++ b/t/tests/phppear-pearok/debian/debian/rules
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+%:
+	dh $@ --with phppear --buildsystem phppear
diff --git a/t/tests/phppear-pear/desc b/t/tests/phppear-pearok/desc
similarity index 71%
copy from t/tests/phppear-pear/desc
copy to t/tests/phppear-pearok/desc
index 8e72e0b..8dabd76 100644
--- a/t/tests/phppear-pear/desc
+++ b/t/tests/phppear-pearok/desc
@@ -1,8 +1,10 @@
-Testname: phppear-pear
+Testname: phppear-pearok
 Sequence: 6000
 Version: 1.0-1
 Description: phppear tests for PEAR packages
-Test-For:
+Test-Against:
+ missing-pkg-php-tools-addon
+ missing-pkg-php-tools-buildsystem
  pear-package-but-missing-dependency
  pear-package-feature-requires-newer-pkg-php-tools
  pear-package-not-using-substvar
diff --git a/t/debs/deb-format-record-size/tags b/t/tests/phppear-pearok/tags
similarity index 100%
copy from t/debs/deb-format-record-size/tags
copy to t/tests/phppear-pearok/tags
diff --git a/reporting/lintian-dummy.cfg b/t/tests/phppear-pearok/upstream/MyProject_Packages-0.0.1/empty.php
similarity index 100%
copy from reporting/lintian-dummy.cfg
copy to t/tests/phppear-pearok/upstream/MyProject_Packages-0.0.1/empty.php
diff --git a/t/tests/phppear-pear/upstream/package.xml b/t/tests/phppear-pearok/upstream/package.xml
similarity index 90%
copy from t/tests/phppear-pear/upstream/package.xml
copy to t/tests/phppear-pearok/upstream/package.xml
index 1076ad7..57af010 100644
--- a/t/tests/phppear-pear/upstream/package.xml
+++ b/t/tests/phppear-pearok/upstream/package.xml
@@ -25,8 +25,8 @@
 &lt;none&gt;
  </notes>
  <contents>
-  <dir baseinstalldir="/dev/null" name="/">
-   <file baseinstalldir="/dev/null" md5sum="d41d8cd98f00b204e9800998ecf8427e" name="empty.php" role="php"/>
+  <dir baseinstalldir="Test" name="/">
+   <file baseinstalldir="Test" md5sum="d41d8cd98f00b204e9800998ecf8427e" name="empty.php" role="php"/>
   </dir>
  </contents>
  <dependencies>
@@ -39,7 +39,7 @@
    </pearinstaller>
   </required>
  </dependencies>
- <extsrcrelease/>
+ <phprelease/>
  <changelog>
   <release>
    <version>

-- 
Debian package checker


Reply to: