diff --git a/xbps-src/etc/Makefile b/xbps-src/etc/Makefile index 60d5be0fb16..85b2b151a4b 100644 --- a/xbps-src/etc/Makefile +++ b/xbps-src/etc/Makefile @@ -1,12 +1,23 @@ include ../vars.mk +# Find out the real path for the xbps-src distribdir. +_CURDIR = $(shell dirname $(shell pwd)) +ifeq ($(shell basename ${_CURDIR}), xbps-src) +DISTRIBDIR = $(subst /xbps-src,,${_CURDIR}) +else +DISTRIBDIR = ${_CURDIR} +endif + CONF_FILE = xbps-src.conf .PHONY: all all: + sed -e "s|@@XBPS_DISTRIBDIR@@|${DISTRIBDIR}|" \ + ${CONF_FILE}.in > ${CONF_FILE} .PHONY: clean clean: + -rm -f ${CONF_FILE} .PHONY: install install: diff --git a/xbps-src/etc/xbps-src.conf b/xbps-src/etc/xbps-src.conf.in similarity index 97% rename from xbps-src/etc/xbps-src.conf rename to xbps-src/etc/xbps-src.conf.in index c89382ef1d6..a8bc519ee98 100644 --- a/xbps-src/etc/xbps-src.conf +++ b/xbps-src/etc/xbps-src.conf.in @@ -6,7 +6,7 @@ # Directory where the xbps-src GIT repository is stored. This is # required to be mounted in the chroot. # -XBPS_DISTRIBUTIONDIR=$HOME/xbps-templates +XBPS_DISTRIBUTIONDIR=@@XBPS_DISTRIBDIR@@ # # Chroot master directory.