lintian: r422 - in trunk: checks debian man testset testset/empty/debian
Author: he
Date: 2005-06-26 13:42:18 +0200 (Sun, 26 Jun 2005)
New Revision: 422
Added:
trunk/checks/rules
trunk/checks/rules.desc
Modified:
trunk/debian/changelog
trunk/debian/control
trunk/debian/copyright
trunk/man/lintian.1
trunk/testset/empty/debian/rules
trunk/testset/tags.empty
Log:
* checks/rules:
+ [HE] New file with two new tests, checking that debian/rules is a
Makefile and that it contains rules for all mandatory targets.
Patch by Ren?\195?\169 van Bevern, thanks for the work. (Closes: #311786)
Added: trunk/checks/rules
===================================================================
--- trunk/checks/rules 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/checks/rules 2005-06-26 11:42:18 UTC (rev 422)
@@ -0,0 +1,44 @@
+# rules -- lintian check script
+
+# Copyright (C) 2005 René van Bevern <rvb@pro-linux.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+package Lintian::rules;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+ my $rules = 'debian/rules';
+ my @required_targets = ('build', 'binary', 'binary-arch',
+ 'binary-indep', 'clean');
+
+ fail 'unpacked source tree is unavailable' unless -d 'unpacked';
+
+ # check for #!/usr/bin/make -f
+ open (RULES, '<', "unpacked/$rules") or fail "Could not open unpacked/$rules";
+ unless (<RULES> =~ /#!\s*\/usr\/bin\/make\s+-f/) {
+ tag 'debian-rules-not-a-makefile';
+ }
+ close RULES;
+
+ # check for missing targets
+ foreach my $target (@required_targets) {
+ if ((system "make -C unpacked -f $rules -n $target > /dev/null 2>&1") != 0) {
+ tag 'debian-rules-lacks-target', $target;
+ }
+ }
+}
+
+1;
+
+# vim: syntax=perl sw=4 ts=4 noet shiftround
Added: trunk/checks/rules.desc
===================================================================
--- trunk/checks/rules.desc 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/checks/rules.desc 2005-06-26 11:42:18 UTC (rev 422)
@@ -0,0 +1,20 @@
+Check-Script: rules
+Author: Rene van Bevern <rvb@pro-linux.de>
+Standards-Version: 3.6.1.1
+Type: source
+Unpack-Level: 2
+Info: checks for common problems in debian/rules
+Abbrev: rls
+
+Tag: debian-rules-lacks-target
+Type: error
+Ref: policy 4.8
+Info: Your debian/rules lacks or contains an errorneous target.
+ The Debian policy requires that the debian/rules provides at least the
+ clean, binary, binary-arch, binary-indep and build targets.
+
+Tag: debian-rules-not-a-makefile
+Type: error
+Ref: policy 4.8
+Info: Your debian/rules is not a Makefile. Make sure that your script
+ starts with something like "#!/usr/bin/make -f" in its first line.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/debian/changelog 2005-06-26 11:42:18 UTC (rev 422)
@@ -2,6 +2,11 @@
* The "Ah, it's LinuxTag and I still have free time!" release
+ * checks/rules:
+ + [HE] New file with two new tests, checking that debian/rules is a
+ Makefile and that it contains rules for all mandatory targets.
+ Patch by Ren�an Bevern, thanks for the work. (Closes: #311786)
+
* checks/scripts:
+ [HE] Allow Scripts in /etc/Xsession.d/ to be not executable, as they're
not directly called, but only sourced. (Closes: #309203)
Modified: trunk/debian/control
===================================================================
--- trunk/debian/control 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/debian/control 2005-06-26 11:42:18 UTC (rev 422)
@@ -9,7 +9,7 @@
Package: lintian
Architecture: all
-Depends: perl, libdigest-md5-perl | perl (>> 5.8), file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext, intltool-debian
+Depends: perl, libdigest-md5-perl | perl (>> 5.8), file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext, intltool-debian, make
Suggests: binutils-multiarch
Description: Debian package checker
Lintian dissects Debian packages and reports bugs and policy
Modified: trunk/debian/copyright
===================================================================
--- trunk/debian/copyright 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/debian/copyright 2005-06-26 11:42:18 UTC (rev 422)
@@ -23,6 +23,7 @@
Portions Copyright (C) 2004 Marc Brockschmidt
Portions Copyright (C) 2004 Frank Lichtenheld
Portions Copyright (C) 2004 Jeroen van Wolffelaar
+Portions Copyright (C) 2005 Ren�an Bevern
This program is free software; you may redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Modified: trunk/man/lintian.1
===================================================================
--- trunk/man/lintian.1 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/man/lintian.1 2005-06-26 11:42:18 UTC (rev 422)
@@ -459,6 +459,10 @@
Looks for common mistakes in packages using po\-debconf.
.TP
+.B rules (rls)
+Checks for common problems in debian/rules files.
+
+.TP
.B scripts (scr)
Check the the \fB#!\fR lines of scripts in a binary package.
Modified: trunk/testset/empty/debian/rules
===================================================================
--- trunk/testset/empty/debian/rules 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/testset/empty/debian/rules 2005-06-26 11:42:18 UTC (rev 422)
@@ -20,15 +20,13 @@
build:
-binary-arch:
-
binary-indep:
install -d debian/tmp/DEBIAN
dpkg-gencontrol
dpkg --build debian/tmp ..
-binary: binary-arch binary-indep
+binary: binary-indep
clean:
-.PHONY: build binary-arch binary-indep binary clean
+.PHONY: build binary-indep binary clean
Modified: trunk/testset/tags.empty
===================================================================
--- trunk/testset/tags.empty 2005-06-26 10:20:06 UTC (rev 421)
+++ trunk/testset/tags.empty 2005-06-26 11:42:18 UTC (rev 422)
@@ -1,3 +1,4 @@
+E: empty source: debian-rules-lacks-target binary-arch
E: empty source: maintainer-address-missing empty
E: empty source: no-standards-version-field
E: empty: maintainer-address-missing empty
Reply to: