pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Provide switch to activate new frameworks to replac...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a0af2c15e871
branches: trunk
changeset: 363094:a0af2c15e871
user: jlam <jlam%pkgsrc.org@localhost>
date: Thu Jun 01 02:15:10 2017 +0000
description:
Provide switch to activate new frameworks to replace "pkginstall".
If ${_USE_NEW_PKGINSTALL} is "yes", then use the new "pkgtasks",
"init", and "pkgformat/pkg"-scripts frameworks instead of the
existing "pkginstall" framework.
diffstat:
mk/bsd.pkg.mk | 10 +++++++++-
mk/bsd.prefs.mk | 9 ++++++++-
mk/build/bsd.build.mk | 6 +++++-
mk/build/build.mk | 4 +++-
mk/check/check-files.mk | 4 ++--
mk/install/install.mk | 4 +++-
mk/pkgformat/pkg/metadata.mk | 36 +++++++++++++++++++++++++++++++++++-
7 files changed, 65 insertions(+), 8 deletions(-)
diffs (221 lines):
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/bsd.pkg.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.2024 2017/05/31 22:56:41 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.2025 2017/06/01 02:15:10 jlam Exp $
#
# This file is in the public domain.
#
@@ -371,8 +371,16 @@
# bsd.wrapper.mk
USE_TOOLS+= expr
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+# Init services framework
+.include "init/bsd.init.mk"
+
+# Package tasks framework
+.include "pkgtasks/bsd.pkgtasks.mk"
+.else
# INSTALL/DEINSTALL script framework
.include "pkginstall/bsd.pkginstall.mk"
+.endif
# Locking
.include "internal/locking.mk"
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/bsd.prefs.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.391 2017/05/31 22:55:01 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.392 2017/06/01 02:15:10 jlam Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
@@ -686,10 +686,12 @@
.endif
PREPEND_PATH+= ${LOCALBASE}/bin
+.if ${_USE_NEW_PKGINSTALL:Uno} == "no"
# Support alternative init systems.
#
INIT_SYSTEM?= rc.d
_BUILD_DEFS+= INIT_SYSTEM
+.endif
_PKGSRC_MKPIE= no
.if (${PKGSRC_MKPIE:tl} == "yes") && \
@@ -738,6 +740,11 @@
# System features framework
.include "features/features-vars.mk"
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+# Init services framework
+.include "init/bsd.init-vars.mk"
+.endif
+
# Package system format definitions
.include "pkgformat/bsd.pkgformat-vars.mk"
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/build/bsd.build.mk
--- a/mk/build/bsd.build.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/build/bsd.build.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.build.mk,v 1.11 2008/02/07 21:36:13 rillig Exp $
+# $NetBSD: bsd.build.mk,v 1.12 2017/06/01 02:15:10 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to building sources for a package.
@@ -36,7 +36,11 @@
build:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
+. if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+build: configure build-cookie
+. else
build: configure build-cookie pkginstall
+. endif
. else
build: barrier
. endif
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/build/build.mk
--- a/mk/build/build.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/build/build.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.21 2012/05/27 14:32:29 cheusov Exp $
+# $NetBSD: build.mk,v 1.22 2017/06/01 02:15:10 jlam Exp $
#
# This file defines what happens in the build phase, excluding the
# self-test, which is defined in test.mk.
@@ -67,7 +67,9 @@
_BUILD_TARGETS+= acquire-build-lock
_BUILD_TARGETS+= ${_COOKIE.build}
_BUILD_TARGETS+= release-build-lock
+.if ${_USE_NEW_PKGINSTALL:Uno} == "no"
_BUILD_TARGETS+= pkginstall
+.endif
.PHONY: build
.if !target(build)
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/check/check-files.mk
--- a/mk/check/check-files.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/check/check-files.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: check-files.mk,v 1.33 2017/05/31 22:56:22 jlam Exp $
+# $NetBSD: check-files.mk,v 1.34 2017/06/01 02:15:10 jlam Exp $
#
# This file checks that the list of installed files matches the PLIST.
# For that purpose it records the file list of LOCALBASE before and
@@ -60,7 +60,7 @@
CHECK_FILES_SKIP+= ${PREFIX}/emul/linux/proc.*
CHECK_FILES_SKIP+= ${PREFIX}/emul/linux32/proc.*
-# The reference-count meta-data directory used by the pkginstall framework.
+# The reference-count meta-data directory used by the {de,}install scripts.
CHECK_FILES_SKIP+= ${PKG_DBDIR}.refcount.*
# Some people have their distfiles and binary packages below ${LOCALBASE}.
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/install/install.mk
--- a/mk/install/install.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/install/install.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.69 2016/07/26 08:41:36 jperkin Exp $
+# $NetBSD: install.mk,v 1.70 2017/06/01 02:15:10 jlam Exp $
#
# This file provides the code for the "install" phase.
#
@@ -179,7 +179,9 @@
_INSTALL_ALL_TARGETS+= install-strip-debug
.endif
_INSTALL_ALL_TARGETS+= install-doc-handling
+.if ${_USE_NEW_PKGINSTALL:Uno} == "no"
_INSTALL_ALL_TARGETS+= install-script-data
+.endif
.if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss])
_INSTALL_ALL_TARGETS+= check-files-post
.endif
diff -r e81ce50d6ff3 -r a0af2c15e871 mk/pkgformat/pkg/metadata.mk
--- a/mk/pkgformat/pkg/metadata.mk Thu Jun 01 02:09:43 2017 +0000
+++ b/mk/pkgformat/pkg/metadata.mk Thu Jun 01 02:15:10 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.13 2016/04/10 15:58:03 joerg Exp $
+# $NetBSD: metadata.mk,v 1.14 2017/06/01 02:15:10 jlam Exp $
######################################################################
### The targets below are all PRIVATE.
@@ -311,6 +311,25 @@
######################################################################
###
+### +DEINSTALL/+INSTALL - Package deinstall and install scripts
+###
+### These are the scripts invoked by pkg_add(1) and pkg_delete(1)
+### as part of the package installation or removal process.
+###
+### Include scripts.mk to pull in the definitions for the following
+### variables:
+###
+### _DEINSTALL_FILE (undefined if not required)
+### _INSTALL_FILE (undefined if not required)
+###
+### This will also add these files to _METADATA_TARGETS.
+###
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+.include "${PKGSRCDIR}/mk/pkgformat/pkg/scripts.mk"
+.endif
+
+######################################################################
+###
### +CONTENTS - Package manifest file
###
### This file contains the list of files and checksums, along with
@@ -339,12 +358,18 @@
_PKG_CREATE_ARGS+= -S ${_SIZE_ALL_FILE}
_PKG_CREATE_ARGS+= -s ${_SIZE_PKG_FILE}
_PKG_CREATE_ARGS+= ${CONFLICTS:D -C ${CONFLICTS:Q}}
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+_PKG_CREATE_ARGS+= ${_INSTALL_FILE:D -i ${_INSTALL_FILE:Q}}
+_PKG_CREATE_ARGS+= ${_DEINSTALL_FILE:D -k ${_DEINSTALL_FILE:Q}}
+.else
_PKG_CREATE_ARGS+= ${INSTALL_FILE:D ${_INSTALL_ARG_cmd:sh}}
_PKG_CREATE_ARGS+= ${DEINSTALL_FILE:D ${_DEINSTALL_ARG_cmd:sh}}
+.endif
_PKG_ARGS_INSTALL+= ${_PKG_CREATE_ARGS}
_PKG_ARGS_INSTALL+= -I ${PREFIX} -p ${DESTDIR}${PREFIX}
+.if ${_USE_NEW_PKGINSTALL:Uno} == "no"
_DEINSTALL_ARG_cmd= if ${TEST} -f ${DEINSTALL_FILE}; then \
${ECHO} "-k "${DEINSTALL_FILE:Q}; \
else \
@@ -355,12 +380,19 @@
else \
${ECHO}; \
fi
+.endif
_CONTENTS_TARGETS+= ${_BUILD_INFO_FILE}
_CONTENTS_TARGETS+= ${_BUILD_VERSION_FILE}
_CONTENTS_TARGETS+= ${_COMMENT_FILE}
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+_CONTENTS_TARGETS+= ${_DEINSTALL_FILE}
+.endif
_CONTENTS_TARGETS+= ${_DEPENDS_FILE}
_CONTENTS_TARGETS+= ${_DESCR_FILE}
+.if ${_USE_NEW_PKGINSTALL:Uno} != "no"
+_CONTENTS_TARGETS+= ${_INSTALL_FILE}
+.endif
_CONTENTS_TARGETS+= ${_MESSAGE_FILE}
_CONTENTS_TARGETS+= ${_DEPENDS_PLIST}
_CONTENTS_TARGETS+= ${_PRESERVE_FILE}
@@ -383,7 +415,9 @@
### +COMMENT
### +CONTENTS
### +DESC
+### +DEINSTALL (if required)
### +DISPLAY
+### +INSTALL (if required)
### +PRESERVE
### +SIZE_ALL
### +SIZE_PKG
Home |
Main Index |
Thread Index |
Old Index