From 4616674b8650ae83d1c97171962203524769fd43 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 21 Dec 2010 12:33:46 +0100 Subject: [PATCH] xbps-src: find out the correct path for XBPS_DISTRIBUTIONDIR in the build process. --HG-- rename : xbps-src/etc/xbps-src.conf => xbps-src/etc/xbps-src.conf.in --- xbps-src/etc/Makefile | 11 +++++++++++ xbps-src/etc/{xbps-src.conf => xbps-src.conf.in} | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) rename xbps-src/etc/{xbps-src.conf => xbps-src.conf.in} (97%) 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.