diff --git a/configure.ac b/configure.ac index bb6e05ba..73b6e830 100644 --- a/configure.ac +++ b/configure.ac @@ -333,14 +333,31 @@ OWNTONE_ARG_DISABLE([include default web interface], [webinterface], [WEBINTERFA [AS_IF([[test -f "$srcdir/web-src/htdocs/index.html"]], [AM_MISSING_PROG([NPM], [[npm]]) AC_MSG_NOTICE([[ -npm not found, but a prebuilt web interface seems to be present. -If you modify any web interface files, you will need to install it. +npm not found, but a prebuilt web interface is present. +If you modify any web interface source files, you will need to install npm. ]])], [AC_MSG_ERROR([[npm required, please install it.]])]) ] )]) AM_CONDITIONAL([COND_WEBINTERFACE], [[test "x$enable_webinterface" = "xyes"]]) +dnl Use prebuilt webinterface even if npm is available +AC_ARG_WITH([prebuilt-webinterface], + [AS_HELP_STRING([--with-prebuilt-webinterface], + [Use prebuilt webinterface even if npm is available (default=no)] + )], + [AS_IF([[test -f "$srcdir/web-src/htdocs/index.html"]], + [[with_prebuilt_webinterface=yes]], + [AC_MSG_ERROR([[No prebuilt web interface found.]])] + )], + [[with_prebuilt_webinterface=]]) +if test "x$with_prebuilt_webinterface" = "xyes"; then + BUILD_WEBINTERFACE= +else + BUILD_WEBINTERFACE=true +fi +AC_SUBST([BUILD_WEBINTERFACE]) + dnl Creating and defining users and groups OWNTONE_ARG_ENABLE([having 'make install' add user/group and 'make uninstall' delete], [install_user], [INSTALL_USER], [AC_PATH_PROG([GETENT], [[getent]], [], [$PATH$PATH_SEPARATOR/usr/sbin]) diff --git a/web-src/Makefile.am b/web-src/Makefile.am index dad58aa7..53ec5f9e 100644 --- a/web-src/Makefile.am +++ b/web-src/Makefile.am @@ -177,19 +177,19 @@ node_modules: $(PACKAGE_JSON) cp "$$src_path" "$$dest_path"; \ done; \ fi - $(if $(NPM),$(NPM) clean-install) + $(if $(BUILD_WEBINTERFACE),$(NPM) clean-install) # Build the Vue.js application htdocs: node_modules $(WEB_FILES) - $(if $(NPM),$(NPM) run build) + $(if $(BUILD_WEBINTERFACE),$(NPM) run build) web: htdocs web-serve: node_modules - $(if $(NPM),$(NPM) run serve) + $(if $(BUILD_WEBINTERFACE),$(NPM) run serve) web-update: - $(if $(NPM),$(NPM) update) + $(if $(BUILD_WEBINTERFACE),$(NPM) update) web-check: @echo "Verifying that all source files in 'src' and 'public' are listed in WEB_FILES ..." @@ -208,10 +208,10 @@ web-check: fi web-lint: node_modules - $(if $(NPM),$(NPM) run lint --no-fix) + $(if $(BUILD_WEBINTERFACE),$(NPM) run lint --no-fix) web-format: node_modules - $(if $(NPM),$(NPM) run format) + $(if $(BUILD_WEBINTERFACE),$(NPM) run format) all-local: htdocs