mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make pylint and jsl optional
./configure no longer fails when pylint or jsl are not available. The make targets for pylint and jsl are no longer defined without the tools. Rational: pylint and jsl are not required to build FreeIPA. Both are useful developer tools. It's more user friendly to make both components optionally with default config arguments. There is no reason to fail building on a build system without development tools. It's still possible to enforce dependency checks with --with-jslint and --enable-pylint. https://fedorahosted.org/freeipa/ticket/6604 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
parent
70889d4d5e
commit
f1f63506ca
14
Makefile.am
14
Makefile.am
@ -146,6 +146,10 @@ JSLINT_TARGET = jslint
|
|||||||
endif WITH_JSLINT
|
endif WITH_JSLINT
|
||||||
lint: acilint apilint $(POLINT_TARGET) $(PYLINT_TARGET) $(JSLINT_TARGET)
|
lint: acilint apilint $(POLINT_TARGET) $(PYLINT_TARGET) $(JSLINT_TARGET)
|
||||||
|
|
||||||
|
.PHONY: $(top_builddir)/ipapython/version.py
|
||||||
|
$(top_builddir)/ipapython/version.py:
|
||||||
|
(cd $(top_builddir)/ipapython && make version.py)
|
||||||
|
|
||||||
.PHONY: acilint
|
.PHONY: acilint
|
||||||
acilint: $(top_builddir)/ipapython/version.py
|
acilint: $(top_builddir)/ipapython/version.py
|
||||||
cd $(srcdir); ./makeaci --validate
|
cd $(srcdir); ./makeaci --validate
|
||||||
@ -162,10 +166,10 @@ polint:
|
|||||||
# folders rpmbuild, freeipa-* and dist. Skip (match, but don't print) .*,
|
# folders rpmbuild, freeipa-* and dist. Skip (match, but don't print) .*,
|
||||||
# *.in, *~. Finally print all python files, including scripts that do not
|
# *.in, *~. Finally print all python files, including scripts that do not
|
||||||
# have python extension.
|
# have python extension.
|
||||||
.PHONY: pylint $(top_builddir)/ipapython/version.py
|
|
||||||
$(top_builddir)/ipapython/version.py:
|
|
||||||
(cd $(top_builddir)/ipapython && make version.py)
|
|
||||||
|
|
||||||
|
.PHONY: pylint
|
||||||
|
|
||||||
|
if WITH_PYLINT
|
||||||
pylint: $(top_builddir)/ipapython/version.py ipasetup.py
|
pylint: $(top_builddir)/ipapython/version.py ipasetup.py
|
||||||
FILES=`find $(top_srcdir) \
|
FILES=`find $(top_srcdir) \
|
||||||
-type d -exec test -e '{}/__init__.py' \; -print -prune -o \
|
-type d -exec test -e '{}/__init__.py' \; -print -prune -o \
|
||||||
@ -183,9 +187,12 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py
|
|||||||
--rcfile=$(top_srcdir)/pylintrc \
|
--rcfile=$(top_srcdir)/pylintrc \
|
||||||
--load-plugins pylint_plugins \
|
--load-plugins pylint_plugins \
|
||||||
$${FILES}
|
$${FILES}
|
||||||
|
endif # WITH_PYLINT
|
||||||
|
|
||||||
.PHONY: jslint jslint-ui jslint-ui-test jslint-html \
|
.PHONY: jslint jslint-ui jslint-ui-test jslint-html \
|
||||||
$(top_builddir)/install/ui/src/libs/loader.js
|
$(top_builddir)/install/ui/src/libs/loader.js
|
||||||
|
|
||||||
|
if WITH_JSLINT
|
||||||
jslint: jslint-ui jslint-ui-test jslint-html
|
jslint: jslint-ui jslint-ui-test jslint-html
|
||||||
|
|
||||||
$(top_builddir)/install/ui/src/libs/loader.js:
|
$(top_builddir)/install/ui/src/libs/loader.js:
|
||||||
@ -208,6 +215,7 @@ jslint-ui-test:
|
|||||||
jslint-html:
|
jslint-html:
|
||||||
cd $(top_srcdir)/install/html; \
|
cd $(top_srcdir)/install/html; \
|
||||||
jsl -nologo -nosummary -nofilelisting -conf jsl.conf
|
jsl -nologo -nosummary -nofilelisting -conf jsl.conf
|
||||||
|
endif # WITH_JSLINT
|
||||||
|
|
||||||
.PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages
|
.PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages
|
||||||
WHEELDISTDIR = $(top_builddir)/dist/wheels
|
WHEELDISTDIR = $(top_builddir)/dist/wheels
|
||||||
|
47
configure.ac
47
configure.ac
@ -381,17 +381,25 @@ AC_SUBST([i18ntests])
|
|||||||
AM_CONDITIONAL([WITH_POLINT], [test "x${enable_i18ntests}" == "xyes"])
|
AM_CONDITIONAL([WITH_POLINT], [test "x${enable_i18ntests}" == "xyes"])
|
||||||
|
|
||||||
AC_ARG_ENABLE([pylint],
|
AC_ARG_ENABLE([pylint],
|
||||||
AS_HELP_STRING([--disable-pylint],
|
AS_HELP_STRING([--enable-pylint],
|
||||||
[skip Pylint in make lint target]),
|
[Require pylint. Default is autodetection with
|
||||||
|
"python -m pylint".]),
|
||||||
[PYLINT=$enableval],
|
[PYLINT=$enableval],
|
||||||
[PYLINT=yes]
|
[PYLINT=check]
|
||||||
)
|
)
|
||||||
|
|
||||||
if test x$PYLINT != xno; then
|
if test x$PYLINT != xno; then
|
||||||
AC_MSG_CHECKING([for Pylint])
|
AC_MSG_CHECKING([for Pylint])
|
||||||
$PYTHON -m pylint --version > /dev/null
|
$PYTHON -m pylint --version >/dev/null 2>&1
|
||||||
if test "$?" != "0"; then
|
if test "$?" != "0"; then
|
||||||
AC_MSG_ERROR([cannot find pylint for $PYTHON])
|
if test x$PYLINT = xcheck; then
|
||||||
|
PYLINT=no
|
||||||
|
AC_MSG_NOTICE([cannot find optional pylint for $PYTHON])
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([cannot find pylint for $PYTHON])
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
PYLINT=yes
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -403,13 +411,27 @@ AC_ARG_WITH([jslint],
|
|||||||
AS_HELP_STRING([--with-jslint=[FILE]],
|
AS_HELP_STRING([--with-jslint=[FILE]],
|
||||||
[path to JavaScript linter. Default is autodetection of
|
[path to JavaScript linter. Default is autodetection of
|
||||||
utility "jsl" ]),
|
utility "jsl" ]),
|
||||||
dnl --without-jslint will set JSLINT=no
|
[JSLINT="$withval"],
|
||||||
[JSLINT=$with_jslint],
|
[JSLINT=check]
|
||||||
[AC_PATH_PROG([JSLINT], [jsl])]
|
)
|
||||||
|
|
||||||
|
AS_CASE([$JSLINT],
|
||||||
|
[yes], [AC_PATH_PROG([JSLINT], [jsl], [missing])
|
||||||
|
if test $JSLINT = missing; then
|
||||||
|
AC_MSG_FAILURE([jsl is missing])
|
||||||
|
fi],
|
||||||
|
[no], [],
|
||||||
|
[check], [AC_PATH_PROG([JSLINT], [jsl], [no])],
|
||||||
|
dnl user setting
|
||||||
|
[if ! test -f "$JSLINT"; then
|
||||||
|
AC_MSG_RESULT([$JSLINT non-existing])
|
||||||
|
AC_MSG_FAILURE([invalid value $JSLINT for jsl])
|
||||||
|
fi
|
||||||
|
if ! test -x "$JSLINT"; then
|
||||||
|
AC_MSG_RESULT([$JSLINT non-executable])
|
||||||
|
AC_MSG_FAILURE([invalid value $JSLINT for jsl])
|
||||||
|
fi]
|
||||||
)
|
)
|
||||||
if test "x${JSLINT}" == "x"; then
|
|
||||||
AC_MSG_ERROR([cannot find JS lint])
|
|
||||||
fi
|
|
||||||
AC_SUBST([JSLINT])
|
AC_SUBST([JSLINT])
|
||||||
AM_CONDITIONAL([WITH_JSLINT], [test "x${JSLINT}" != "xno"])
|
AM_CONDITIONAL([WITH_JSLINT], [test "x${JSLINT}" != "xno"])
|
||||||
|
|
||||||
@ -522,6 +544,9 @@ echo "
|
|||||||
source code location: ${srcdir}
|
source code location: ${srcdir}
|
||||||
compiler: ${CC}
|
compiler: ${CC}
|
||||||
cflags: ${CFLAGS}
|
cflags: ${CFLAGS}
|
||||||
|
Python: ${PYTHON}
|
||||||
|
pylint: ${PYLINT}
|
||||||
|
jslint: ${JSLINT}
|
||||||
LDAP libs: ${LDAP_LIBS}
|
LDAP libs: ${LDAP_LIBS}
|
||||||
OpenSSL crypto libs: ${CRYPTO_LIBS}
|
OpenSSL crypto libs: ${CRYPTO_LIBS}
|
||||||
KRB5 libs: ${KRB5_LIBS}"
|
KRB5 libs: ${KRB5_LIBS}"
|
||||||
|
@ -11,10 +11,9 @@
|
|||||||
# lint is not executed during rpmbuild
|
# lint is not executed during rpmbuild
|
||||||
# %%global with_lint 1
|
# %%global with_lint 1
|
||||||
%if 0%{?with_lint}
|
%if 0%{?with_lint}
|
||||||
%global enable_pylint_option --enable-pylint
|
%global linter_options --enable-pylint --with-jslint
|
||||||
%else
|
%else
|
||||||
%global enable_pylint_option --disable-pylint
|
%global linter_options --disable-pylint --without-jslint
|
||||||
%global without_jslint_option --without-jslint
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Python wheel support and PyPI packages
|
# Python wheel support and PyPI packages
|
||||||
@ -807,8 +806,7 @@ find \
|
|||||||
-type f -exec grep -qsm1 '^#!.*\bpython' {} \; \
|
-type f -exec grep -qsm1 '^#!.*\bpython' {} \; \
|
||||||
-exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \;
|
-exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \;
|
||||||
%configure --with-vendor-suffix=-%{release} \
|
%configure --with-vendor-suffix=-%{release} \
|
||||||
%{enable_pylint_option} \
|
%{linter_options}
|
||||||
%{?without_jslint_option}
|
|
||||||
|
|
||||||
# -Onone is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1398405
|
# -Onone is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1398405
|
||||||
%make_build -Onone
|
%make_build -Onone
|
||||||
@ -825,8 +823,7 @@ find \
|
|||||||
-type f -exec grep -qsm1 '^#!.*\bpython' {} \; \
|
-type f -exec grep -qsm1 '^#!.*\bpython' {} \; \
|
||||||
-exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' {} \;
|
-exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python3}|' {} \;
|
||||||
%configure --with-vendor-suffix=-%{release} \
|
%configure --with-vendor-suffix=-%{release} \
|
||||||
%{enable_pylint_option} \
|
%{linter_options}
|
||||||
%{?without_jslint_option}
|
|
||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user