summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authormarino <marino@pkgsrc.org>2016-10-27 13:22:44 +0000
committermarino <marino@pkgsrc.org>2016-10-27 13:22:44 +0000
commitbe1511d7c2f25b12b74547d78ec3f7ea7016c3ce (patch)
treec5bcc7198716c0cbea49571b70ace69239bca7c1 /pkgtools
parent4ff32374ff005847c1aad8a73f2e4d0b922abc60 (diff)
downloadpkgsrc-be1511d7c2f25b12b74547d78ec3f7ea7016c3ce.tar.gz
pkgtools/pkg: Allow PORTSDIR to be specified
As pointed out by jperkins, defaulting to builder's setting for PKGSRCDIR for the sources isn't aways correct for the binary package consumers. This is not a problem unique to pkgtools/pkg and really requires a system- wide solution. Until there is such a global variable, rename the PORTSDIR variable to PKG.portsdir and allow it to be modified by e.g. make.conf. In the case of pkg, PORTSDIR just refers to a default configuration location which is overridable by a configuration file.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg/Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgtools/pkg/Makefile b/pkgtools/pkg/Makefile
index 57af0bb3ac1..ee0744bc699 100644
--- a/pkgtools/pkg/Makefile
+++ b/pkgtools/pkg/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2016/10/27 00:24:58 khorben Exp $
+# $NetBSD: Makefile,v 1.9 2016/10/27 13:22:44 marino Exp $
DISTNAME= pkg-1.8.7
PKGREVISION= 3
@@ -15,7 +15,7 @@ GNU_CONFIGURE= yes
USE_LANGUAGES= c
CPPFLAGS+= -D_LOCALBASE="\"${PREFIX}\""
-CPPFLAGS+= -DPORTSDIR="\"${PKGSRCDIR}\""
+CPPFLAGS+= -DPORTSDIR="\"${PKG.portsdir}\""
AUTO_MKDIRS= yes
@@ -61,15 +61,15 @@ SUBST_FILES.portsdir= libpkg/pkg_config.c \
docs/pkg.conf.5 \
docs/pkg-version.8 \
docs/pkg.8
-SUBST_SED.portsdir= -e "s|/usr/ports|${PORTSDIR}|g" \
+SUBST_SED.portsdir= -e "s|/usr/ports|${PKG.portsdir}|g" \
-e "s|/var/db/pkg|/var/db/pkgng|g" \
-e "s|/var/cache/pkg|/var/cache/pkgng|g"
SUBST_MESSAGE.portsdir= Correct reference to FreeBSD portsdir.
.if defined(PACKAGE_BUILDING) # set by Synth which has custom location, so use default path
-PORTSDIR= /usr/pkgsrc
+PKG.portsdir?= /usr/pkgsrc
.else
-PORTSDIR= ${PKGSRCDIR}
+PKG.portsdir?= ${PKGSRCDIR}
.endif
# DragonFly SSL libraries are private. pkg(8) is the one exception of a userland