pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Package Makefiles should refer to PKG_SYSCONFBASEDI...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a68e946a4ddf
branches: trunk
changeset: 460838:a68e946a4ddf
user: jlam <jlam%pkgsrc.org@localhost>
date: Fri Sep 05 11:34:25 2003 +0000
description:
Package Makefiles should refer to PKG_SYSCONFBASEDIR instead of
PKG_SYSCONFBASE when they want PKG_SYSCONFDIR stripped of
PKG_SYSCONFSUBDIR. This makes PKG_SYSCONFBASE=/etc work with pkgviews by
installing all config files into /etc/packages/<pkg> instead of
occasionally putting some directly into /etc.
Also only create PKG_SYSCONFDIR if we're actually going to copy config
files.
diffstat:
mk/bsd.pkg.install.mk | 10 ++++------
mk/bsd.pkg.mk | 13 +++++++------
mk/install/deinstall | 6 +++---
mk/install/header | 4 ++--
mk/install/install | 30 +++++++++++++++++-------------
5 files changed, 33 insertions(+), 30 deletions(-)
diffs (192 lines):
diff -r 2a5e58541bc7 -r a68e946a4ddf mk/bsd.pkg.install.mk
--- a/mk/bsd.pkg.install.mk Fri Sep 05 10:54:06 2003 +0000
+++ b/mk/bsd.pkg.install.mk Fri Sep 05 11:34:25 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.install.mk,v 1.46 2003/09/02 06:59:41 jlam Exp $
+# $NetBSD: bsd.pkg.install.mk,v 1.47 2003/09/05 11:34:25 jlam Exp $
#
# This Makefile fragment is included by package Makefiles to use the common
# INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply:
@@ -62,9 +62,9 @@
FILES_SUBST+= PREFIX=${PREFIX}
FILES_SUBST+= LOCALBASE=${LOCALBASE}
FILES_SUBST+= X11BASE=${X11BASE}
-FILES_SUBST+= PKG_SYSCONFBASE=${_PKG_SYSCONFBASE}
FILES_SUBST+= PKG_SYSCONFDEPOTBASE=${PKG_SYSCONFDEPOTBASE}
FILES_SUBST+= PKG_SYSCONFVIEWBASE=${PKG_SYSCONFVIEWBASE}
+FILES_SUBST+= PKG_SYSCONFBASEDIR=${PKG_SYSCONFBASEDIR}
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
FILES_SUBST+= PKGBASE=${PKGBASE}
FILES_SUBST+= PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}
@@ -172,8 +172,7 @@
# created and should attempt to be destroyed by the INSTALL/DEINSTALL
# scripts. MAKE_DIRS is used the same way, but the package admin
# isn't prompted to remove the directory at post-deinstall time if it
-# isn't empty. For convenience, ${PKG_SYSCONFDIR} is automatically
-# added to MAKE_DIRS.
+# isn't empty.
#
# OWN_DIRS_PERMS contains a list of "directory owner group mode" sublists
# representing directories for this package that should be
@@ -183,10 +182,9 @@
#
MAKE_DIRS?= # empty
MAKE_DIRS_PERMS?= # empty
-_MAKE_DIRS= ${PKG_SYSCONFDIR} ${MAKE_DIRS}
OWN_DIRS?= # empty
OWN_DIRS_PERMS?= # empty
-FILES_SUBST+= MAKE_DIRS=${_MAKE_DIRS:Q}
+FILES_SUBST+= MAKE_DIRS=${MAKE_DIRS:Q}
FILES_SUBST+= MAKE_DIRS_PERMS=${MAKE_DIRS_PERMS:Q}
FILES_SUBST+= OWN_DIRS=${OWN_DIRS:Q}
FILES_SUBST+= OWN_DIRS_PERMS=${OWN_DIRS_PERMS:Q}
diff -r 2a5e58541bc7 -r a68e946a4ddf mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk Fri Sep 05 10:54:06 2003 +0000
+++ b/mk/bsd.pkg.mk Fri Sep 05 11:34:25 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1259 2003/09/05 09:44:34 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1260 2003/09/05 11:34:26 jlam Exp $
#
# This file is in the public domain.
#
@@ -1244,6 +1244,7 @@
PKG_SYSCONFBASE?= ${PREFIX}/etc
.if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR})
PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
+PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
PKG_SYSCONFDEPOTBASE= # empty
PKG_SYSCONFVIEWBASE= # empty
.else
@@ -1251,22 +1252,22 @@
. if ${PKG_INSTALLATION_TYPE} == "overwrite"
PKG_SYSCONFDEPOTBASE= # empty
PKG_SYSCONFVIEWBASE= # empty
-_PKG_SYSCONFBASE= ${PKG_SYSCONFBASE}
+PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE}
. else
PKG_SYSCONFVIEWBASE= ${PKG_SYSCONFBASE}
. if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \
!empty(PKG_SYSCONFBASE:M${PREFIX}/*)
PKG_SYSCONFDEPOTBASE= # empty
-_PKG_SYSCONFBASE= ${PKG_SYSCONFBASE}
+PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE}
. else
PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR}
-_PKG_SYSCONFBASE= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME}
+PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME}
. endif
. endif
. if empty(PKG_SYSCONFSUBDIR)
-PKG_SYSCONFDIR= ${_PKG_SYSCONFBASE}
+PKG_SYSCONFDIR= ${PKG_SYSCONFBASEDIR}
. else
-PKG_SYSCONFDIR= ${_PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}
+PKG_SYSCONFDIR= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR}
. endif
.endif
diff -r 2a5e58541bc7 -r a68e946a4ddf mk/install/deinstall
--- a/mk/install/deinstall Fri Sep 05 10:54:06 2003 +0000
+++ b/mk/install/deinstall Fri Sep 05 11:34:25 2003 +0000
@@ -1,6 +1,6 @@
# start of deinstall
#
-# $NetBSD: deinstall,v 1.18 2003/09/02 07:00:06 jlam Exp $
+# $NetBSD: deinstall,v 1.19 2003/09/05 11:34:27 jlam Exp $
eval set -- ${PKG_USERS}
for userset; do
@@ -45,7 +45,7 @@
VIEW_FILES="${VIEW_FILES} \"${file}\""
done
-eval set -- ${RCD_SCRIPTS_DIR} ${MAKE_DIRS}
+eval set -- ${PKG_SYSCONFDIR} ${RCD_SCRIPTS_DIR} ${MAKE_DIRS}
for dir; do
ALL_MAKE_DIRS="${ALL_MAKE_DIRS} \"${dir}\""
done
@@ -171,7 +171,7 @@
# Don't bother the admin about the following dirs
# if they still exist.
#
- ${PKG_SYSCONFBASE}|${RCD_SCRIPTS_DIR})
+ ${PKG_SYSCONFBASEDIR}|${RCD_SCRIPTS_DIR})
;;
*)
if [ -d "${dir}" ]; then
diff -r 2a5e58541bc7 -r a68e946a4ddf mk/install/header
--- a/mk/install/header Fri Sep 05 10:54:06 2003 +0000
+++ b/mk/install/header Fri Sep 05 11:34:25 2003 +0000
@@ -2,7 +2,7 @@
#
# start of header
#
-# $NetBSD: header,v 1.19 2003/09/02 07:00:07 jlam Exp $
+# $NetBSD: header,v 1.20 2003/09/05 11:34:27 jlam Exp $
PKGNAME=$1
STAGE=$2
@@ -66,9 +66,9 @@
OWN_DIRS="@OWN_DIRS@"
OWN_DIRS_PERMS="@OWN_DIRS_PERMS@"
-PKG_SYSCONFBASE="@PKG_SYSCONFBASE@"
PKG_SYSCONFDEPOTBASE="@PKG_SYSCONFDEPOTBASE@"
PKG_SYSCONFVIEWBASE="@PKG_SYSCONFVIEWBASE@"
+PKG_SYSCONFBASEDIR="@PKG_SYSCONFBASEDIR@"
PKG_SYSCONFDIR="@PKG_SYSCONFDIR@"
PKG_REGISTER_SHELLS="@PKG_REGISTER_SHELLS@"
diff -r 2a5e58541bc7 -r a68e946a4ddf mk/install/install
--- a/mk/install/install Fri Sep 05 10:54:06 2003 +0000
+++ b/mk/install/install Fri Sep 05 11:34:25 2003 +0000
@@ -1,6 +1,20 @@
# start of install
#
-# $NetBSD: install,v 1.21 2003/09/02 07:00:07 jlam Exp $
+# $NetBSD: install,v 1.22 2003/09/05 11:34:27 jlam Exp $
+
+if [ -z "${CONF_FILES}" -a -z "${CONF_FILES_PERMS}" -a \
+ -z "${SUPPORT_FILES}" -a -z "${SUPPORT_FILES_PERMS}" -o \
+ "${_PKG_CONFIG}" = "NO" ]; then
+ :
+else
+ MAKE_DIRS="${MAKE_DIRS} \"${PKG_SYSCONFDIR}\""
+fi
+
+if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then
+ :
+else
+ MAKE_DIRS="${MAKE_DIRS} \"${RCD_SCRIPTS_DIR}\""
+fi
case ${STAGE} in
PRE-INSTALL)
@@ -96,12 +110,7 @@
#
if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \
-n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then
- if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then
- _RCD_SCRIPTS_DIR=
- else
- _RCD_SCRIPTS_DIR="${RCD_SCRIPTS_DIR}"
- fi
- eval set -- ${_RCD_SCRIPTS_DIR} ${MAKE_DIRS} ${OWN_DIRS}
+ eval set -- ${MAKE_DIRS} ${OWN_DIRS}
for dir; do
if [ -d "${dir}" ]; then
continue
@@ -159,12 +168,7 @@
if [ -n "${MAKE_DIRS}" -o -n "${OWN_DIRS}" -o \
-n "${MAKE_DIRS_PERMS}" -o -n "${OWN_DIRS_PERMS}" ]; then
_print_dir_header=1
- if [ -z "${RCD_SCRIPTS}" -o "${_PKG_RCD_SCRIPTS}" = "NO" ]; then
- _RCD_SCRIPTS_DIR=
- else
- _RCD_SCRIPTS_DIR="${RCD_SCRIPTS_DIR}"
- fi
- eval set -- ${_RCD_SCRIPTS_DIR} ${MAKE_DIRS} ${OWN_DIRS}
+ eval set -- ${MAKE_DIRS} ${OWN_DIRS}
for dir; do
if [ -d "${dir}" ]; then
continue
Home |
Main Index |
Thread Index |
Old Index