diff --git a/lector.spec b/lector.spec index 757b1b0..7616a2f 100644 --- a/lector.spec +++ b/lector.spec @@ -56,6 +56,17 @@ It supports the following file formats: %prep %autosetup -n Lector-%{version} +# These files contain a Python shebang, but seem to get installed by upstream's setup.py without an executability bit set, so there's a mismatch in whether it's supposed to be executable... +chmod -x ./lector/KindleUnpack/compatibility_utils.py +chmod -x ./lector/KindleUnpack/mobi_split.py +chmod -x ./lector/KindleUnpack/unipath.py +chmod -x ./lector/__main__.py +chmod -x ./lector/rarfile/dumprar.py +# Non-executable Python files don't need a shebang line. +find ./ -type f -iname "*.py" '!' -executable -exec sed --regexp-extended 's|^#! */usr/bin/env python[[:digit:]._-]*$||g' --in-place '{}' ';' +# For executable Python files, don't use env python. +find ./ -type f -iname "*.py" -executable -exec sed --regexp-extended 's|^#! */usr/bin/env python[[:digit:]._-]*$|#!%{__python3}|g' --in-place '{}' ';' + %build