From 271acaafe0cc9728731b1cef23b691c488a635f8 Mon Sep 17 00:00:00 2001 From: "matth@ultra" Date: Sun, 1 Sep 2024 19:50:59 +0200 Subject: [PATCH] dont require slashes --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 81ae791..8db0bd1 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ # CONFIGURE at least ROOT_DIR and INSTALL_DIR +# All paths without trailing slashes # Absolute path to the directory containing all image directories as well as the staging directory -# MUST HAVE A TRAILING SLASH # eg: ROOT_DIR = /data/images # ROOT_DIR = # The URI at which the ROOT_DIR will be served -# MUST HAVE A TRAILING SLASH -ROOT_PATH = /images/ +ROOT_PATH = /images # Path of the directory containing all the files to be sorted, relative to ROOT_DIR # eg: STAGING_DIR = .sort @@ -46,16 +45,15 @@ install: $(INSTALL_FLS) imgsort2-nginx.conf imgsort2-php-fpm.conf $(INSTALL_DIR)/%.php: $(SRC_DIR)/%.php - sed 's|$$rootDir = .*|$$rootDir = "$(ROOT_DIR)";|; s|$$rootPath = .*|$$rootPath = "$(ROOT_PATH)"|; s|$$stagingDirName = .*|$$stagingDirName = "$(STAGING_DIR)";|' @< > $@ + sed 's|$$rootDir = .*|$$rootDir = "$(ROOT_DIR)/";|; s|$$rootPath = .*|$$rootPath = "$(ROOT_PATH)/"|; s|$$stagingDirName = .*|$$stagingDirName = "$(STAGING_DIR)/";|' $< > $@ chmod 0744 $@ $(INSTALL_DIR)/%: $(SRC_DIR)/% install -m 0744 $< $@ %.conf: $(SRC_DIR)/%.conf - sed 's|root = .*|$$root = $(INSTALL_DIR);|; s|location /images/|location $(ROOT_PATH)|; s|$$alias = .*|alias = $(ROOT_DIR);|' @< > $@ - chmod 0744 $@ - $(SED_COMMAND) $< > $@ + sed 's|root = .*|$$root = $(INSTALL_DIR);|; s|location /images/|location $(ROOT_PATH)/|; s|$$alias = .*|alias = $(ROOT_DIR);|' $< > $@ + chmod 0740 $@ clean: rm $(INSTALL_FLS)