Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport][ipa-4-9] configure: Make rpmlint optional #5676

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions Makefile.am
Expand Up @@ -194,7 +194,10 @@ endif WITH_PYLINT
if WITH_JSLINT
JSLINT_TARGET = jslint
endif WITH_JSLINT
lint: acilint apilint $(POLINT_TARGET) $(PYLINT_TARGET) $(JSLINT_TARGET) rpmlint yamllint
if WITH_RPMLINT
RPMLINT_TARGET = rpmlint
endif # WITH_RPMLINT
lint: acilint apilint $(POLINT_TARGET) $(PYLINT_TARGET) $(JSLINT_TARGET) $(RPMLINT_TARGET) yamllint

.PHONY: devcheck
devcheck: all
Expand All @@ -210,12 +213,12 @@ endif
@ # just tests, aci, api and pylint on Python 3
PATH=$(abspath ipatests):$$PATH PYTHONPATH=$(abspath $(top_srcdir)) \
$(PYTHON) ipatests/ipa-run-tests --ipaclient-unittests
$(MAKE) $(AM_MAKEFLAGS) acilint apilint polint pylint jslint rpmlint yamllint check
$(MAKE) $(AM_MAKEFLAGS) acilint apilint polint pylint jslint $(RPMLINT_TARGET) yamllint check
@echo "All tests passed."

.PHONY: fastcheck fasttest fastlint
fastcheck:
@$(MAKE) -j1 $(AM_MAKEFLAGS) fastlint rpmlint yamllint fasttest apilint acilint
@$(MAKE) -j1 $(AM_MAKEFLAGS) fastlint $(RPMLINT_TARGET) yamllint fasttest apilint acilint

fasttest: $(GENERATED_PYTHON_FILES) ipasetup.py
@ # --ignore doubles speed of total test run compared to pytest.skip()
Expand Down Expand Up @@ -297,8 +300,10 @@ polint:
validate-src-strings validate-po test-gettext

.PHONY: rpmlint
if WITH_RPMLINT
rpmlint: freeipa.spec
rpmlint ./$<
@RPMLINT@ ./$<
endif # WITH_RPMLINT

# Try to load yml/yaml files via safe_load, which recognizes only standard
# YAML tags and cannot construct an arbitrary Python object.
Expand Down
18 changes: 18 additions & 0 deletions configure.ac
Expand Up @@ -574,6 +574,23 @@ AS_CASE([$JSLINT],
AC_SUBST([JSLINT])
AM_CONDITIONAL([WITH_JSLINT], [test "x${JSLINT}" != "xno"])


AC_ARG_ENABLE(
[rpmlint],
[AC_HELP_STRING([--enable-rpmlint], [Enable rpmlint for the rpm spec])],
[case "${enableval}" in
yes) ENABLE_RPMLINT=yes ;;
no) ENABLE_RPMLINT=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-rpmlint]) ;;
esac],
[ENABLE_RPMLINT=no])
AS_IF([test "x$ENABLE_RPMLINT" = "xyes"],
[AC_PATH_PROG([RPMLINT], [rpmlint])
AS_IF([test "x$RPMLINT" = "x"],
[AC_MSG_ERROR([Could not find rpmlint])])],
)
AM_CONDITIONAL([WITH_RPMLINT], [test "x$ENABLE_RPMLINT" = "xyes"])

AM_CONDITIONAL([HAVE_UNSHARE],
[test "x${ac_cv_func_unshare}" = "xyes" -a "x${ac_cv_func_chroot}" = "xyes"])

Expand Down Expand Up @@ -687,6 +704,7 @@ echo "
Python: ${PYTHON} (${PYTHON_VERSION})
pylint: ${PYLINT}
jslint: ${JSLINT}
rpmlint: ${ENABLE_RPMLINT}
LDAP libs: ${LDAP_LIBS}
OpenSSL crypto libs: ${CRYPTO_LIBS}
KRB5 libs: ${KRB5_LIBS}
Expand Down
4 changes: 2 additions & 2 deletions freeipa.spec.in
Expand Up @@ -49,9 +49,9 @@
# lint is not executed during rpmbuild
# %%global with_lint 1
%if %{with lint}
%global linter_options --enable-pylint --with-jslint
%global linter_options --enable-pylint --with-jslint --enable-rpmlint
%else
%global linter_options --disable-pylint --without-jslint
%global linter_options --disable-pylint --without-jslint --disable-rpmlint
%endif

# Include SELinux subpackage
Expand Down
18 changes: 3 additions & 15 deletions ipatests/azure/azure-pipelines.yml
Expand Up @@ -19,11 +19,7 @@ jobs:
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- script: |
set -e
git update-ref refs/heads/$(System.PullRequest.TargetBranch) origin/$(System.PullRequest.TargetBranch)
Expand Down Expand Up @@ -70,11 +66,7 @@ jobs:
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- script: |
set -e
echo "Running make target 'lint'"
Expand Down Expand Up @@ -119,11 +111,7 @@ jobs:
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.PREPARE_WEBUI_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- script: |
set -e
echo "Running WebUI unit tests"
Expand Down
12 changes: 12 additions & 0 deletions ipatests/azure/templates/autoconf-fedora.yml
@@ -0,0 +1,12 @@
parameters:
options: ''

steps:
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh \
${{ parameters.options }} \
--enable-rpmlint \

displayName: Configure the project
3 changes: 3 additions & 0 deletions ipatests/azure/templates/variables-fedora.yml
Expand Up @@ -6,6 +6,9 @@ variables:
# the Dockerfile to build Docker image for running IPA tests
DOCKER_DOCKERFILE: ${{ format('Dockerfile.build.{0}', variables.IPA_PLATFORM) }}

# the template to autoconf the project
AUTOCONF_TEMPLATE: ${{ format('autoconf-{0}.yml', variables.IPA_PLATFORM) }}

# the template to install IPA's buildtime dependencies
PREPARE_BUILD_TEMPLATE: ${{ format('prepare-build-{0}.yml', variables.IPA_PLATFORM) }}

Expand Down
3 changes: 3 additions & 0 deletions ipatests/azure/templates/variables-rawhide.yml
Expand Up @@ -9,6 +9,9 @@ variables:
# the Dockerfile to build Docker image for running IPA tests
DOCKER_DOCKERFILE: 'Dockerfile.build.rawhide'

# the template to autoconf the project
AUTOCONF_TEMPLATE: ${{ format('autoconf-{0}.yml', variables.IPA_PLATFORM) }}

# the template to install IPA's buildtime dependencies
PREPARE_BUILD_TEMPLATE: ${{ format('prepare-build-{0}.yml', variables.IPA_PLATFORM) }}

Expand Down