pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Consolidate PLIST_SRC default generation and the pl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c20cc6899239
branches:  trunk
changeset: 488901:c20cc6899239
user:      tv <tv%pkgsrc.org@localhost>
date:      Fri Feb 11 16:57:45 2005 +0000

description:
Consolidate PLIST_SRC default generation and the plethora of failsafe
error checks into labelled blocks toward the top of the file.

While here, remove the historic (now completely empty; it was replaced by
PKG_FAIL_REASON some time ago) uptodate-pkgtools target and the references
to it.

diffstat:

 mk/bsd.pkg.mk |  264 +++++++++++++++++++++++++++------------------------------
 1 files changed, 125 insertions(+), 139 deletions(-)

diffs (truncated from 412 to 300 lines):

diff -r 08c62ef8afa4 -r c20cc6899239 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Fri Feb 11 16:51:16 2005 +0000
+++ b/mk/bsd.pkg.mk     Fri Feb 11 16:57:45 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1584 2005/02/11 16:36:49 tv Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1585 2005/02/11 16:57:45 tv Exp $
 #
 # This file is in the public domain.
 #
@@ -94,6 +94,27 @@
 PKGNAME_NOREV=         ${PKGNAME}
 .endif
 
+##### PLIST
+
+.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
+PLIST_TYPE?=           dynamic
+.endif
+PLIST_TYPE?=           static
+
+.if !defined(PLIST_SRC)
+.  if exists(${PKGDIR}/PLIST.common)
+PLIST_SRC+=            ${PKGDIR}/PLIST.common
+.  endif
+.  if exists(${PKGDIR}/PLIST.${OPSYS})
+PLIST_SRC+=            ${PKGDIR}/PLIST.${OPSYS}
+.  elif exists(${PKGDIR}/PLIST)
+PLIST_SRC+=            ${PKGDIR}/PLIST
+.  endif
+.  if exists(${PKGDIR}/PLIST.common_end)
+PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
+.  endif
+.endif # !PLIST_SRC
+
 ##### Others
 
 _DISTDIR?=             ${DISTDIR}/${DIST_SUBDIR}
@@ -153,11 +174,98 @@
 
 .include "../../mk/bsd.pkg.use.mk"
 
+############################################################################
+# Sanity checks
+############################################################################
+
 # Fail-safe in the case of circular dependencies
 .if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME})
     PKG_FAIL_REASON+="Circular dependency detected"
 .endif
 
+# PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or
+# "overwrite".
+.if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \
+    (${PKG_INSTALLATION_TYPE} != "overwrite")
+PKG_FAIL_REASON+=      "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''."
+.endif
+
+.if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE})
+PKG_FAIL_REASON+=      "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}."
+.endif
+
+.if (${PLIST_TYPE} != "dynamic") && (${PLIST_TYPE} != "static")
+PKG_FAIL_REASON+=      "PLIST_TYPE must be \`\`dynamic'' or \`\`static''."
+.endif
+
+.if (${PKG_INSTALLATION_TYPE} == "overwrite") && (${PLIST_TYPE} != "static")
+PKG_FAIL_REASON+=      "PLIST_TYPE must be \`\`static'' for \`\`overwrite'' packages."
+.endif
+
+# Check that we are using up-to-date pkg_* tools with this file.
+.if !defined(NO_PKGTOOLS_REQD_CHECK)
+.  if ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
+PKG_FAIL_REASON+='Error: The package tools installed on this system are out of date.'
+PKG_FAIL_REASON+='The installed package tools are dated ${PKGTOOLS_VERSION:C|(....)(..)(..)|\1/\2/\3|} and you must update'
+PKG_FAIL_REASON+='them to at least ${PKGTOOLS_REQD:C|(....)(..)(..)|\1/\2/\3|} using the following command:'
+PKG_FAIL_REASON+=''
+PKG_FAIL_REASON+='     cd ${PKGSRCDIR}/pkgtools/pkg_install && ${MAKE} clean && ${MAKE} install'
+.  endif
+.endif # !NO_PKGTOOLS_REQD_CHECK
+
+.if defined(ALL_TARGET)
+PKG_FAIL_REASON+='ALL_TARGET is deprecated and must be replaced with BUILD_TARGET.'
+.endif
+
+.if defined(NO_WRKSUBDIR)
+PKG_FAIL_REASON+='NO_WRKSUBDIR has been deprecated - please replace it with an explicit'
+PKG_FAIL_REASON+='assignment of WRKSRC= $${WRKDIR}'
+.endif # NO_WRKSUBDIR
+
+# We need to make sure the buildlink-x11 package is not installed since it
+# breaks builds that use imake.
+.if defined(USE_IMAKE)
+.  if exists(${LOCALBASE}/lib/X11/config/buildlinkX11.def) || \
+      exists(${X11BASE}/lib/X11/config/buildlinkX11.def)
+PKG_FAIL_REASON+= "${PKGNAME} uses imake, but the buildlink-x11 package was found." \
+        "    Please deinstall it (pkg_delete buildlink-x11)."
+.  endif
+.endif # USE_IMAKE
+
+.if !defined(CATEGORIES) || !defined(DISTNAME)
+PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.'
+.endif
+
+.if defined(LIB_DEPENDS)
+PKG_FAIL_REASON+='LIB_DEPENDS is deprecated and must be replaced with DEPENDS.'
+.endif
+
+.if defined(PKG_PATH)
+PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!'
+.endif
+
+.if defined(MASTER_SITE_SUBDIR)
+PKG_FAIL_REASON+='MASTER_SITE_SUBDIR is deprecated and must be replaced with MASTER_SITES.'
+.endif
+
+.if defined(PATCH_SITE_SUBDIR)
+PKG_FAIL_REASON+='PATCH_SITE_SUBDIR is deprecated and must be replaced with PATCH_SITES.'
+.endif
+
+.if defined(ONLY_FOR_ARCHS) || defined(NOT_FOR_ARCHS) \
+       || defined(ONLY_FOR_OPSYS) || defined(NOT_FOR_OPSYS)
+PKG_FAIL_REASON+='ONLY/NOT_FOR_ARCHS/OPSYS are deprecated and must be replaced with ONLY/NOT_FOR_PLATFORM.'
+.endif
+
+.if (${PKGSRC_LOCKTYPE} == "sleep" || ${PKGSRC_LOCKTYPE} == "once")
+. if !defined(OBJHOSTNAME)
+PKG_FAIL_REASON+='PKGSRC_LOCKTYPE needs OBJHOSTNAME defined.'
+. elif !exists(${SHLOCK})
+PKG_FAIL_REASON+='The ${SHLOCK} utility does not exist, and is necessary for locking.'
+PKG_FAIL_REASON+='Please "${MAKE} install" in ../../pkgtools/shlock.'
+. endif
+.endif
+
 # Allow variables to be set on a per-OS basis
 OPSYSVARS+=    CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS
 .for _var_ in ${OPSYSVARS:O}
@@ -229,40 +337,6 @@
 BUILD_DEFS+=            PKG_OPTIONS
 .endif
 
-# PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or
-# "overwrite".
-#
-.if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \
-    (${PKG_INSTALLATION_TYPE} != "overwrite")
-PKG_FAIL_REASON+=      "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''."
-.endif
-
-.if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE})
-PKG_FAIL_REASON+=      "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}."
-.endif
-
-# The style of PLISTs that are used by the installed package.
-# Possible: dynamic, static
-#
-.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
-PLIST_TYPE?=           dynamic
-.elif ${PKG_INSTALLATION_TYPE} == "overwrite"
-PLIST_TYPE?=           static
-.else
-PLIST_TYPE?=           static
-.endif
-
-# PLIST_TYPE can only be one of two values: "dynamic" or "static".  If we
-# don't explicitly ask for "static", assume "dynamic".
-#
-.if (${PLIST_TYPE} != "dynamic") && (${PLIST_TYPE} != "static")
-PKG_FAIL_REASON+=      "PLIST_TYPE must be \`\`dynamic'' or \`\`static''."
-.endif
-
-.if (${PKG_INSTALLATION_TYPE} == "overwrite") && (${PLIST_TYPE} != "static")
-PKG_FAIL_REASON+=      "PLIST_TYPE must be \`\`static'' for \`\`overwrite'' packages."
-.endif
-
 .if empty(DEPOT_SUBDIR)
 PKG_FAIL_REASON+=      "DEPOT_SUBDIR may not be empty."
 .endif
@@ -283,17 +357,6 @@
 .endif
 BUILD_DEFS+=           _PLIST_IGNORE_FILES
 
-# We need to make sure the buildlink-x11 package is not installed since it
-# breaks builds that use imake.
-#
-.if defined(USE_IMAKE)
-.  if exists(${LOCALBASE}/lib/X11/config/buildlinkX11.def) || \
-      exists(${X11BASE}/lib/X11/config/buildlinkX11.def)
-PKG_FAIL_REASON+= "${PKGNAME} uses imake, but the buildlink-x11 package was found." \
-        "    Please deinstall it (pkg_delete buildlink-x11)."
-.  endif
-.endif # USE_IMAKE
-
 .if !empty(USE_GNU_TOOLS:Mmake)
 _USE_GMAKE=            yes
 .endif
@@ -487,11 +550,6 @@
 _PKG_DEBUG_SCRIPT=     ${SH} -x
 .endif
 
-.if defined(NO_WRKSUBDIR)
-PKG_FAIL_REASON+='NO_WRKSUBDIR has been deprecated - please replace it with an explicit'
-PKG_FAIL_REASON+='assignment of WRKSRC= $${WRKDIR}'
-.endif # NO_WRKSUBDIR
-
 # A few aliases for *-install targets
 INSTALL_PROGRAM?=      \
        ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
@@ -540,29 +598,6 @@
 .  undef NO_PACKAGE
 .endif
 
-.if ${PLIST_TYPE} == "static"
-# Automatic platform dependent PLIST handling
-.  if !defined(PLIST_SRC)
-.    if exists(${PKGDIR}/PLIST.common)
-PLIST_SRC=             ${PKGDIR}/PLIST.common
-.      if exists(${PKGDIR}/PLIST.${OPSYS})
-PLIST_SRC+=            ${PKGDIR}/PLIST.${OPSYS}
-.      endif
-.      if exists(${PKGDIR}/PLIST.common_end)
-PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
-.      endif
-.    elif exists(${PKGDIR}/PLIST.${OPSYS})
-PLIST_SRC=             ${PKGDIR}/PLIST.${OPSYS}
-.    else
-PLIST_SRC=             ${PKGDIR}/PLIST
-.    endif
-.  endif
-_PLIST_SRC=            ${PLIST_SRC}
-.elif ${PLIST_TYPE} == "dynamic"
-_PLIST_SRC=            # empty, since we're using a dynamic PLIST
-.endif
-
-
 # Set PLIST_SUBST to substitute "${variable}" to "value" in PLIST
 PLIST_SUBST+=  OPSYS=${OPSYS}                                          \
                OS_VERSION=${OS_VERSION}                                \
@@ -690,19 +725,6 @@
        @${DO_NADA}
 .endif
 
-# Check that we are using up-to-date pkg_* tools with this file.
-.PHONY: uptodate-pkgtools
-uptodate-pkgtools:
-.      if !defined(NO_PKGTOOLS_REQD_CHECK)
-.              if ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
-PKG_FAIL_REASON+='Error: The package tools installed on this system are out of date.'
-PKG_FAIL_REASON+='The installed package tools are dated ${PKGTOOLS_VERSION:C|(....)(..)(..)|\1/\2/\3|} and you must update'
-PKG_FAIL_REASON+='them to at least ${PKGTOOLS_REQD:C|(....)(..)(..)|\1/\2/\3|} using the following command:'
-PKG_FAIL_REASON+=''
-PKG_FAIL_REASON+='     cd ${PKGSRCDIR}/pkgtools/pkg_install && ${MAKE} clean && ${MAKE} install'
-.              endif
-.      endif
-
 .ifndef PKG_ARGS_COMMON
 PKG_ARGS_COMMON=       -v -c -${COMMENT:Q}" " -d ${DESCR} -f ${PLIST}
 PKG_ARGS_COMMON+=      -l -b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
@@ -751,11 +773,6 @@
 # do something.
 DO_NADA?=              ${TRUE}
 
-# remove after 2005Q1
-.if defined(ALL_TARGET)
-PKG_FAIL_REASON+='ALL_TARGET is deprecated and must be replaced with BUILD_TARGET.'
-.endif
-
 # If this host is behind a filtering firewall, use passive ftp(1)
 .if defined(PASSIVE_FETCH)
 FETCH_BEFORE_ARGS += -p
@@ -812,40 +829,6 @@
 .endif
 _ALLFILES?=    ${_DISTFILES} ${_PATCHFILES}
 
-.if !defined(CATEGORIES) || !defined(DISTNAME)
-PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.'
-.endif
-
-.if defined(LIB_DEPENDS)
-PKG_FAIL_REASON+='LIB_DEPENDS is deprecated and must be replaced with DEPENDS.'
-.endif
-
-.if defined(PKG_PATH)
-PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!'
-.endif
-
-.if defined(MASTER_SITE_SUBDIR)
-PKG_FAIL_REASON+='MASTER_SITE_SUBDIR is deprecated and must be replaced with MASTER_SITES.'
-.endif
-
-.if defined(PATCH_SITE_SUBDIR)
-PKG_FAIL_REASON+='PATCH_SITE_SUBDIR is deprecated and must be replaced with PATCH_SITES.'
-.endif
-
-.if defined(ONLY_FOR_ARCHS) || defined(NOT_FOR_ARCHS) \
-       || defined(ONLY_FOR_OPSYS) || defined(NOT_FOR_OPSYS)
-PKG_FAIL_REASON+='ONLY/NOT_FOR_ARCHS/OPSYS are deprecated and must be replaced with ONLY/NOT_FOR_PLATFORM.'
-.endif
-
-.if (${PKGSRC_LOCKTYPE} == "sleep" || ${PKGSRC_LOCKTYPE} == "once")
-. if !defined(OBJHOSTNAME)



Home | Main Index | Thread Index | Old Index