Subject: [PATCH] Check for bad and problematic versions of the PHP licence

From: Raphael Geissert <[email-masked]>
Date: Sat, 29 Nov 2008 14:24:08 -0600

Signed-off-by: Raphael Geissert <[email-masked]>
---
 checks/copyright-file      |    8 ++++++++
 checks/copyright-file.desc |   15 +++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/checks/copyright-file b/checks/copyright-file
index 38de6a0..30cc356 100644
--- a/checks/copyright-file
+++ b/checks/copyright-file
@@ -181,6 +181,14 @@ if (m/(Free\s*Software\s*Foundation.*02139|02111-1307)/s) {
     tag "old-fsf-address-in-copyright-file", "";
 }
 
+if (m/(The\s+PHP\s+Licen[cs]e,?\s+version\s+2)/si) {
+    tag "copyright-refers-to-bad-php-license", "";
+}
+
+if (m/(The\s+PHP\s+Licen[cs]e,?\s+version\s+3\.0[^\d])/si) {
+    tag "copyright-refers-to-problematic-php-license", "";
+}
+
 # Whether the package is covered by the GPL, used later for the libssl check.
 my $gpl;
 
diff --git a/checks/copyright-file.desc b/checks/copyright-file.desc
index 4801f36..df95bd2 100644
--- a/checks/copyright-file.desc
+++ b/checks/copyright-file.desc
@@ -296,6 +296,21 @@ Info: Lintian found a spelling error in the copyright file.  Lintian has a
  list of common misspellings that it looks for.  It does not have a
  dictionary like a spelling checker does.
 
+Tag: copyright-refers-to-bad-php-license
+Severity: serious
+Certainty: possible
+Ref: http://ftp-master.debian.org/REJECT-FAQ.html, http://thread.gmane.org/gmane.linux.debian.devel.legal/23332, http://thread.gmane.org/gmane.linux.debian.devel.legal/31693
+Info: This package appears to be covered by the PHP license version 2.x
+ which is considered inapplicable for anything but PHP itself.
+
+Tag: copyright-refers-to-problematic-php-license
+Severity: serious
+Certainty: wild-guess
+Ref: http://ftp-master.debian.org/REJECT-FAQ.html, http://thread.gmane.org/gmane.org/gmane.linux.debian.devel.legal/22547, http://thread.gmane.org/gmane.linux.debian.devel.legal/31693
+Info: This package appears to be covered by the PHP license version 3.0
+ which is considered inapplicable for anything that is not PHP and has no
+ contribution from the PHP Group.
+
 Tag: possible-gpl-code-linked-with-openssl
 Severity: serious
 Certainty: wild-guess