From b82d285a4a75e11cc9291ecca12d2fcc26f43ed1 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Jan 18 2017 08:05:56 +0000 Subject: SPEC: Fix build in mock Neither pylint nor jsl is installed by default because rpm macro with_lint is not defined in spec file. However, configure script tried to find pylint/jsl anyway. checking for Pylint... /usr/bin/python2: No module named pylint configure: error: cannot find pylint for /usr/bin/python2 RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.2GAFh4 (%build) Bad exit status from /var/tmp/rpm-tmp.2GAFh4 (%build) Resolves: https://fedorahosted.org/freeipa/ticket/6604 Reviewed-By: Christian Heimes Reviewed-By: Tomas Krizek --- diff --git a/freeipa.spec.in b/freeipa.spec.in index c4420a0..99820d1 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -10,6 +10,12 @@ # lint is not executed during rpmbuild # %%global with_lint 1 +%if 0%{?with_lint} + %global enable_pylint_option --enable-pylint +%else + %global enable_pylint_option --disable-pylint + %global without_jslint_option --without-jslint +%endif %global alt_name ipa %if 0%{?rhel} @@ -778,7 +784,10 @@ find \ ! -name '*.pyo' -a \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; -%configure --with-vendor-suffix=-%{release} +%configure --with-vendor-suffix=-%{release} \ + %{enable_pylint_option} \ + %{?without_jslint_option} + # -Onone is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1398405 %make_build -Onone @@ -793,7 +802,9 @@ find \ ! -name '*.pyo' -a \ -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' {} \; -%configure --with-vendor-suffix=-%{release} +%configure --with-vendor-suffix=-%{release} \ + %{enable_pylint_option} \ + %{?without_jslint_option} popd %endif # with_python3