From 5c8733ac6767d860b0b89d7e6ed7344538019e62 Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Fri, 2 Oct 2020 21:48:03 +0200 Subject: clean-spec: convert mandir and avoid using .xz --- mgagnome | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/mgagnome b/mgagnome index 321916a..eda42fb 100755 --- a/mgagnome +++ b/mgagnome @@ -751,6 +751,44 @@ class SpecFile(): ('use new Python macros', r'%py3_install', re.compile(r'^%{__python3} setup.py install$', re.MULTILINE)), ('use new Python macros', r'%{python3_version}', re.compile(r'%{py3ver}', re.MULTILINE)), + ( + 'make use of _mandir macro', + r'%{_mandir}\g', + # /usr/share/man/man1/test_whitespaces.1.xz + re.compile(r'^(?:%{_datadir}/man|%_datadir/man|/usr/share/man)(?P/man[0-9]+/' + r'[a-zA-Z0-9]+[-a-zA-Z0-9_./]+\.[0-9]+[.a-z]*(?:\n|$))', + re.MULTILINE) + ), + ( + 'make use of _infodir macro', + r'%{_infodir}\g', + # /usr/share/man/man1/test_whitespaces.1.xz + re.compile(r'^(?:%{_datadir}/info|%_datadir/info|/usr/share/info)(?P/' + r'[a-zA-Z0-9]+[-a-zA-Z0-9_./]+\.info[.a-z]*(?:\n|$))', + re.MULTILINE) + ), + ( + # %{_mandir}/man1/*.xz + # avoid adding a * + 'avoid assuming xz compression scheme', + r'\g\g', + re.compile(r'^(?P(?:%{_mandir}|%_mandir)/' + r'[a-zA-Z0-9]+[-@a-zA-Z0-9_./]+/\*)' + r'\.xz(?P\n|$)', + re.MULTILINE) + ), + ( + # %{_mandir}/man8/fxotune.8.xz + # need to add a * + 'avoid assuming xz compression scheme', + r'\g*\g', + re.compile(r'^(?P(?:%doc )?(?:%{_mandir}|%_mandir)/' + r'[a-zA-Z0-9]+[-*@+:a-zA-Z0-9_./]+[-a-zA-Z0-9_./]' + r'(?:/(?:%{name}|%name|%{shortname})\.[0-9a-z]+)?' + r')' + r'\.xz(?P\n|$)', + re.MULTILINE) + ), ] for reason, change_to, regexp in re_clean_spec: -- cgit v1.2.1