SHA256
1
0
forked from pool/rpmlint
rpmlint/suse-pkg-config-check.diff
OBS User autobuild 4d4e6f73c7 Accepting request 50483 from Base:System
Copy from Base:System/rpmlint based on submit request 50483 from user prusnak

OBS-URL: https://build.opensuse.org/request/show/50483
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=68
2010-10-14 12:32:03 +00:00

53 lines
2.3 KiB
Diff

--- TagsCheck.py
+++ TagsCheck.py
@@ -414,6 +414,7 @@
invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
leading_space_regex = re.compile('^\s+')
+pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/')
license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s')
invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp
@@ -623,10 +624,12 @@
base = is_devel.group(1)
dep = None
has_so = False
+ has_pc = False
for fname in pkg.files():
if fname.endswith('.so'):
has_so = True
- break
+ if pkg_config_regex.match(fname) and fname.endswith('.pc'):
+ has_pc = True
if has_so:
base_or_libs = base + '/' + base + '-libs/lib' + base
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
@@ -663,6 +666,15 @@
if prov not in (x[0] for x in pkg.provides()):
printWarning(pkg, 'no-provides', prov)
+ if has_pc:
+ found_pkg_config_dep = False
+ for p in (x[0] for x in pkg.provides()):
+ if (p.startswith("pkgconfig(")):
+ found_pkg_config_dep = True
+ break
+ if not found_pkg_config_dep:
+ printWarning(pkg, 'no-pkg-config-provides')
+
# List of words to ignore in spell check
ignored_words = set()
for pf in pkg.files():
@@ -1082,6 +1094,11 @@
'no-url-tag',
'''The URL tag is missing.''',
+'no-pkg-config-provides',
+'''The package installes a .pc file but does not provide pkgconfig(..) provides.
+The most likely reason for that is that it was built without BuildRequires: pkg-config.
+Please double check your build dependencies.''',
+
'name-repeated-in-summary',
'''The name of the package is repeated in its summary. This is often redundant
information and looks silly in various programs' output. Make the summary