diff --git a/autospec/config.py b/autospec/config.py index b3a55899..a10ce899 100644 --- a/autospec/config.py +++ b/autospec/config.py @@ -181,7 +181,8 @@ def __init__(self, download_path): "nodebug": "do not generate debuginfo for this package", "openmpi": "configure build also for openmpi", "server": "Package is only used by servers", - "no_glob": "Do not use the replacement pattern for file matching" + "no_glob": "Do not use the replacement pattern for file matching", + "allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged", } # simple_pattern_pkgconfig patterns # contains patterns for parsing build.log for missing dependencies diff --git a/autospec/files.py b/autospec/files.py index 988bfb9b..ef5d6bd3 100644 --- a/autospec/files.py +++ b/autospec/files.py @@ -272,6 +272,16 @@ def push_file(self, filename, pkg_name): if self.want_dev_split and self.file_pat_match(filename, r"^/usr/.*/include/.*\.h$", "dev"): return + # Exclude Windows executables and DLLs unless otherwise configured + # Can't just skip them because they could be swept up in a python lib wildcard, for example + if re.search(r"[^/]+\.(exe|dll)$", filename): + if self.config.config_opts.get('allow_exe'): + util.print_warning("Allowing {} because allow_exe is true".format(filename)) + else: + util.print_warning("Blocking {} because allow_exe is false".format(filename)) + self.excludes.append(filename) + return + # if configured to do so, add .so files to the lib package instead of # the dev package. THis is useful for packages with a plugin # architecture like elfutils and mesa.