From 9d7d03f5c589f5e8c97537ac90db1f2edfaab8de Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 2 Sep 2014 21:14:44 -0700 Subject: [PATCH] Makefile: pass bindir= when making gitweb Use the directory (dirname) of $Girocco::Config::git_bin to set the bindir make variable when making gitweb so that it's value for GIT_BINDIR is constant no matter what user invokes make. --- Makefile | 7 ++++++- install.sh | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 95c27e2..bb139f5 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,13 @@ all:: # This should be fatal in non-GNU make export MAKE +bindir:=$(shell . ./shlib.sh && test -n "$$cfg_git_bin" && echo $$(dirname "$$cfg_git_bin")) +ifeq ($(bindir),) + $(error $$Girocco::Config::git_bin is not set) +endif + all:: apache.conf - @"$(MAKE)" -C git.git --quiet gitweb + @"$(MAKE)" -C git.git --quiet bindir="$(bindir)" gitweb @"$(MAKE)" -C src --quiet install:: all diff --git a/install.sh b/install.sh index cb5e16c..c93fdcc 100755 --- a/install.sh +++ b/install.sh @@ -81,6 +81,10 @@ case "$git_version" in echo "ERROR: '$cfg_git_bin --version' output does not start with 'git version '" >&2 exit 1 esac +case "$cfg_git_bin" in /*) :;; *) + echo 'ERROR: $Girocco::Config::git_bin must be set to an absolute path' >&2 + exit 1 +esac echo "*** Setting up basedir..." @@ -150,15 +154,15 @@ chmod g+w "$cfg_chroot/etc/passwd" "$cfg_chroot/etc/group" || echo "WARNING: Cannot chmod g+w the etc/passwd and/or etc/group files" chmod 02775 "$cfg_chroot/etc" || echo "WARNING: Cannot chmod 02775 $cfg_chroot/etc" - echo "*** Setting up gitweb from git.git..." if [ ! -f git.git/Makefile ]; then echo "ERROR: git.git is not checked out! Did you _REALLY_ read INSTALL?" >&2 exit 1 fi mkdir -p "$cfg_webroot" "$cfg_cgiroot" -(cd git.git && "$MAKE" --quiet gitweb && cp gitweb/gitweb.cgi "$cfg_cgiroot" \ - && cp gitweb/static/*.png gitweb/static/*.css gitweb/static/*.js "$cfg_webroot") +(cd git.git && "$MAKE" --quiet bindir="$(dirname "$cfg_git_bin")" gitweb && \ + cp gitweb/gitweb.cgi "$cfg_cgiroot" && \ + cp gitweb/static/*.png gitweb/static/*.css gitweb/static/*.js "$cfg_webroot") echo "*** Setting up git-browser from git-browser.git..." -- 2.11.4.GIT