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

[SCM] Debian package checker branch, master, updated. 2.3.2-10-g2b5273b



The following commit has been merged in the master branch:
commit 4e5b6b88802a0a622bc8b0de93e66dd8333ec3d6
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Thu Jan 28 15:26:06 2010 -0600

    Warn about packages missing a phpapi dependency
    
    Packages shipping PHP extensions must depend on phpapi-*, just like Perl
    binary modules must depend on perlapi-*.

diff --git a/checks/binaries b/checks/binaries
index 09978e0..9deda78 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -83,6 +83,7 @@ my $needs_libc_file;
 my $needs_libc_count = 0;
 my $needs_depends_line = 0;
 my $has_perl_lib = 0;
+my $has_php_ext = 0;
 
 my %SONAME;
 
@@ -286,6 +287,11 @@ foreach my $file (sort keys %{$info->file_info}) {
 	$has_perl_lib = 1;
     }
 
+    # PHP extension?
+    if ($file =~ m,^\./usr/lib/php\d/.*\.so$,) {
+	$has_php_ext = 1;
+    }
+
     # Something other than detached debugging symbols in /usr/lib/debug paths.
     if ($file =~ m,^\./usr/lib/debug/(?:lib\d*|s?bin|usr|opt|dev|emul)/,) {
 	if (exists($objdump->{NEEDED})) {
@@ -383,6 +389,13 @@ if ($has_perl_lib) {
     }
 }
 
+# Check for a phpapi- dependency.
+if ($has_php_ext) {
+    unless ($depends =~ /(?:^|,)\s*phpapi-[\d\w+]+\s*(?:,|\z)/) {
+	tag 'missing-dependency-on-phpapi';
+    }
+}
+
 }
 
 1;
diff --git a/checks/binaries.desc b/checks/binaries.desc
index 573d486..642c747 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -191,6 +191,22 @@ Info: This package includes a *.so file in <tt>/usr/lib/perl5</tt>,
  ${perl:Depends} substitution variable in the Depends line in
  <tt>debian/control</tt>.
 
+Tag: missing-dependency-on-phpapi
+Severity: serious
+Certainty: certain
+Info: This package includes a *.so file in <tt>/usr/lib/phpN</tt>
+ (where N is a number representing the major PHP version), normally
+ indicating that it includes a PHP extension.  PHP extensions must
+ depend on phpapi-$(php-configN --phpapi), without adding an
+ alternative package with the OR operator.
+ .
+ This can usually be achieved by, for example, adding the following
+ code to the binary-arch target of the rules file and adding
+ <tt>${php:Depends}</tt> to the <tt>Depends</tt> field of the binary
+ package shipping the extension:
+ .
+ echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars
+
 Tag: debug-file-should-use-detached-symbols
 Severity: normal
 Certainty: certain

-- 
Debian package checker


Reply to: