Skip to content

Commit

Permalink
SPEC: Fix build in mock
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Tomas Krizek <[email protected]>
  • Loading branch information
Lukas Slebodnik authored and Martin Babinsky committed Jan 18, 2017
1 parent 3f91469 commit b82d285
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions freeipa.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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

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

Expand Down

0 comments on commit b82d285

Please sign in to comment.