URL: https://github.com/freeipa/freeipa/pull/389 Author: lslebodn Title: #389: Fix build in mock Action: synchronized
To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/389/head:pr389 git checkout pr389
From 496c47a4549b327f28d8cd6466af3a520dc0797d Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik <lsleb...@redhat.com> Date: Wed, 11 Jan 2017 17:08:30 +0100 Subject: [PATCH 1/3] CONFIGURE: Fix detection of pylint If configure script was executed with --enable-pylint then it behaved the same as --disable-pylint. It does not make any sense. Resolves: https://fedorahosted.org/freeipa/ticket/6604 --- configure.ac | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index e8a4701..c84c1bc 100644 --- a/configure.ac +++ b/configure.ac @@ -446,16 +446,18 @@ AM_CONDITIONAL([WITH_POLINT], [test "x${enable_i18ntests}" == "xyes"]) AC_ARG_ENABLE([pylint], AS_HELP_STRING([--disable-pylint], [skip Pylint in make lint target]), - [PYLINT=no], - [PYLINT=yes - AC_MSG_CHECKING([for Pylint]) - $PYTHON -m pylint --version > /dev/null - if test "$?" != "0"; then - AC_MSG_ERROR([cannot find pylint for $PYTHON]) - fi - AC_MSG_RESULT([yes]) - ] + [PYLINT=$enableval], + [PYLINT=yes] ) +if test x$PYLINT != xno; then + AC_MSG_CHECKING([for Pylint]) + $PYTHON -m pylint --version > /dev/null + if test "$?" != "0"; then + AC_MSG_ERROR([cannot find pylint for $PYTHON]) + else + AC_MSG_RESULT([yes]) + fi +fi AC_SUBST([PYLINT]) AM_CONDITIONAL([WITH_PYLINT], [test "x${PYLINT}" != "xno"]) From 1a4cbc1528b248ea6060e32f0f741ebd09b82e07 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik <lsleb...@redhat.com> Date: Wed, 11 Jan 2017 18:14:49 +0100 Subject: [PATCH 2/3] CONFIGURE: Update help message for jslint Resolves: https://fedorahosted.org/freeipa/ticket/6604 --- configure.ac | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c84c1bc..6cd3a89 100644 --- a/configure.ac +++ b/configure.ac @@ -463,11 +463,12 @@ AM_CONDITIONAL([WITH_PYLINT], [test "x${PYLINT}" != "xno"]) AC_ARG_WITH([jslint], - AS_HELP_STRING([--with-jslint=path to jsl], - [path to JavaScript lint]), + AS_HELP_STRING([--with-jslint=[FILE]], + [path to JavaScript linter. Default is autodetection of + utility "jsl" ]), dnl --without-jslint will set JSLINT=no - [JSLINT=$with_jslint], - [AC_PATH_PROG([JSLINT], [jsl])] + [JSLINT=$with_jslint], + [AC_PATH_PROG([JSLINT], [jsl])] ) if test "x${JSLINT}" == "x"; then AC_MSG_ERROR([cannot find JS lint]) From eda6c2a147cb5c1927cefee7aa69b6b5a761ba83 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik <lsleb...@redhat.com> Date: Wed, 11 Jan 2017 15:02:09 +0100 Subject: [PATCH 3/3] 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 --- freeipa.spec.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code