diff --git a/Makefile.am b/Makefile.am index 0fca835ef..3cca93bc3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,6 +64,7 @@ TMPREPOS = tmp.repos RPMBUILD_ARGS := RPMBUILD_ARGS += --define="_topdir `pwd`/$(TMPREPOS)" RPMBUILD_ARGS += $(if $(RELEASE_SUFFIX), --define="release_suffix $$RELEASE_SUFFIX") +RPMBUILD_ARGS += $(if $(filter 0,$(OFFLINE_BUILD)), --without ovirt_use_nodejs_modules) srpm: dist-gzip rm -fr "$(TMPREPOS)" diff --git a/configure.ac b/configure.ac index a75a74423..29409f23f 100644 --- a/configure.ac +++ b/configure.ac @@ -38,9 +38,6 @@ dnl TODO: Fail if rpmbuild is not present PACKAGE_RPM_SUFFIX=${PACKAGE_RPM_SUFFIX:-"%{?release_suffix}"} AC_ARG_VAR([PACKAGE_RPM_SUFFIX], [suffix to use on the rpm's release string]) -OFFLINE_BUILD=${OFFLINE_BUILD:-1} -AC_ARG_VAR([OFFLINE_BUILD], [control if rpm builds will use an offline build via ovirt-engine-nodejs-modules (1) or should use an online build (0)]) - AC_CONFIG_FILES([ Makefile ovirt-web-ui.spec diff --git a/ovirt-web-ui.spec.in b/ovirt-web-ui.spec.in index e019dbb7b..e7082865f 100644 --- a/ovirt-web-ui.spec.in +++ b/ovirt-web-ui.spec.in @@ -2,7 +2,12 @@ %global product oVirt %global source_basename @PACKAGE_TARNAME@ %define debug_package %{nil} -%define offline_build @OFFLINE_BUILD@ + +# build condition `ovirt_use_nodejs_modules` +# - on by default, requires a build with `--without ovirt_use_nodejs_modules` to turn off +# - if on, the build uses `ovirt-engine-nodejs-modules` +# - if off, the build uses standard `yarn` accessing all node_modules packages directly +%bcond_without ovirt_use_nodejs_modules Name: ovirt-web-ui Version: @PACKAGE_RPM_VERSION@ @@ -23,7 +28,7 @@ BuildRequires: rpm-build # requirements for building the rpm from src.rpm BuildRequires: autoconf BuildRequires: automake -%if %{offline_build} +%if %{with ovirt_use_nodejs_modules} # nodejs-modules embeds yarn and requires nodejs BuildRequires: ovirt-engine-nodejs-modules >= 2.3.2 %else @@ -40,7 +45,7 @@ This package provides the VM Portal for %{product}. %build %configure export SKIP_AUTOGEN=1 -%if %{offline_build} +%if %{with ovirt_use_nodejs_modules} rpm -qa | grep ovirt-engine-nodejs source /usr/share/ovirt-engine-nodejs-modules/setup-env.sh %else