diff --git a/.gitignore b/.gitignore index 9539c437b..56b2cb084 100644 --- a/.gitignore +++ b/.gitignore @@ -18,9 +18,22 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -pcs-web-ui-node-modules-*.tar.xz +pcs-web-ui-* .npmrc .eslintcache +stamps* + +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +config.log +config.status +configure +configure~ +missing +install-sh + /.dev /.tmp diff --git a/Makefile b/Makefile.am similarity index 63% rename from Makefile rename to Makefile.am index 6906e3c0b..9ee718de2 100644 --- a/Makefile +++ b/Makefile.am @@ -1,14 +1,12 @@ -NEXUS="https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org" -PROJECT_DIR=$(shell pwd) -APP_MODULES_DIR=$(shell realpath ${PROJECT_DIR}/packages/app/node_modules) +AUTOMAKE_OPTIONS = foreign -ifndef NEXUS_REPO - NEXUS_REPO=true -endif +SUBDIRS = . -ifndef NEXUS_CERT_PATH - NEXUS_CERT_PATH="" -endif +NEXUS = "https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org" +PROJECT_DIR = $(shell pwd) +APP_MODULES_DIR = $(shell realpath ${PROJECT_DIR}/packages/app/node_modules) + +PCSD_WEBUI_DIR = @PCSD_WEBUI_DIR@ app: @./packages/app/.bin/check-assumptions.sh @@ -28,10 +26,10 @@ modules-pack: @ls -l ./*.tar.xz modules-prepare: - @cd ./packages/app && echo y | .bin/modules-prepare.sh ${APP_MODULES_DIR} + @cd ./packages/app && echo y | .bin/modules-prepare.sh ${APP_MODULES_DIR} modules-patch: - @cd ./packages/app && .bin/modules-patch.sh ${APP_MODULES_DIR} + @cd ./packages/app && .bin/modules-patch.sh ${APP_MODULES_DIR} dev: @cd ./packages/dev-backend && .bin/dev-backend.sh @@ -51,22 +49,19 @@ clean: rm pcs-web-ui-node-modules-*.tar.xz init_nexus: -ifeq ($(NEXUS_CERT_PATH),"") - echo "Specify path of nexus certificate, please" -else + @[ "${NEXUS_CERT_PATH}" ] || ( \ + echo "Specify path of nexus certificate via NEXUS_CERT_PATH parameter, please"; \ + exit 1 ) @.bin/init_nexus.sh ./packages ${NEXUS} ${NEXUS_CERT_PATH} -endif - - init: -ifeq ($(NEXUS_REPO),true) - @echo "Use \`make init NEXUS_REPO=false\` not to use the Nexus repo." - @.bin/init.sh ${NEXUS} -else - @echo "If you will need reinit with the Nexus repo run \`make init\`" - @.bin/init.sh -endif + @if [ "${NEXUS_REPO}" ] && [ "${NEXUS_REPO}" = "false" ]; then \ + echo "Use \`make init NEXUS_REPO=false\` not to use the Nexus repo."; \ + .bin/init.sh ${NEXUS}; \ + else \ + echo "If you will need reinit with the Nexus repo run \`make init\`" + .bin/init.sh + fi check_sources: @.bin/check-no-nexus.sh @@ -78,17 +73,13 @@ fmt: npx prettier "packages/app/src/" --write packages/app/node_modules/.bin/eslint --fix --ext .js,.ts,.tsx packages/app/src/ -_install: -ifndef PCSD_DIR - $(error PCSD_DIR has to be specified) -endif - @if test ! -d build; then echo "Run 'make build' first"; false; fi - mkdir -p $(PCSD_DIR)/public/ui - cp -r build/* $(PCSD_DIR)/public/ui - -install: build _install +install-exec-local: + mkdir -p $(PCSD_WEBUI_DIR)/ui + cp -r build/* $(PCSD_WEBUI_DIR) npm_install: @.bin/npm_install.sh ./packages +all: build + .PHONY: test build diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 000000000..29ca25763 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Copyright (C) 2020 Red Hat, Inc. All rights reserved. +# + +# Run this to generate all the initial makefiles, etc. +autoreconf -i -v && echo Now run ./configure and make diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..3b2600e26 --- /dev/null +++ b/configure.ac @@ -0,0 +1,44 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63]) +AC_INIT([pcs-web-ui], + [0.1.19], + [developers@clusterlabs.org]) + +# dist-bzip2 dist-xz - which archivers try to use for distribution archive +# -Wno-portability - disables some warnings about code portability +# tar-pax - use tar with pax during creating archive to ensure keep permissions +AM_INIT_AUTOMAKE([dist-bzip2 dist-xz -Wno-portability tar-pax]) + + +# Checks for programs. + +# check stolen from gnulib/m4/gnu-make.m4 +if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + AC_MSG_ERROR([you don't seem to have GNU make; it is required]) +fi +AC_PROG_INSTALL +AC_PROG_GREP +AC_PROG_SED +AC_PROG_MAKE_SET +AC_PROG_MKDIR_P + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + + +# this will catch both ID and ID_LIKE from os-release + +PKG_CHECK_VAR([PCSD_WEBUI_DIR], [pcs], [webui_dir]) +AC_SUBST([PCSD_WEBUI_DIR]) + + +AC_CONFIG_FILES([Makefile + ]) +AC_OUTPUT