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

Bug#785329: lintian: Add check for CMake private files



Package: lintian
Version: 2.5.30+deb8u4
Severity: wishlist
Tags: patch

Hi! I am attaching a patch for detecting CMake private files.

I am not really versed in perl, so if you think something must be changed
do not heasitate in replying :)

Thanks, Lisandro.

-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lintian depends on:
ii  binutils                       2.25-5
ii  bzip2                          1.0.6-7+b3
ii  diffstat                       1.58-1
ii  file                           1:5.22+15-2
ii  gettext                        0.19.3-2
ii  hardening-includes             2.6
ii  intltool-debian                0.35.0+20060710.1
ii  libapt-pkg-perl                0.1.29+b2
ii  libarchive-zip-perl            1.39-1
ii  libclass-accessor-perl         0.34-1
ii  libclone-perl                  0.37-1+b1
ii  libdpkg-perl                   1.17.25
ii  libemail-valid-perl            1.195-1
ii  libfile-basedir-perl           0.03-1
ii  libipc-run-perl                0.92-1
ii  liblist-moreutils-perl         0.33-2+b1
ii  libparse-debianchangelog-perl  1.2.0-1.1
ii  libtext-levenshtein-perl       0.11-1
ii  libtimedate-perl               2.3000-2
ii  liburi-perl                    1.64-1
ii  man-db                         2.7.0.2-5
ii  patchutils                     0.3.3-1
ii  perl [libdigest-sha-perl]      5.20.2-3
ii  t1utils                        1.38-4

Versions of packages lintian recommends:
ii  libautodie-perl                 2.25-1
ii  libperlio-gzip-perl             0.18-3+b1
ii  perl                            5.20.2-3
ii  perl-modules [libautodie-perl]  5.20.2-3

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.17.25
ii  libhtml-parser-perl    3.71-1+b3
ii  libtext-template-perl  1.46-1
pn  libyaml-perl           <none>
ii  xz-utils               5.1.1alpha+20120614-2+b3

-- no debconf information
diff --git a/checks/files.desc b/checks/files.desc
index be5d264..3655407 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1329,6 +1329,16 @@ Info: This package contains a file named <tt>mimeinfo.cache</tt>,
  included in a package since it needs to be generated dynamically based on
  the installed .desktop files on the system.
 
+Tag: package-contains-cmake-private-file
+Severity: important
+Certainty: certain
+Ref: https://wiki.debian.org/CMake
+Info: This package contains a file in a path reserved just to
+ <tt>CMake</tt>. This normally means you are shipping a <tt>Find</tt>
+ module. Libraries shouldn't ship Find modules at all but Config files
+ on an unversioned path
+ \<prefix\>/(lib/\<arch\>|lib|share)/cmake/\<name\>*/
+
 Tag: package-modifies-ld.so-search-path
 Severity: important
 Certainty: possible
diff --git a/checks/files.pm b/checks/files.pm
index 7ad6e1f..99f9dc7 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -692,6 +692,13 @@ sub run {
                 $fname=~ m,^usr/share/applications/mimeinfo.cache(?:\.gz)?$,){
                 tag 'package-contains-mimeinfo.cache-file', $file;
             }
+            # ---------------- /usr/share/cmake-*
+            elsif (
+                $fname=~ m,^usr/share/cmake-\d+\.\d+/.+,){
+                  unless ($source_pkg eq 'cmake') {
+                    tag 'package-contains-cmake-private-file', $file;
+                  }
+            }
             # ---------------- /usr/share/man and /usr/X11R6/man
             elsif ($fname =~ m,^usr/X11R6/man/\S+,
                 or $fname =~ m,^usr/share/man/\S+,) {

Reply to: