Blob Blame History Raw
# -*- 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.68, 18 Feb 2010" of that page.
    'AAL',
    'Adobe',
    'ADSL',
    'AFL',
    'AGPLv1',
    'AGPLv3',
    'AGPLv3 with exceptions',
    'AMDPLPA',
    'AMPAS BSD',
    'ARL',
    'ASL 1.0',
    'ASL 1.0+',
    'ASL 1.1',
    'ASL 1.1+',
    'ASL 2.0',
    'ASL 2.0+',
    'APSL 2.0',
    'APSL 2.0+',
    'Artistic 2.0',
    'Artistic clarified',
    'Beerware',
    'BitTorrent',
    'Boost',
    'BSD',
    'BSD Protection',
    'BSD with advertising',
    'CATOSL',
    'CC0',
    'CeCILL',
    'CeCILL-B',
    'CeCILL-C',
    'CDDL',
    'CNRI',
    'CPAL',
    'CPL',
    'Condor',
    'Copyright only',
    'Crystal Stacker',
    'DOC',
    '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',
    'LBNL BSD',
    'LGPLv2',
    'LGPLv2 with exceptions',
    'LGPLv2+',
    'LGPLv2+ or Artistic',
    'LGPLv2+ with exceptions',
    'LGPLv3',
    'LGPLv3 with exceptions',
    'LGPLv3+',
    'LGPLv3+ with exceptions',
    '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',
    'NCSA',
    'NetCDF',
    'NGPL',
    'NOSL',
    'Naumen',
    'Netscape',
    'Newmat',
    'Nokia',
    'Noweb',
    'OpenLDAP',
    'OpenPBS',
    '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+',
    'OpenSSL',
    'OReilly',
    'Phorum',
    'PHP',
    'PlainTeX',
    'Plexus',
    'PostgreSQL',
    'psutils',
    'Public Domain',
    'Python',
    'Qhull',
    'QPL',
    'Rdisc',
    'RiceBSD',
    'RPSL',
    'Ruby',
    'Saxpath',
    'SCEA',
    'SCRIP',
    'Sendmail',
    'Sleepycat',
    'SISSL',
    'SLIB',
    'SNIA',
    'SPL',
    'TCL',
    'Teeworlds',
    'TMate',
    'TOSL',
    'TPL',
    'UCD',
    'VOSTROM',
    'Vim',
    'VNLSL',
    'VSL',
    'W3C',
    'Webmin',
    'WTFPL',
    'wxWidgets',
    'Xerox',
    'xinetd',
    'XSkat',
    'YPLv1.1',
    'Zend',
    'ZPLv1.0',
    'ZPLv1.0+',
    'ZPLv2.0',
    'ZPLv2.0+',
    'ZPLv2.1',
    'ZPLv2.1+',
    'zlib',
    'zlib with acknowledgement',
    # Documentation licenses
    'CDL',
    'FBSDDL',
    'GFDL',
    'IEEE',
    'OFSFDL',
    'Open Publication',
    'Public Use',
    # Content licenses
    'CC-BY',
    'CC-BY-SA',
    'CC-BY-ND',
    '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("invalid-(lc-messages|locale-man)-dir")
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)")
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.*")