From 2e5909e761f40e42684fbaa71f3b5bcb49500567 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 23 Oct 2021 12:52:42 -0400 Subject: move all files to EndoForge --- EndoForge/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 EndoForge/Makefile (limited to 'EndoForge/Makefile') diff --git a/EndoForge/Makefile b/EndoForge/Makefile new file mode 100644 index 0000000..2501da9 --- /dev/null +++ b/EndoForge/Makefile @@ -0,0 +1,40 @@ +ifeq ($(shell id -u),0) +SUDO = +else +SUDO = sudo +endif + +ROOT_INSTALL = $(SUDO) install + +USER != echo "$${SUDO_USER:-$$(id -un)}" + +SSH_CONFIG_DIR = /etc/ssh +SSHD_CONFIG_DIR = $(SSH_CONFIG_DIR)/sshd_config.d +SSH_LIB_DIR = /usr/lib/ssh +USER_SSH_CONFIG_DIR = ~$(USER)/.ssh + +BROWSER != 2>/dev/null which xdg-open || which w3m || which links || which elinks + +.PHONY: install shared doc test + +doc: README.html + $(BROWSER) $< + +shared: install + git config core.self-forge true + +SRC = src +SOURCES = $(addprefix $(SRC), AnonymousAccessCommand anonymous-access.conf AuthorizedKeysCommand) + +install: + install -t $(USER_SSH_CONFIG_DIR) $(SRC)/AnonymousAccessCommand + $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true + $(ROOT_INSTALL) -m0644 -t "$(SSHD_CONFIG_DIR)" $(SRC)/anonymous-access.conf || true + $(ROOT_INSTALL) -t "$(SSH_LIB_DIR)" $(SRC)/AuthorizedKeysCommand || true + [ -e "$(SSH_LIB_DIR)"/AuthorizedKeysCommand ] || $(SUDO) ln -s -t /etc/ssh "$(SSH_LIB_DIR)"/AuthorizedKeysCommand + +README.html: README.md + pandoc -t html $< > $@ + +test: + make -C test -- cgit v1.2.3