[rpmlint/f13/master] add support for el5-rpmlint, el6-rpmlint | disable no-cleaning-of-buildroot checks for Fedora | disa

Tom Callaway spot at fedoraproject.org
Mon Dec 6 17:38:06 UTC 2010


commit 05defd6e7effb43ab4a3d4995794dbe93fb203f9
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Mon Dec 6 12:38:19 2010 -0500

    add support for el5-rpmlint, el6-rpmlint | disable no-cleaning-of-buildroot checks for Fedora | disable no-buildroot-tag check for Fedora | disable no-%clean-section check for Fedora

 rpmlint.config     |   31 ++++-
 rpmlint.config.el4 |  367 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 rpmlint.config.el5 |  367 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 rpmlint.spec       |   39 ++++++-
 4 files changed, 798 insertions(+), 6 deletions(-)
---
diff --git a/rpmlint.config b/rpmlint.config
index d24578a..195c183 100644
--- a/rpmlint.config
+++ b/rpmlint.config
@@ -40,8 +40,9 @@ setOption("DanglingSymlinkExceptions", (
 setOption("ValidLicenses", (
     # These are the short names for all of the Fedora approved licenses.
     # The master list is kept here: http://fedoraproject.org/wiki/Licensing
-    # Last synced with revision "1.75, 3 June 2010" of that page.
+    # Last synced with revision "1.85, 21 October 2010" of that page.
     'AAL',
+    'Abstyles',
     'Adobe',
     'ADSL',
     'AFL',
@@ -62,7 +63,8 @@ setOption("ValidLicenses", (
     'ASL 1.1+',
     'ASL 2.0',
     'ASL 2.0+',
-    'Beerware',
+    'Barr',
+    'BeOpen',
     'BitTorrent',
     'Boost',
     'BSD',
@@ -79,8 +81,10 @@ setOption("ValidLicenses", (
     'Copyright only',
     'CPAL',
     'CPL',
+    'Crossword',
     'Crystal Stacker',
     'DOC',
+    'Dotseqn',
     'dvipdfm',
     'ECL 1.0',
     'ECL 2.0',
@@ -125,6 +129,7 @@ setOption("ValidLicenses", (
     'JasPer',
     'JPython',
     'Knuth',
+    'Latex2e',
     'LBNL BSD',
     'LGPLv2',
     'LGPLv2 with exceptions',
@@ -135,6 +140,7 @@ setOption("ValidLicenses", (
     'LGPLv3 with exceptions',
     'LGPLv3+',
     'LGPLv3+ with exceptions',
+    'Lhcyr',
     'libtiff',
     'LLGPL',
     'Logica',
@@ -157,6 +163,7 @@ setOption("ValidLicenses", (
     'NetCDF',
     'Netscape',
     'Newmat',
+    'Newsletr',
     'NGPL',
     'Nokia',
     'NOSL',
@@ -190,6 +197,7 @@ setOption("ValidLicenses", (
     'RiceBSD',
     'Romio',
     'RPSL',
+    'Rsfs',
     'Ruby',
     'Saxpath',
     'SCEA',
@@ -202,6 +210,7 @@ setOption("ValidLicenses", (
     'SPL',
     'TCL',
     'Teeworlds',
+    'Threeparttable',
     'TMate',
     'TOSL',
     'TPL',
@@ -212,12 +221,14 @@ setOption("ValidLicenses", (
     'VSL',
     'W3C',
     'Webmin',
+    'Wsuipa',
     'WTFPL',
     'wxWidgets',
     'Xerox',
     'xinetd',
     'XSkat',
     'YPLv1.1',
+    'Zed',
     'Zend',
     'zlib',
     'zlib with acknowledgement',
@@ -336,6 +347,18 @@ addFilter("filename-too-long-for-joliet")
 addFilter("symlink-should-be-")
 addFilter("dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$")
 addFilter("hidden-file-or-dir .*/man5/\.k5login\.5[^/]+$")
-# TODO: more whitelisted executables, https://bugzilla.redhat.com/496737
-addFilter("krb5-workstation.+ (setuid-binary|non-standard-executable-perm) /usr/kerberos/bin/ksu (root )?04755")
 addFilter("blender.+ (wrong-script-interpreter|non-executable-script) .+/blender/.+\.py.*BPY.*")
+# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
+# of %install, and do not need to define a %clean section unless the default is invalid.
+addFilter("no-cleaning-of-buildroot")
+addFilter("no-buildroot-tag")
+addFilter("no-%clean-section")
+# https://bugzilla.redhat.com/496737, https://bugzilla.redhat.com/646455
+for pkg, exe in (("coreutils", "/bin/su"),
+                 ("krb5-workstation", "/usr/kerberos/bin/ksu"),
+                 ("passwd", "/usr/bin/passwd"),
+                 ("sudo", "/usr/bin/sudo(edit)?"),
+                 ("upstart", "/sbin/initctl"),
+                 ("usermode", "/usr/sbin/userhelper")):
+    addFilter("%s.* (setuid-binary|non-standard-executable-perm) %s (root )?04"
+              % (pkg, exe))
diff --git a/rpmlint.config.el4 b/rpmlint.config.el4
new file mode 100644
index 0000000..acc24d9
--- /dev/null
+++ b/rpmlint.config.el4
@@ -0,0 +1,367 @@
+# -*- python -*-
+
+# System wide rpmlint default configuration.  Do not modify, override/add
+# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
+
+import os.path
+import re
+import sys
+
+from Config import *
+import Pkg
+
+
+setOption("CompressExtension", "gz")
+setOption("DefaultPythonVersion", sys.version[:3])
+setOption("KernelModuleRPMsOK", False)
+setOption("MaxLineLength", 80)
+setOption("NetworkEnabled", True)
+setOption("ReleaseExtension", '\.(fc|rhe?l|el)\d+(?=\.|$)')
+setOption("UseDefaultRunlevels", False)
+setOption("UseEpoch", False)
+setOption("UseUTF8", True)
+setOption("UseVersionInChangeLog", True)
+setOption("ValidSrcPerms", (0664, 0644, ))
+
+setOption("ValidShells", (
+    "<lua>",
+    "/bin/sh",
+    "/bin/bash",
+    "/sbin/ldconfig",
+    "/usr/bin/perl",
+    "/usr/bin/python",
+))
+
+setOption("DanglingSymlinkExceptions", (
+    ['consolehelper$', 'usermode'],
+    ['consolehelper-gtk$', 'usermode-gtk'],
+))
+
+setOption("ValidLicenses", (
+    # These are the short names for all of the Fedora approved licenses.
+    # The master list is kept here: http://fedoraproject.org/wiki/Licensing
+    # Last synced with revision "1.85, 21 October 2010" of that page.
+    'AAL',
+    'Abstyles',
+    'Adobe',
+    'ADSL',
+    'AFL',
+    'AGPLv1',
+    'AGPLv3',
+    'AGPLv3 with exceptions',
+    'AMDPLPA',
+    'AML',
+    'AMPAS BSD',
+    'APSL 2.0',
+    'APSL 2.0+',
+    'ARL',
+    'Artistic 2.0',
+    'Artistic clarified',
+    'ASL 1.0',
+    'ASL 1.0+',
+    'ASL 1.1',
+    'ASL 1.1+',
+    'ASL 2.0',
+    'ASL 2.0+',
+    'Barr',
+    'BeOpen',
+    'BitTorrent',
+    'Boost',
+    'BSD',
+    'BSD Protection',
+    'BSD with advertising',
+    'CATOSL',
+    'CC0',
+    'CeCILL',
+    'CeCILL-B',
+    'CeCILL-C',
+    'CDDL',
+    'CNRI',
+    'Condor',
+    'Copyright only',
+    'CPAL',
+    'CPL',
+    'Crossword',
+    'Crystal Stacker',
+    'DOC',
+    'Dotseqn',
+    'dvipdfm',
+    'ECL 1.0',
+    'ECL 2.0',
+    'eCos',
+    'EFL 2.0',
+    'EFL 2.0+',
+    'Entessa',
+    'EPL',
+    'ERPL',
+    'EU Datagrid',
+    'EUPL 1.1',
+    'Eurosym',
+    'Fair',
+    'FTL',
+    'Giftware',
+    'GL2PS',
+    'Glide',
+    'gnuplot',
+    'GPL+',
+    'GPL+ or Artistic',
+    'GPL+ with exceptions',
+    'GPLv1',
+    'GPLv2 or Artistic',
+    'GPLv2+ or Artistic',
+    'GPLv2',
+    'GPLv2 with exceptions',
+    'GPLv2+',
+    'GPLv2+ with exceptions',
+    'GPLv3',
+    'GPLv3 with exceptions',
+    'GPLv3+',
+    'GPLv3+ with exceptions',
+    'IBM',
+    'IJG',
+    'ImageMagick',
+    'iMatix',
+    'Imlib2',
+    'Intel ACPI',
+    'Interbase',
+    'ISC',
+    'Jabber',
+    'JasPer',
+    'JPython',
+    'Knuth',
+    'Latex2e',
+    'LBNL BSD',
+    'LGPLv2',
+    'LGPLv2 with exceptions',
+    'LGPLv2+',
+    'LGPLv2+ or Artistic',
+    'LGPLv2+ with exceptions',
+    'LGPLv3',
+    'LGPLv3 with exceptions',
+    'LGPLv3+',
+    'LGPLv3+ with exceptions',
+    'Lhcyr',
+    'libtiff',
+    'LLGPL',
+    'Logica',
+    'LPL',
+    'LPPL',
+    'mecab-ipadic',
+    'MirOS',
+    'MIT',
+    'MIT with advertising',
+    'mod_macro',
+    'Motosoto',
+    'MPLv1.0',
+    'MPLv1.0+',
+    'MPLv1.1',
+    'MPLv1.1+',
+    'MS-PL',
+    'MS-RL',
+    'Naumen',
+    'NCSA',
+    'NetCDF',
+    'Netscape',
+    'Newmat',
+    'Newsletr',
+    'NGPL',
+    'Nokia',
+    'NOSL',
+    'Noweb',
+    'OML',
+    'OpenLDAP',
+    'OpenPBS',
+    'OpenSSL',
+    'OReilly',
+    'OSL 1.0',
+    'OSL 1.0+',
+    'OSL 1.1',
+    'OSL 1.1+',
+    'OSL 2.0',
+    'OSL 2.0+',
+    'OSL 2.1',
+    'OSL 2.1+',
+    'OSL 3.0',
+    'OSL 3.0+',
+    'Phorum',
+    'PHP',
+    'PlainTeX',
+    'Plexus',
+    'PostgreSQL',
+    'psutils',
+    'Public Domain',
+    'Python',
+    'Qhull',
+    'QPL',
+    'Rdisc',
+    'RiceBSD',
+    'Romio',
+    'RPSL',
+    'Rsfs',
+    'Ruby',
+    'Saxpath',
+    'SCEA',
+    'SCRIP',
+    'Sendmail',
+    'Sleepycat',
+    'SISSL',
+    'SLIB',
+    'SNIA',
+    'SPL',
+    'TCL',
+    'Teeworlds',
+    'Threeparttable',
+    'TMate',
+    'TOSL',
+    'TPL',
+    'UCD',
+    'Vim',
+    'VNLSL',
+    'VOSTROM',
+    'VSL',
+    'W3C',
+    'Webmin',
+    'Wsuipa',
+    'WTFPL',
+    'wxWidgets',
+    'Xerox',
+    'xinetd',
+    'XSkat',
+    'YPLv1.1',
+    'Zed',
+    'Zend',
+    'zlib',
+    'zlib with acknowledgement',
+    'ZPLv1.0',
+    'ZPLv1.0+',
+    'ZPLv2.0',
+    'ZPLv2.0+',
+    'ZPLv2.1',
+    'ZPLv2.1+',
+    # Documentation licenses
+    'CDL',
+    'FBSDDL',
+    'GFDL',
+    'IEEE',
+    'LDPL',
+    'OFSFDL',
+    'Open Publication',
+    'Public Use',
+    # Content licenses
+    'CC-BY',
+    'CC-BY-ND',
+    'CC-BY-SA',
+    'DMTF',
+    'DSL',
+    'EFML',
+    'Free Art',
+    'GeoGratis',
+    'Green OpenMusic',
+    'OAL',
+    # Font licenses
+    'AMS',
+    'Arphic',
+    'Baekmuk',
+    'Bitstream Vera',
+    'DoubleStroke',
+    'Hershey',
+    'IPA',
+    'Liberation',
+    'Lucida',
+    'MgOpen',
+    'mplus',
+    'OFL',
+    'PTFL',
+    'STIX',
+    'Utopia',
+    'Wadalab',
+    'XANO',
+    # Others
+    'Redistributable, no modification permitted',
+    'Freely redistributable without restriction',
+))
+
+setOption('SystemLibPaths', ('/lib', '/lib64', '/usr/lib', '/usr/lib64'))
+
+# Get standard users and groups from the setup package's uidgid file
+setOption('StandardUsers', [])
+setOption('StandardGroups', [])
+setup_pkg = None
+try:
+    setup_pkg = Pkg.InstalledPkg('setup')
+except:
+    pass
+if setup_pkg:
+    users = set()
+    groups = set()
+    uidgid_regex = re.compile(r'^\s*(\S+)\s+(-|\d+)\s+(-|\d+|\(\d+\))\s')
+    for uidgid_file in [x for x in setup_pkg.files() if x.endswith('/uidgid')]:
+        if os.path.exists(uidgid_file):
+            fobj = open(uidgid_file)
+            try:
+                for line in fobj.read().strip().splitlines():
+                    res = uidgid_regex.search(line)
+                    if res:
+                        name = res.group(1)
+                        if res.group(2) != '-':
+                            users.add(name)
+                        if res.group(3) != '-' and not '(' in res.group(3):
+                            groups.add(name)
+                    del res
+                del line
+            finally:
+                fobj.close()
+            del fobj
+    setOption('StandardUsers', sorted(users))
+    setOption('StandardGroups', sorted(groups))
+    del uidgid_regex, uidgid_file, users, groups
+del setup_pkg
+
+# Output filters
+addFilter("source-or-patch-not-compressed")
+addFilter("%mklibname")
+addFilter("no-dependency-on (perl|python)-base")
+addFilter("no-dependency-on locales-")
+addFilter("(python|perl5)-naming-policy-not-applied")
+addFilter("no-(packager-tag|signature)")
+addFilter("incoherent-version-in-name")
+addFilter("invalid-build-requires")
+addFilter("ghost-files-without-postin")
+addFilter("postin-without-ghost-file-creation")
+addFilter("no-major-in-name")
+addFilter("no-provides")
+addFilter("executable-in-library-package")
+addFilter("non-versioned-file-in-library-package")
+addFilter("requires-on-release")
+addFilter("jar-not-indexed")
+addFilter("outside-libdir-files")
+addFilter("-debuginfo.* no-documentation")
+addFilter("-debuginfo.* /usr/lib/debug/")
+addFilter("non-standard-dir-in-usr libexec")
+addFilter("^gpg-pubkey:")
+addFilter(" doc-file-dependency .* /bin/sh$")
+addFilter("hardcoded-library-path .*/lib/udev(/|$)")
+addFilter("not-standard-release-extension")
+addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python)$)")
+addFilter("filename-too-long-for-joliet")
+addFilter("symlink-should-be-")
+addFilter("dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$")
+addFilter("hidden-file-or-dir .*/man5/\.k5login\.5[^/]+$")
+addFilter("blender.+ (wrong-script-interpreter|non-executable-script) .+/blender/.+\.py.*BPY.*")
+# https://bugzilla.redhat.com/496737, https://bugzilla.redhat.com/646455
+for pkg, exe in (("coreutils", "/bin/su"),
+                 ("krb5-workstation", "/usr/kerberos/bin/ksu"),
+                 ("passwd", "/usr/bin/passwd"),
+                 ("sudo", "/usr/bin/sudo(edit)?"),
+                 ("upstart", "/sbin/initctl"),
+                 ("usermode", "/usr/sbin/userhelper")):
+    addFilter("%s.* (setuid-binary|non-standard-executable-perm) %s (root )?04"
+              % (pkg, exe))
+
+# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
+# of %install, and do not need to define a %clean section unless the default is invalid.
+# However, EL-4 and EL-5 still need these checks.
+removeFilter("no-cleaning-of-buildroot")
+removeFilter("no-buildroot-tag")
+removeFilter("no-%clean-section")
+
diff --git a/rpmlint.config.el5 b/rpmlint.config.el5
new file mode 100644
index 0000000..acc24d9
--- /dev/null
+++ b/rpmlint.config.el5
@@ -0,0 +1,367 @@
+# -*- python -*-
+
+# System wide rpmlint default configuration.  Do not modify, override/add
+# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
+
+import os.path
+import re
+import sys
+
+from Config import *
+import Pkg
+
+
+setOption("CompressExtension", "gz")
+setOption("DefaultPythonVersion", sys.version[:3])
+setOption("KernelModuleRPMsOK", False)
+setOption("MaxLineLength", 80)
+setOption("NetworkEnabled", True)
+setOption("ReleaseExtension", '\.(fc|rhe?l|el)\d+(?=\.|$)')
+setOption("UseDefaultRunlevels", False)
+setOption("UseEpoch", False)
+setOption("UseUTF8", True)
+setOption("UseVersionInChangeLog", True)
+setOption("ValidSrcPerms", (0664, 0644, ))
+
+setOption("ValidShells", (
+    "<lua>",
+    "/bin/sh",
+    "/bin/bash",
+    "/sbin/ldconfig",
+    "/usr/bin/perl",
+    "/usr/bin/python",
+))
+
+setOption("DanglingSymlinkExceptions", (
+    ['consolehelper$', 'usermode'],
+    ['consolehelper-gtk$', 'usermode-gtk'],
+))
+
+setOption("ValidLicenses", (
+    # These are the short names for all of the Fedora approved licenses.
+    # The master list is kept here: http://fedoraproject.org/wiki/Licensing
+    # Last synced with revision "1.85, 21 October 2010" of that page.
+    'AAL',
+    'Abstyles',
+    'Adobe',
+    'ADSL',
+    'AFL',
+    'AGPLv1',
+    'AGPLv3',
+    'AGPLv3 with exceptions',
+    'AMDPLPA',
+    'AML',
+    'AMPAS BSD',
+    'APSL 2.0',
+    'APSL 2.0+',
+    'ARL',
+    'Artistic 2.0',
+    'Artistic clarified',
+    'ASL 1.0',
+    'ASL 1.0+',
+    'ASL 1.1',
+    'ASL 1.1+',
+    'ASL 2.0',
+    'ASL 2.0+',
+    'Barr',
+    'BeOpen',
+    'BitTorrent',
+    'Boost',
+    'BSD',
+    'BSD Protection',
+    'BSD with advertising',
+    'CATOSL',
+    'CC0',
+    'CeCILL',
+    'CeCILL-B',
+    'CeCILL-C',
+    'CDDL',
+    'CNRI',
+    'Condor',
+    'Copyright only',
+    'CPAL',
+    'CPL',
+    'Crossword',
+    'Crystal Stacker',
+    'DOC',
+    'Dotseqn',
+    'dvipdfm',
+    'ECL 1.0',
+    'ECL 2.0',
+    'eCos',
+    'EFL 2.0',
+    'EFL 2.0+',
+    'Entessa',
+    'EPL',
+    'ERPL',
+    'EU Datagrid',
+    'EUPL 1.1',
+    'Eurosym',
+    'Fair',
+    'FTL',
+    'Giftware',
+    'GL2PS',
+    'Glide',
+    'gnuplot',
+    'GPL+',
+    'GPL+ or Artistic',
+    'GPL+ with exceptions',
+    'GPLv1',
+    'GPLv2 or Artistic',
+    'GPLv2+ or Artistic',
+    'GPLv2',
+    'GPLv2 with exceptions',
+    'GPLv2+',
+    'GPLv2+ with exceptions',
+    'GPLv3',
+    'GPLv3 with exceptions',
+    'GPLv3+',
+    'GPLv3+ with exceptions',
+    'IBM',
+    'IJG',
+    'ImageMagick',
+    'iMatix',
+    'Imlib2',
+    'Intel ACPI',
+    'Interbase',
+    'ISC',
+    'Jabber',
+    'JasPer',
+    'JPython',
+    'Knuth',
+    'Latex2e',
+    'LBNL BSD',
+    'LGPLv2',
+    'LGPLv2 with exceptions',
+    'LGPLv2+',
+    'LGPLv2+ or Artistic',
+    'LGPLv2+ with exceptions',
+    'LGPLv3',
+    'LGPLv3 with exceptions',
+    'LGPLv3+',
+    'LGPLv3+ with exceptions',
+    'Lhcyr',
+    'libtiff',
+    'LLGPL',
+    'Logica',
+    'LPL',
+    'LPPL',
+    'mecab-ipadic',
+    'MirOS',
+    'MIT',
+    'MIT with advertising',
+    'mod_macro',
+    'Motosoto',
+    'MPLv1.0',
+    'MPLv1.0+',
+    'MPLv1.1',
+    'MPLv1.1+',
+    'MS-PL',
+    'MS-RL',
+    'Naumen',
+    'NCSA',
+    'NetCDF',
+    'Netscape',
+    'Newmat',
+    'Newsletr',
+    'NGPL',
+    'Nokia',
+    'NOSL',
+    'Noweb',
+    'OML',
+    'OpenLDAP',
+    'OpenPBS',
+    'OpenSSL',
+    'OReilly',
+    'OSL 1.0',
+    'OSL 1.0+',
+    'OSL 1.1',
+    'OSL 1.1+',
+    'OSL 2.0',
+    'OSL 2.0+',
+    'OSL 2.1',
+    'OSL 2.1+',
+    'OSL 3.0',
+    'OSL 3.0+',
+    'Phorum',
+    'PHP',
+    'PlainTeX',
+    'Plexus',
+    'PostgreSQL',
+    'psutils',
+    'Public Domain',
+    'Python',
+    'Qhull',
+    'QPL',
+    'Rdisc',
+    'RiceBSD',
+    'Romio',
+    'RPSL',
+    'Rsfs',
+    'Ruby',
+    'Saxpath',
+    'SCEA',
+    'SCRIP',
+    'Sendmail',
+    'Sleepycat',
+    'SISSL',
+    'SLIB',
+    'SNIA',
+    'SPL',
+    'TCL',
+    'Teeworlds',
+    'Threeparttable',
+    'TMate',
+    'TOSL',
+    'TPL',
+    'UCD',
+    'Vim',
+    'VNLSL',
+    'VOSTROM',
+    'VSL',
+    'W3C',
+    'Webmin',
+    'Wsuipa',
+    'WTFPL',
+    'wxWidgets',
+    'Xerox',
+    'xinetd',
+    'XSkat',
+    'YPLv1.1',
+    'Zed',
+    'Zend',
+    'zlib',
+    'zlib with acknowledgement',
+    'ZPLv1.0',
+    'ZPLv1.0+',
+    'ZPLv2.0',
+    'ZPLv2.0+',
+    'ZPLv2.1',
+    'ZPLv2.1+',
+    # Documentation licenses
+    'CDL',
+    'FBSDDL',
+    'GFDL',
+    'IEEE',
+    'LDPL',
+    'OFSFDL',
+    'Open Publication',
+    'Public Use',
+    # Content licenses
+    'CC-BY',
+    'CC-BY-ND',
+    'CC-BY-SA',
+    'DMTF',
+    'DSL',
+    'EFML',
+    'Free Art',
+    'GeoGratis',
+    'Green OpenMusic',
+    'OAL',
+    # Font licenses
+    'AMS',
+    'Arphic',
+    'Baekmuk',
+    'Bitstream Vera',
+    'DoubleStroke',
+    'Hershey',
+    'IPA',
+    'Liberation',
+    'Lucida',
+    'MgOpen',
+    'mplus',
+    'OFL',
+    'PTFL',
+    'STIX',
+    'Utopia',
+    'Wadalab',
+    'XANO',
+    # Others
+    'Redistributable, no modification permitted',
+    'Freely redistributable without restriction',
+))
+
+setOption('SystemLibPaths', ('/lib', '/lib64', '/usr/lib', '/usr/lib64'))
+
+# Get standard users and groups from the setup package's uidgid file
+setOption('StandardUsers', [])
+setOption('StandardGroups', [])
+setup_pkg = None
+try:
+    setup_pkg = Pkg.InstalledPkg('setup')
+except:
+    pass
+if setup_pkg:
+    users = set()
+    groups = set()
+    uidgid_regex = re.compile(r'^\s*(\S+)\s+(-|\d+)\s+(-|\d+|\(\d+\))\s')
+    for uidgid_file in [x for x in setup_pkg.files() if x.endswith('/uidgid')]:
+        if os.path.exists(uidgid_file):
+            fobj = open(uidgid_file)
+            try:
+                for line in fobj.read().strip().splitlines():
+                    res = uidgid_regex.search(line)
+                    if res:
+                        name = res.group(1)
+                        if res.group(2) != '-':
+                            users.add(name)
+                        if res.group(3) != '-' and not '(' in res.group(3):
+                            groups.add(name)
+                    del res
+                del line
+            finally:
+                fobj.close()
+            del fobj
+    setOption('StandardUsers', sorted(users))
+    setOption('StandardGroups', sorted(groups))
+    del uidgid_regex, uidgid_file, users, groups
+del setup_pkg
+
+# Output filters
+addFilter("source-or-patch-not-compressed")
+addFilter("%mklibname")
+addFilter("no-dependency-on (perl|python)-base")
+addFilter("no-dependency-on locales-")
+addFilter("(python|perl5)-naming-policy-not-applied")
+addFilter("no-(packager-tag|signature)")
+addFilter("incoherent-version-in-name")
+addFilter("invalid-build-requires")
+addFilter("ghost-files-without-postin")
+addFilter("postin-without-ghost-file-creation")
+addFilter("no-major-in-name")
+addFilter("no-provides")
+addFilter("executable-in-library-package")
+addFilter("non-versioned-file-in-library-package")
+addFilter("requires-on-release")
+addFilter("jar-not-indexed")
+addFilter("outside-libdir-files")
+addFilter("-debuginfo.* no-documentation")
+addFilter("-debuginfo.* /usr/lib/debug/")
+addFilter("non-standard-dir-in-usr libexec")
+addFilter("^gpg-pubkey:")
+addFilter(" doc-file-dependency .* /bin/sh$")
+addFilter("hardcoded-library-path .*/lib/udev(/|$)")
+addFilter("not-standard-release-extension")
+addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python)$)")
+addFilter("filename-too-long-for-joliet")
+addFilter("symlink-should-be-")
+addFilter("dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$")
+addFilter("hidden-file-or-dir .*/man5/\.k5login\.5[^/]+$")
+addFilter("blender.+ (wrong-script-interpreter|non-executable-script) .+/blender/.+\.py.*BPY.*")
+# https://bugzilla.redhat.com/496737, https://bugzilla.redhat.com/646455
+for pkg, exe in (("coreutils", "/bin/su"),
+                 ("krb5-workstation", "/usr/kerberos/bin/ksu"),
+                 ("passwd", "/usr/bin/passwd"),
+                 ("sudo", "/usr/bin/sudo(edit)?"),
+                 ("upstart", "/sbin/initctl"),
+                 ("usermode", "/usr/sbin/userhelper")):
+    addFilter("%s.* (setuid-binary|non-standard-executable-perm) %s (root )?04"
+              % (pkg, exe))
+
+# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
+# of %install, and do not need to define a %clean section unless the default is invalid.
+# However, EL-4 and EL-5 still need these checks.
+removeFilter("no-cleaning-of-buildroot")
+removeFilter("no-buildroot-tag")
+removeFilter("no-%clean-section")
+
diff --git a/rpmlint.spec b/rpmlint.spec
index f1e1b23..bdc5b5f 100644
--- a/rpmlint.spec
+++ b/rpmlint.spec
@@ -1,6 +1,6 @@
 Name:           rpmlint
-Version:        0.98
-Release:        1%{?dist}
+Version:        1.0
+Release:        2%{?dist}
 Summary:        Tool for checking common errors in RPM packages
 
 Group:          Development/Tools
@@ -10,6 +10,10 @@ Source0:        http://rpmlint.zarb.org/download/%{name}-%{version}.tar.bz2
 Source1:        %{name}.config
 Source2:        %{name}-CHANGES.package.old
 Source3:        %{name}-etc.config
+# EL-4 specific config
+Source4:	%{name}.config.el4
+# EL-5 specific config
+Source5:	%{name}.config.el5
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -56,6 +60,18 @@ make install DESTDIR=$RPM_BUILD_ROOT ETCDIR=%{_sysconfdir} MANDIR=%{_mandir} \
   LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir}
 install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config
 
+install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config.el4
+install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config.el5
+pushd $RPM_BUILD_ROOT%{_bindir}
+cp -a rpmlint el4-rpmlint
+sed -i 's|rpmlint.py|el4-rpmlint.py|g' el4-rpmlint
+cp -a rpmlint el5-rpmlint
+sed -i 's|rpmlint.py|el5-rpmlint.py|g' el5-rpmlint
+popd
+pushd $RPM_BUILD_ROOT%{_datadir}/rpmlint
+ln -s rpmlint.py el4-rpmlint.py
+ln -s rpmlint.py el5-rpmlint.py
+popd
 
 %check
 make check
@@ -71,6 +87,7 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/rpmlint/
 %{_sysconfdir}/bash_completion.d/
 %{_bindir}/rpmdiff
+%{_bindir}/el*-rpmlint
 %{_bindir}/rpmlint
 %{_datadir}/rpmlint/
 %exclude %{_datadir}/rpmlint/rpmlint.py[co]
@@ -78,6 +95,24 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Dec  6 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1.0-2
+- add support for el5-rpmlint, el6-rpmlint
+- disable no-cleaning-of-buildroot checks for Fedora
+- disable no-buildroot-tag check for Fedora
+- disable no-%clean-section check for Fedora
+
+* Mon Nov  1 2010 Ville Skyttä <ville.skytta at iki.fi> - 1.0-1
+- Update to 1.0; fixes #637956, and #639823.
+- Sync Fedora license list with Wiki revision 1.85.
+- Whitelist more expectedly setuid executables; fixes #646455.
+
+* Thu Aug 19 2010 Ville Skyttä <ville.skytta at iki.fi> - 0.99-1
+- Update to 0.99; fixes #623607, helps work around #537430.
+- Sync Fedora license list with Wiki revision 1.80.
+
+* Wed Aug 11 2010 David Malcolm <dmalcolm at redhat.com> - 0.98-2
+- recompiling .py files against Python 2.7 (rhbz#623355)
+
 * Wed Jun 23 2010 Ville Skyttä <ville.skytta at iki.fi> - 0.98-1
 - Update to 0.98; fixes #599427 and #599516.
 - Filter out all lib*-java and lib*-python explicit-lib-dependency messages.


More information about the scm-commits mailing list