head 1.13; access; symbols pkgsrc-2023Q4:1.13.0.46 pkgsrc-2023Q4-base:1.13 pkgsrc-2023Q3:1.13.0.44 pkgsrc-2023Q3-base:1.13 pkgsrc-2023Q2:1.13.0.42 pkgsrc-2023Q2-base:1.13 pkgsrc-2023Q1:1.13.0.40 pkgsrc-2023Q1-base:1.13 pkgsrc-2022Q4:1.13.0.38 pkgsrc-2022Q4-base:1.13 pkgsrc-2022Q3:1.13.0.36 pkgsrc-2022Q3-base:1.13 pkgsrc-2022Q2:1.13.0.34 pkgsrc-2022Q2-base:1.13 pkgsrc-2022Q1:1.13.0.32 pkgsrc-2022Q1-base:1.13 pkgsrc-2021Q4:1.13.0.30 pkgsrc-2021Q4-base:1.13 pkgsrc-2021Q3:1.13.0.28 pkgsrc-2021Q3-base:1.13 pkgsrc-2021Q2:1.13.0.26 pkgsrc-2021Q2-base:1.13 pkgsrc-2021Q1:1.13.0.24 pkgsrc-2021Q1-base:1.13 pkgsrc-2020Q4:1.13.0.22 pkgsrc-2020Q4-base:1.13 pkgsrc-2020Q3:1.13.0.20 pkgsrc-2020Q3-base:1.13 pkgsrc-2020Q2:1.13.0.18 pkgsrc-2020Q2-base:1.13 pkgsrc-2020Q1:1.13.0.14 pkgsrc-2020Q1-base:1.13 pkgsrc-2019Q4:1.13.0.16 pkgsrc-2019Q4-base:1.13 pkgsrc-2019Q3:1.13.0.12 pkgsrc-2019Q3-base:1.13 pkgsrc-2019Q2:1.13.0.10 pkgsrc-2019Q2-base:1.13 pkgsrc-2019Q1:1.13.0.8 pkgsrc-2019Q1-base:1.13 pkgsrc-2018Q4:1.13.0.6 pkgsrc-2018Q4-base:1.13 pkgsrc-2018Q3:1.13.0.4 pkgsrc-2018Q3-base:1.13 pkgsrc-2018Q2:1.13.0.2 pkgsrc-2018Q2-base:1.13 pkgsrc-2018Q1:1.12.0.22 pkgsrc-2018Q1-base:1.12 pkgsrc-2017Q4:1.12.0.20 pkgsrc-2017Q4-base:1.12 pkgsrc-2017Q3:1.12.0.18 pkgsrc-2017Q3-base:1.12 pkgsrc-2017Q2:1.12.0.14 pkgsrc-2017Q2-base:1.12 pkgsrc-2017Q1:1.12.0.12 pkgsrc-2017Q1-base:1.12 pkgsrc-2016Q4:1.12.0.10 pkgsrc-2016Q4-base:1.12 pkgsrc-2016Q3:1.12.0.8 pkgsrc-2016Q3-base:1.12 pkgsrc-2016Q2:1.12.0.6 pkgsrc-2016Q2-base:1.12 pkgsrc-2016Q1:1.12.0.4 pkgsrc-2016Q1-base:1.12 pkgsrc-2015Q4:1.12.0.2 pkgsrc-2015Q4-base:1.12 pkgsrc-2015Q3:1.11.0.52 pkgsrc-2015Q3-base:1.11 pkgsrc-2015Q2:1.11.0.50 pkgsrc-2015Q2-base:1.11 pkgsrc-2015Q1:1.11.0.48 pkgsrc-2015Q1-base:1.11 pkgsrc-2014Q4:1.11.0.46 pkgsrc-2014Q4-base:1.11 pkgsrc-2014Q3:1.11.0.44 pkgsrc-2014Q3-base:1.11 pkgsrc-2014Q2:1.11.0.42 pkgsrc-2014Q2-base:1.11 pkgsrc-2014Q1:1.11.0.40 pkgsrc-2014Q1-base:1.11 pkgsrc-2013Q4:1.11.0.38 pkgsrc-2013Q4-base:1.11 pkgsrc-2013Q3:1.11.0.36 pkgsrc-2013Q3-base:1.11 pkgsrc-2013Q2:1.11.0.34 pkgsrc-2013Q2-base:1.11 pkgsrc-2013Q1:1.11.0.32 pkgsrc-2013Q1-base:1.11 pkgsrc-2012Q4:1.11.0.30 pkgsrc-2012Q4-base:1.11 pkgsrc-2012Q3:1.11.0.28 pkgsrc-2012Q3-base:1.11 pkgsrc-2012Q2:1.11.0.26 pkgsrc-2012Q2-base:1.11 pkgsrc-2012Q1:1.11.0.24 pkgsrc-2012Q1-base:1.11 pkgsrc-2011Q4:1.11.0.22 pkgsrc-2011Q4-base:1.11 pkgsrc-2011Q3:1.11.0.20 pkgsrc-2011Q3-base:1.11 pkgsrc-2011Q2:1.11.0.18 pkgsrc-2011Q2-base:1.11 pkgsrc-2011Q1:1.11.0.16 pkgsrc-2011Q1-base:1.11 pkgsrc-2010Q4:1.11.0.14 pkgsrc-2010Q4-base:1.11 pkgsrc-2010Q3:1.11.0.12 pkgsrc-2010Q3-base:1.11 pkgsrc-2010Q2:1.11.0.10 pkgsrc-2010Q2-base:1.11 pkgsrc-2010Q1:1.11.0.8 pkgsrc-2010Q1-base:1.11 pkgsrc-2009Q4:1.11.0.6 pkgsrc-2009Q4-base:1.11 pkgsrc-2009Q3:1.11.0.4 pkgsrc-2009Q3-base:1.11 pkgsrc-2009Q2:1.11.0.2 pkgsrc-2009Q2-base:1.11 pkgsrc-2009Q1:1.10.0.18 pkgsrc-2009Q1-base:1.10 pkgsrc-2008Q4:1.10.0.16 pkgsrc-2008Q4-base:1.10 pkgsrc-2008Q3:1.10.0.14 pkgsrc-2008Q3-base:1.10 cube-native-xorg:1.10.0.12 cube-native-xorg-base:1.10 pkgsrc-2008Q2:1.10.0.10 pkgsrc-2008Q2-base:1.10 cwrapper:1.10.0.8 pkgsrc-2008Q1:1.10.0.6 pkgsrc-2008Q1-base:1.10 pkgsrc-2007Q4:1.10.0.4 pkgsrc-2007Q4-base:1.10 pkgsrc-2007Q3:1.10.0.2 pkgsrc-2007Q3-base:1.10 pkgsrc-2007Q2:1.9.0.2 pkgsrc-2007Q2-base:1.9 pkgsrc-2007Q1:1.8.0.6 pkgsrc-2007Q1-base:1.8 jlam-pkgviews:1.8.0.4 jlam-pkgviews-base:1.8 pkgsrc-2006Q4:1.8.0.2 pkgsrc-2006Q4-base:1.8 pkgsrc-2006Q3:1.7.0.4 pkgsrc-2006Q3-base:1.7 pkgsrc-2006Q2:1.7.0.2 pkgsrc-2006Q2-base:1.7 tv-derecurse-eol:1.4.2.2 pkgsrc-2006Q1:1.6.0.2 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.4.0.10 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.8 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.6 pkgsrc-2005Q2-base:1.4 tv-derecurse-merge:1.4 pkgsrc-2005Q1:1.4.0.4 pkgsrc-2005Q1-base:1.4 tv-derecurse-base:1.4 tv-derecurse:1.4.0.2; locks; strict; comment @# @; 1.13 date 2018.05.16.21.23.02; author rillig; state Exp; branches; next 1.12; commitid pus0PN93gaDvdzCA; 1.12 date 2015.11.25.13.05.47; author jperkin; state Exp; branches; next 1.11; commitid B0qnPpooY6FuutKy; 1.11 date 2009.06.14.22.58.05; author joerg; state Exp; branches; next 1.10; 1.10 date 2007.09.29.15.56.04; author rillig; state Exp; branches; next 1.9; 1.9 date 2007.05.07.09.32.11; author rillig; state Exp; branches; next 1.8; 1.8 date 2006.11.10.20.48.41; author rillig; state Exp; branches; next 1.7; 1.7 date 2006.06.15.22.13.59; author jlam; state Exp; branches; next 1.6; 1.6 date 2006.03.14.01.14.35; author jlam; state Exp; branches; next 1.5; 1.5 date 2005.12.29.06.22.26; author jlam; state Exp; branches; next 1.4; 1.4 date 2005.01.25.16.48.53; author jmmv; state Exp; branches 1.4.2.1; next 1.3; 1.3 date 2005.01.25.16.29.16; author jmmv; state Exp; branches; next 1.2; 1.2 date 2005.01.25.15.37.25; author jmmv; state Exp; branches; next 1.1; 1.1 date 2005.01.25.13.13.35; author jmmv; state Exp; branches; next ; 1.4.2.1 date 2005.01.25.16.48.53; author tv; state dead; branches; next 1.4.2.2; 1.4.2.2 date 2005.02.11.15.27.57; author tv; state Exp; branches; next 1.4.2.3; 1.4.2.3 date 2006.06.07.15.25.38; author tv; state dead; branches; next ; desc @@ 1.13 log @mk/*: improve documentation for "make help" @ text @# $NetBSD: alternatives.mk,v 1.12 2015/11/25 13:05:47 jperkin Exp $ # # This Makefile fragment handles the alternatives system, registering a # package in the database. # # User-settable variables: # # (none) # # Package-settable variables: # # ALTERNATIVES_SRC # A _single_ file that contains the alternatives provided by the # package. # # Default value: The name of the ALTERNATIVES file in the package # directory, if it exists. Otherwise, nothing. # # Each line of the alternatives file contains two filenames: # # wrapper alternative # # The wrapper is the command that is run by the user. # The alternative is the implementation of that command that is # provided by the package. # Both paths are relative to PREFIX. # The paths may use placeholders of the form @@VARNAME@@, which are # replaced with the actual values as per FILES_SUBST. # # Variables defined by this file: # # PKG_ALTERNATIVES # The path to the pkg_alternatives command. # # Keywords: alternatives .if !defined(ALTERNATIVES_MK) ALTERNATIVES_MK= # defined _VARGROUPS+= alternatives _PKG_VARS.alternatives= ALTERNATIVES_SRC _SYS_VARS.alternatives= PKG_ALTERNATIVES .if exists(${.CURDIR}/ALTERNATIVES) ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES .endif ALTERNATIVES_SRC?= # none .if !empty(ALTERNATIVES_SRC) ${WRKDIR}/.altinstall: ${ALTERNATIVES_SRC} @@{ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ ${ECHO} '${CAT} >./+ALTERNATIVES <${WRKDIR}/.altinstall ${WRKDIR}/.altdeinstall: ${ALTERNATIVES_SRC} @@{ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ ${ECHO} '${PKG_ALTERNATIVES} -gs unregister ./+ALTERNATIVES'; \ ${ECHO} 'fi'; \ ${ECHO} '${RM} -f ./+ALTERNATIVES'; \ ${ECHO} 'fi'; \ } >${WRKDIR}/.altdeinstall PRINT_PLIST_AWK+= /^libdata\/alternatives\// { next; } PKG_ALTERNATIVES= ${LOCALBASE}/sbin/pkg_alternatives INSTALL_TEMPLATES+= ${WRKDIR}/.altinstall DEINSTALL_TEMPLATES+= ${WRKDIR}/.altdeinstall .endif .endif # ALTERNATIVES_MK @ 1.12 log @Remove mk/find-prefix.mk and its usage from the mk infrastructure. The find-prefix infrastructure was required in a pkgviews world where packages installed from pkgsrc could have different installation prefixes, and this was a way for a dependency prefix to be determined. Now that pkgviews has been removed there is no longer any need for the overhead of this infrastructure. Instead we use BUILDLINK_PREFIX.pkg for dependencies pulled in via buildlink, or LOCALBASE/PREFIX where the dependency is coming from pkgsrc. Provides a reasonable performance win due to the reduction of `pkg_info -qp` calls, some of which were redundant anyway as they were duplicating the same information provided by BUILDLINK_PREFIX.pkg. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.11 2009/06/14 22:58:05 joerg Exp $ d19 7 a25 2 # Each line of the alternatives file contains two filenames, first # the wrapper and then the alternative provided by the package. d27 2 d35 1 @ 1.11 log @Remove @@dirrm related logic. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.10 2007/09/29 15:56:04 rillig Exp $ d65 1 a65 3 EVAL_PREFIX+= PREFIX.pkg_alternatives=pkg_alternatives PREFIX.alternatives_DEFAULT= ${LOCALBASE} PKG_ALTERNATIVES= ${PREFIX.pkg_alternatives}/sbin/pkg_alternatives @ 1.10 log @Documented the file format. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.9 2007/05/07 09:32:11 rillig Exp $ a63 1 PRINT_PLIST_AWK+= /^@@dirrm libdata\/alternatives/ { next; } @ 1.9 log @Added variable descriptions. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.8 2006/11/10 20:48:41 rillig Exp $ d19 4 @ 1.8 log @Provided the usual header comment. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.7 2006/06/15 22:13:59 jlam Exp $ d28 4 @ 1.7 log @Pluralize INSTALL_TEMPLATE and DEINSTALL_TEMPLATE variable names as per the pkglint warning: As {INSTALL,DEINSTALL}_TEMPLATE is modified using "+=", its name should indicate plural. This does make the variables a bit more suggestive of the fact that they hold lists of values. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.6 2006/03/14 01:14:35 jlam Exp $ d6 17 a22 4 # The ALTERNATIVES_SRC variable contains the path to a file listing the # alternatives provided by the package. It defaults to the ALTERNATIVES # file in the current directory if found. If this variable is empty, no # actions are taken by this file. d28 1 a28 2 .if !defined(ALTERNATIVES_SRC) . if exists(${.CURDIR}/ALTERNATIVES) a29 3 . else ALTERNATIVES_SRC?= . endif d31 1 @ 1.6 log @Modify the pkginstall framework so that it manages all aspects of INSTALL/DEINSTALL script creation within pkgsrc. If an INSTALL or DEINSTALL script is found in the package directory, it is automatically used as a template for the pkginstall-generated scripts. If instead, they should be used simply as the full scripts, then the package Makefile should set INSTALL_SRC or DEINSTALL_SRC explicitly, e.g.: INSTALL_SRC= ${PKGDIR}/INSTALL DEINSTALL_SRC= # emtpy As part of the restructuring of the pkginstall framework internals, we now *always* generate temporary INSTALL or DEINSTALL scripts. By comparing these temporary scripts with minimal INSTALL/DEINSTALL scripts formed from only the base templates, we determine whether or not the INSTALL/DEINSTALL scripts are actually needed by the package (see the generate-install-scripts target in bsd.pkginstall.mk). In addition, more variables in the framework have been made private. The *_EXTRA_TMPL variables have been renamed to *_TEMPLATE, which are more sensible names given the very few exported variables in this framework. The only public variables relating to the templates are: INSTALL_SRC INSTALL_TEMPLATE DEINSTALL_SRC DEINSTALL_TEMPLATE HEADER_TEMPLATE The packages in pkgsrc have been modified to reflect the changes in the pkginstall framework. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.5 2005/12/29 06:22:26 jlam Exp $ d52 2 a53 2 INSTALL_TEMPLATE+= ${WRKDIR}/.altinstall DEINSTALL_TEMPLATE+= ${WRKDIR}/.altdeinstall @ 1.5 log @Remove USE_PKGINSTALL from pkgsrc now that mk/install/pkginstall.mk automatically detects whether we want the pkginstall machinery to be used by the package Makefile. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.4 2005/01/25 16:48:53 jmmv Exp $ d52 2 a53 2 INSTALL_EXTRA_TMPL+= ${WRKDIR}/.altinstall DEINSTALL_EXTRA_TMPL+= ${WRKDIR}/.altdeinstall @ 1.4 log @Explicitly use -g to avoid relying on default behavior. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.3 2005/01/25 16:29:16 jmmv Exp $ a53 1 USE_PKGINSTALL= YES @ 1.4.2.1 log @file alternatives.mk was added on branch tv-derecurse on 2005-02-11 15:27:57 +0000 @ text @d1 58 @ 1.4.2.2 log @sync with HEAD @ text @a0 58 # $NetBSD: alternatives.mk,v 1.4.2.1 2005/02/11 15:27:57 tv Exp $ # # This Makefile fragment handles the alternatives system, registering a # package in the database. # # The ALTERNATIVES_SRC variable contains the path to a file listing the # alternatives provided by the package. It defaults to the ALTERNATIVES # file in the current directory if found. If this variable is empty, no # actions are taken by this file. # .if !defined(ALTERNATIVES_MK) ALTERNATIVES_MK= # defined .if !defined(ALTERNATIVES_SRC) . if exists(${.CURDIR}/ALTERNATIVES) ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES . else ALTERNATIVES_SRC?= . endif .endif .if !empty(ALTERNATIVES_SRC) ${WRKDIR}/.altinstall: ${ALTERNATIVES_SRC} @@{ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ ${ECHO} '${CAT} >./+ALTERNATIVES <${WRKDIR}/.altinstall ${WRKDIR}/.altdeinstall: ${ALTERNATIVES_SRC} @@{ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ ${ECHO} '${PKG_ALTERNATIVES} -gs unregister ./+ALTERNATIVES'; \ ${ECHO} 'fi'; \ ${ECHO} '${RM} -f ./+ALTERNATIVES'; \ ${ECHO} 'fi'; \ } >${WRKDIR}/.altdeinstall PRINT_PLIST_AWK+= /^libdata\/alternatives\// { next; } PRINT_PLIST_AWK+= /^@@dirrm libdata\/alternatives/ { next; } EVAL_PREFIX+= PREFIX.pkg_alternatives=pkg_alternatives PREFIX.alternatives_DEFAULT= ${LOCALBASE} PKG_ALTERNATIVES= ${PREFIX.pkg_alternatives}/sbin/pkg_alternatives INSTALL_EXTRA_TMPL+= ${WRKDIR}/.altinstall DEINSTALL_EXTRA_TMPL+= ${WRKDIR}/.altdeinstall USE_PKGINSTALL= YES .endif .endif # ALTERNATIVES_MK @ 1.4.2.3 log @EOL the tv-derecurse branch; it has become too outdated. The last live revision can be fetched at the tv-derecurse-eol tag. @ text @d1 58 @ 1.3 log @Redo previous per suggestion from reed@@. Do not process the alternatives until the pkg_alternatives package has been manually installed. This way we drop the dependency on that package. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.2 2005/01/25 15:37:25 jmmv Exp $ d31 1 a31 1 ${ECHO} '${PKG_ALTERNATIVES} -s register ./+ALTERNATIVES'; \ d39 1 a39 1 ${ECHO} '${PKG_ALTERNATIVES} -s unregister ./+ALTERNATIVES'; \ @ 1.2 log @Make the usage of alternatives optional through the PKG_ALTERNATIVES variable, which is similar to PKG_CONFIG. This does not change how the binary packages are built, only whether the pkg_alternatives command should be run at package installation/deinstallation time or not. The variable can take either YES or NO as values and defaults to YES. @ text @d1 1 a1 1 # $NetBSD: alternatives.mk,v 1.1 2005/01/25 13:13:35 jmmv Exp $ a10 5 # The PKG_ALTERNATIVES variable indicates wether the INSTALL/DEINSTALL # scripts should do automatic alternatives handling, i.e., if they should # register the installed packages into the wrappers database. It is # either YES or NO and defaults to YES. # a14 2 PKG_ALTERNATIVES?= YES d26 1 a26 2 @@{ ${ECHO} ': $${PKG_ALTERNATIVES:=${PKG_ALTERNATIVES}}'; \ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ d30 3 a32 3 ${ECHO} 'case $${PKG_ALTERNATIVES} in [Yy][Ee][Ss])'; \ ${ECHO} '${_ALTERNATIVES_PROG} -s register ./+ALTERNATIVES ;;'; \ ${ECHO} 'esac'; \ d37 4 a40 5 @@{ ${ECHO} ': $${PKG_ALTERNATIVES:=${PKG_ALTERNATIVES}}'; \ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ ${ECHO} 'case $${PKG_ALTERNATIVES} in [Yy][Ee][Ss])'; \ ${ECHO} '${_ALTERNATIVES_PROG} -s unregister ./+ALTERNATIVES ;;'; \ ${ECHO} 'esac'; \ a47 2 DEPENDS+= pkg_alternatives>=1.0:../../pkgtools/pkg_alternatives d50 1 a50 1 _ALTERNATIVES_PROG= ${PREFIX.pkg_alternatives}/sbin/pkg_alternatives @ 1.1 log @Add alternatives.mk, a file used to manipulate the alternatives system. A package can optionally provide an ALTERNATIVES file which contains pairs of wrapper/alternative, one per line. The file is then used by the install and deinstall scripts to register the alternatives and to create the appropriate wrappers. Make bsd.pkg.mk include this new file. This happens unconditionally to keep all the alternatives logic in an independent file. Otherwise, some of the stuff could have to be moved to bsd.pkg.mk, breaking consistency. @ text @d1 1 a1 1 # $NetBSD$ d11 5 d20 2 d33 2 a34 1 @@{ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ d38 3 a40 1 ${ECHO} '${PKG_ALTERNATIVES} -s register ./+ALTERNATIVES'; \ d45 5 a49 2 @@{ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ ${ECHO} '${PKG_ALTERNATIVES} -s unregister ./+ALTERNATIVES'; \ d61 1 a61 1 PKG_ALTERNATIVES= ${PREFIX.pkg_alternatives}/sbin/pkg_alternatives @