rpmlint/rpmlint.config

396 lines
9.0 KiB
Plaintext
Raw Normal View History

# -*- 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",
))
2007-07-31 20:54:22 +00:00
setOption("DanglingSymlinkExceptions", (
['consolehelper$', 'usermode'],
['consolehelper-gtk$', 'usermode-gtk'],
))
2007-07-31 20:54:22 +00:00
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 "2.03, 13 August 2012" of that page.
'AAL',
'Abstyles',
'Adobe',
'ADSL',
2007-08-05 13:35:20 +00:00
'AFL',
'AGPLv1',
'AGPLv3',
'AGPLv3 with exceptions',
'AMDPLPA',
'AML',
'AMPAS BSD',
'APSL 2.0',
'APSL 2.0+',
'ARL',
'Artistic 2.0',
'Artistic clarified',
2007-07-31 20:54:22 +00:00
'ASL 1.0',
'ASL 1.0+',
'ASL 1.1',
'ASL 1.1+',
'ASL 2.0',
'ASL 2.0+',
'Bahyph',
'Barr',
2011-10-12 18:51:03 +00:00
'Beerware',
'BeOpen',
'Bibtex',
2007-08-05 13:35:20 +00:00
'BitTorrent',
2007-07-31 20:54:22 +00:00
'Boost',
2011-10-12 18:51:03 +00:00
'Borceux',
2007-07-31 20:54:22 +00:00
'BSD',
'BSD Protection',
2007-08-05 13:35:20 +00:00
'BSD with advertising',
2011-10-12 18:51:03 +00:00
'BSD with attribution',
'CATOSL',
'CC0',
2007-07-31 20:54:22 +00:00
'CeCILL',
2008-09-12 17:00:21 +00:00
'CeCILL-B',
'CeCILL-C',
2007-07-31 20:54:22 +00:00
'CDDL',
2008-09-12 17:00:21 +00:00
'CNRI',
2007-07-31 20:54:22 +00:00
'Condor',
'Copyright only',
'CPAL',
'CPL',
'Crossword',
2007-08-05 13:35:20 +00:00
'Crystal Stacker',
'diffmark',
'DOC',
'Dotseqn',
2011-10-12 18:51:03 +00:00
'DSDP',
'dvipdfm',
'ECL 1.0',
'ECL 2.0',
2007-07-31 20:54:22 +00:00
'eCos',
'EFL 2.0',
'EFL 2.0+',
2011-10-12 18:51:03 +00:00
'eGenix',
'Entessa',
'EPL',
'ERPL',
2007-07-31 20:54:22 +00:00
'EU Datagrid',
'EUPL 1.1',
'Eurosym',
'Fair',
'FTL',
2007-08-05 13:35:20 +00:00
'Giftware',
'GL2PS',
2007-08-05 13:35:20 +00:00
'Glide',
2011-10-12 18:51:03 +00:00
'Glulxe',
'gnuplot',
2007-07-31 20:54:22 +00:00
'GPL+',
2007-08-05 13:35:20 +00:00
'GPL+ or Artistic',
'GPL+ with exceptions',
'GPLv1',
2008-09-12 17:00:21 +00:00
'GPLv2 or Artistic',
'GPLv2+ or Artistic',
2007-07-31 20:54:22 +00:00
'GPLv2',
2007-08-05 13:35:20 +00:00
'GPLv2 with exceptions',
2007-07-31 20:54:22 +00:00
'GPLv2+',
'GPLv2+ with exceptions',
2007-07-31 20:54:22 +00:00
'GPLv3',
'GPLv3 with exceptions',
2007-07-31 20:54:22 +00:00
'GPLv3+',
'GPLv3+ with exceptions',
'HaskellReport',
2007-07-31 20:54:22 +00:00
'IBM',
2007-08-05 13:35:20 +00:00
'IJG',
'ImageMagick',
2007-07-31 20:54:22 +00:00
'iMatix',
'Imlib2',
2007-07-31 20:54:22 +00:00
'Intel ACPI',
'Interbase',
2007-08-05 13:35:20 +00:00
'ISC',
2007-07-31 20:54:22 +00:00
'Jabber',
'JasPer',
'JPython',
'Julius',
'Knuth',
'Latex2e',
'LBNL BSD',
'Leptonica',
2007-07-31 20:54:22 +00:00
'LGPLv2',
'LGPLv2 with exceptions',
'LGPLv2+',
2008-09-12 17:00:21 +00:00
'LGPLv2+ or Artistic',
'LGPLv2+ with exceptions',
2007-07-31 20:54:22 +00:00
'LGPLv3',
'LGPLv3 with exceptions',
2007-07-31 20:54:22 +00:00
'LGPLv3+',
'LGPLv3+ with exceptions',
'Lhcyr',
2007-08-05 13:35:20 +00:00
'libtiff',
'LLGPL',
'Logica',
2007-07-31 20:54:22 +00:00
'LPL',
'LPPL',
'MakeIndex',
2007-07-31 20:54:22 +00:00
'mecab-ipadic',
'midnight',
'MirOS',
2007-07-31 20:54:22 +00:00
'MIT',
'MIT with advertising',
'mod_macro',
'Motosoto',
2007-07-31 20:54:22 +00:00
'MPLv1.0',
'MPLv1.0+',
'MPLv1.1',
'MPLv1.1+',
'MPLv2.0',
'MS-PL',
'MS-RL',
'Naumen',
2007-07-31 20:54:22 +00:00
'NCSA',
'NetCDF',
2007-07-31 20:54:22 +00:00
'Netscape',
'Newmat',
'Newsletr',
'NGPL',
'NLPL',
2007-07-31 20:54:22 +00:00
'Nokia',
'NOSL',
'Noweb',
'OML',
2007-07-31 20:54:22 +00:00
'OpenLDAP',
'OpenPBS',
'OpenSSL',
'OReilly',
2007-07-31 20:54:22 +00:00
'OSL 1.0',
'OSL 1.0+',
'OSL 1.1',
'OSL 1.1+',
2007-08-05 13:35:20 +00:00
'OSL 2.0',
'OSL 2.0+',
'OSL 2.1',
'OSL 2.1+',
2007-08-05 13:35:20 +00:00
'OSL 3.0',
'OSL 3.0+',
'Par',
2007-07-31 20:54:22 +00:00
'Phorum',
'PHP',
'PlainTeX',
'Plexus',
'PostgreSQL',
'psfrag',
2008-09-12 17:00:21 +00:00
'psutils',
2007-07-31 20:54:22 +00:00
'Public Domain',
'Python',
'Qhull',
2007-07-31 20:54:22 +00:00
'QPL',
'Rdisc',
'RiceBSD',
'Romio',
2007-07-31 20:54:22 +00:00
'RPSL',
'Rsfs',
2007-07-31 20:54:22 +00:00
'Ruby',
'Saxpath',
'SCEA',
'SCRIP',
'Sendmail',
2007-07-31 20:54:22 +00:00
'Sleepycat',
'SISSL',
'SLIB',
'SNIA',
2007-07-31 20:54:22 +00:00
'SPL',
'TCL',
2008-09-12 17:00:21 +00:00
'Teeworlds',
'Threeparttable',
2008-09-12 17:00:21 +00:00
'TMate',
2011-10-12 18:51:03 +00:00
'TORQUEv1.1',
'TOSL',
'TPL',
'UCD',
2007-07-31 20:54:22 +00:00
'Vim',
'VNLSL',
'VOSTROM',
2007-07-31 20:54:22 +00:00
'VSL',
'W3C',
'Webmin',
'Wsuipa',
'WTFPL',
'wxWidgets',
'Xerox',
2007-07-31 20:54:22 +00:00
'xinetd',
'xpp',
'XSkat',
'YPLv1.1',
'Zed',
2007-07-31 20:54:22 +00:00
'Zend',
'zlib',
'zlib with acknowledgement',
2007-07-31 20:54:22 +00:00
'ZPLv1.0',
'ZPLv1.0+',
'ZPLv2.0',
'ZPLv2.0+',
'ZPLv2.1',
'ZPLv2.1+',
2007-07-31 20:54:22 +00:00
# Documentation licenses
'CDL',
'FBSDDL',
'GFDL',
'IEEE',
'LDPL',
'OFSFDL',
2007-07-31 20:54:22 +00:00
'Open Publication',
'Public Use',
2007-07-31 20:54:22 +00:00
# Content licenses
'CC-BY',
'CC-BY-ND',
'CC-BY-SA',
'DMTF',
2007-07-31 20:54:22 +00:00
'DSL',
'EFML',
2007-07-31 20:54:22 +00:00
'Free Art',
2008-09-12 17:00:21 +00:00
'GeoGratis',
'Green OpenMusic',
'OAL',
# Font licenses
'AMS',
2007-07-31 20:54:22 +00:00
'Arphic',
'Baekmuk',
'Bitstream Vera',
'DoubleStroke',
2008-09-12 17:00:21 +00:00
'Hershey',
'IPA',
'Liberation',
'Lucida',
'MgOpen',
'mplus',
'OFL',
'PTFL',
'STIX',
'Utopia',
'Wadalab',
'XANO',
2007-07-31 20:54:22 +00:00
# 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$")
2007-07-31 20:54:22 +00:00
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.*")
# 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")
# Only EL4 needs the files-attr-not-set check, because rpm 4.4 and newer no longer need a %defattr line
# (it automatically provides one).
addFilter("files-attr-not-set")
# Don't bother with the non-ghost-in-var-(lock|run) checks on Fedora 15 or newer
# since they have tmpfs /var/lock and /var/run.
addFilter("non-ghost-in-var-lock")
addFilter("non-ghost-in-var-run")
# Someone thought it was a good idea to make .desktop files executable. They were wrong.
# Nevertheless, I do not yet control the universe, so we squelch the error here.
addFilter("script-without-shebang .*\.desktop$")
# 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))