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 <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
Lukas Slebodnik 2017-01-11 15:02:09 +01:00 committed by Martin Babinsky
parent 3f91469f32
commit b82d285a4a

View File

@ -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