URL: https://github.com/freeipa/freeipa/pull/389
Author: lslebodn
 Title: #389: Fix build in mock
Action: opened

PR body:
"""

"""

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 b847c8f98655d6b6099b47052aa89c279929bf29 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/2] BUILD: 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.
---
 configure.ac | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index e8a4701..c706018 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=no]
 )
+if test x$PYLINT != no; 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 19a0a3b8c5e4855d047d098262c1a44a76ea5ebf Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Wed, 11 Jan 2017 15:02:09 +0100
Subject: [PATCH 2/2] 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)
---
 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

Reply via email to