Index: bsd.port.mk =================================================================== RCS file: /usr/home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.488 diff -u -r1.488 bsd.port.mk --- bsd.port.mk 19 Apr 2004 23:39:52 -0000 1.488 +++ bsd.port.mk 3 May 2004 10:11:06 -0000 @@ -764,13 +764,11 @@ # to turn them off (default: ${ECHO_CMD}). # PATCH_DEBUG - If set, print out more information about the patches as # it attempts to apply them. -# PKG_DBDIR - Where package installation is recorded; this directory -# must not contain anything else (default: /var/db/pkg). # PORT_DBDIR - Where port configuration options are recorded # (default: /var/db/ports) # NO_PKG_REGISTER - Don't register a port installation as a package. # FORCE_PKG_REGISTER - If set, it will overwrite any existing package -# registration information in ${PKG_DBDIR}/${PKGNAME}. +# registration information. # NO_DEPENDS - Don't verify build of dependencies. # NO_CHECKSUM - Don't verify the checksum. Typically used when # when you noticed the distfile you just fetched has @@ -1394,7 +1392,6 @@ LIB_DEPENDS+= GL.14:${PORTSDIR}/graphics/mesagl .endif XAWVER= 6 -PKG_IGNORE_DEPENDS?= '^XFree86-3\.' .else .if defined(USE_IMAKE) BUILD_DEPENDS+= ${X11BASE}/lib/X11/config/date.def:${PORTSDIR}/devel/imake-4 @@ -1404,7 +1401,6 @@ USE_XLIB= yes .endif XAWVER= 7 -PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist' .endif PLIST_SUB+= XAWVER=${XAWVER} @@ -1779,12 +1775,10 @@ PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME} .endif -.if exists(${LOCALBASE}/sbin/pkg_info) -PKG_CMD?= ${LOCALBASE}/sbin/pkg_create -PKG_ADD?= ${LOCALBASE}/sbin/pkg_add -PKG_DELETE?= ${LOCALBASE}/sbin/pkg_delete -PKG_INFO?= ${LOCALBASE}/sbin/pkg_info -PKG_VERSION?= ${LOCALBASE}/sbin/pkg_version +.if exists(/root/bin/fpkg) +PKG_CREATE?= /root/bin/fpkg_create +PKG_ADD?= /root/bin/fpkg_add +PKG_CMD?= /root/bin/fpkg .elif ${OSVERSION} < 460102 && ${PKGORIGIN} != "sysutils/pkg_install" BUILD_DEPENDS+= ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/sysutils/pkg_install PKG_CMD?= ${LOCALBASE}/sbin/pkg_create @@ -1803,13 +1797,13 @@ # Does the pkg_create tool support conflict checking? # XXX Slow? .if !defined(PKGINSTALLVER) -PKGINSTALLVER!= ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //' +PKGINSTALLVER!= ${PKG_CMD} -V 2>/dev/null | ${SED} -e 's/ .*//' .endif .if ${PKGINSTALLVER} < 20030417 DISABLE_CONFLICTS= YES .endif .if !defined(PKG_ARGS) -PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS} +PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} `cd ${.CURDIR} && ${MAKE} package-depends-args` ${EXTRA_PKG_ARGS} .if !defined(NO_MTREE) PKG_ARGS+= -m ${MTREE_FILE} .endif @@ -1819,6 +1813,23 @@ .if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS) PKG_ARGS+= -C "${CONFLICTS}" .endif +.if exists(${PKGINSTALL}) +PKG_ARGS+= -i ${PKGINSTALL} +.endif +.if exists(${PKGDEINSTALL}) +PKG_ARGS+= -k ${PKGDEINSTALL} +.endif +.if exists(${PKGREQ}) +PKG_ARGS+= -r ${PKGREQ} +.endif +.if exists(${PKGMESSAGE}) +PKG_ARGS+= -D ${PKGMESSAGE} +.endif +.endif +.if defined(FORCE_PKG_REGISTER) +PKG_FORCE_ARG= -f +.else +PKG_FORCE_ARG= .endif .if defined(PKG_NOCOMPRESS) PKG_SUFX?= .tar @@ -1829,8 +1840,6 @@ PKG_SUFX?= .tgz .endif .endif -# where pkg_add records its dirty deeds. -PKG_DBDIR?= /var/db/pkg MOTIFLIB?= -L${X11BASE}/lib -lXm -lXp @@ -2337,7 +2346,7 @@ CONFIGURE_LOG?= config.log # A default message to print if do-configure fails. -CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. an \`ls ${PKG_DBDIR}\`)." +CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (i.e. \`pkg_info\`)." .if defined(GNU_CONFIGURE) # Maximum command line length @@ -3087,7 +3096,7 @@ found=`${CAT} ${WRKDIR}/.CONFLICTS | ${SED} -e s'|${PKG_DBDIR}/||g' | ${TR} '\012' ' '`; \ conflicting=0; \ for entry in $${found}; do \ - prfx=`${PKG_INFO} -q -p $${entry} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ + prfx=`${PKG_CMD} -q info -p $${entry} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ if [ "x${PREFIX}" = "x$${prfx}" ]; then \ conflicting=1;\ conflicts_with="$${conflicts_with} $${entry}";\ @@ -3148,20 +3157,7 @@ fi; \ fi @__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \ - _LATE_PKG_ARGS=""; \ - if [ -f ${PKGINSTALL} ]; then \ - _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -i ${PKGINSTALL}"; \ - fi; \ - if [ -f ${PKGDEINSTALL} ]; then \ - _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -k ${PKGDEINSTALL}"; \ - fi; \ - if [ -f ${PKGREQ} ]; then \ - _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -r ${PKGREQ}"; \ - fi; \ - if [ -f ${PKGMESSAGE} ]; then \ - _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -D ${PKGMESSAGE}"; \ - fi; \ - if ${PKG_CMD} ${PKG_ARGS} ${PKGFILE}; then \ + if ${PKG_CREATE} ${PKG_ARGS} ${PKGFILE}; then \ if [ -d ${PACKAGES} ]; then \ cd ${.CURDIR} && eval ${MAKE} $${__softMAKEFLAGS} package-links; \ fi; \ @@ -3230,34 +3226,16 @@ .if !target(check-already-installed) check-already-installed: .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER) - @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed" - @${MKDIR} ${PKG_DBDIR} - @already_installed=`${PKG_INFO} -q -O ${PKGORIGIN}`; \ - if [ -n "$${already_installed}" ]; then \ - for p in $${already_installed}; do \ - prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ - if [ "x${PREFIX}" = "x$${prfx}" ]; then \ - df=`${PKG_INFO} -q -f $${p} 2> /dev/null | ${GREP} -v "^@" | ${COMM} -12 - ${TMPPLIST}`; \ - if [ -n "$${df}" ]; then \ - found_package=$${p}; \ - break; \ - fi; \ - fi; \ - done; \ - fi; \ - if [ -d ${PKG_DBDIR}/${PKGNAME} -o -n "$${found_package}" ]; then \ - if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \ - ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \ - else \ - ${ECHO_CMD} "===> An older version of ${PKGORIGIN} is already installed ($${found_package})"; \ - fi; \ - ${ECHO_CMD} " You may wish to \`\`make deinstall'' and install this port again"; \ - ${ECHO_CMD} " by \`\`make reinstall'' to upgrade it properly."; \ - ${ECHO_CMD} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \ - ${ECHO_CMD} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \ - ${ECHO_CMD} " in your environment or the \"make install\" command line."; \ - exit 1; \ - fi + @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed" + @if ${PKG_CMD} -e ${PKGNAME}; then \ + ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \ + ${ECHO_CMD} " You may wish to \`\`make deinstall'' and install this port again"; \ + ${ECHO_CMD} " by \`\`make reinstall'' to upgrade it properly."; \ + ${ECHO_CMD} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \ + ${ECHO_CMD} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \ + ${ECHO_CMD} " in your environment or the \"make install\" command line."; \ + exit 1; \ + fi .else @${DO_NADA} .endif @@ -3487,9 +3465,9 @@ _BUILD_SEQ= build-message pre-build pre-build-script do-build \ post-build post-build-script _INSTALL_DEP= build -_INSTALL_SEQ= install-message check-conflicts \ +_INSTALL_SEQ= install-message \ run-depends lib-depends pre-install pre-install-script \ - generate-plist check-already-installed + generate-plist check-already-installed check-plist-conflicts _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install post-install add-plist-info \ post-install-script add-plist-docs compress-man run-ldconfig fake-pkg \ @@ -3658,22 +3636,8 @@ @${ECHO_MSG} "===> Returning to user credentials" .else @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}" - @found_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \ - for p in $${found_names}; do \ - check_name=`${ECHO_CMD} $${p} | ${SED} -e 's/-[^-]*$$//'`; \ - if [ "$${check_name}" = "${PKGBASE}" ]; then \ - prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ - if [ "x${PREFIX}" = "x$${prfx}" ]; then \ - ${ECHO_MSG} "===> Deinstalling $${p}"; \ - ${PKG_DELETE} -f $${p}; \ - else \ - ${ECHO_MSG} "===> $${p} has a different PREFIX: $${prfx}, skipping"; \ - fi; \ - fi; \ - done; \ - if [ -z "$${found_names}" ]; then \ - ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \ - fi +# XXX: (reg) This needs work. + @${PKG_CMD} ${PKG_FORCE_ARG} -p ${PREFIX} -o delete ${PKGORIGIN} @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} .endif .endif @@ -3691,15 +3655,8 @@ @${ECHO_MSG} "===> Returning to user credentials" .else @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}" - @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \ - if [ -n "$${deinstall_names}" ]; then \ - for d in $${deinstall_names}; do \ - ${ECHO_MSG} "===> Deinstalling $${d}"; \ - ${PKG_DELETE} -f $${d}; \ - done; \ - else \ - ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \ - fi +# XXX: (reg) This needs work. + @${PKG_CMD} ${PKG_FORCE_ARG} -o delete ${PKGORIGIN} @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} .endif .endif @@ -4221,7 +4178,7 @@ else \ (cd $$dir; \ tmp=`${MAKE} -V PKGNAME`; \ - if [ ! -d ${PKG_DBDIR}/$${tmp} ]; then \ + if ! ${PKG_CMD} -e $${tmp}; then \ ${MAKE} fetch; \ fi ); \ fi; \ @@ -4249,7 +4206,7 @@ else \ (cd $$dir; \ tmp=`${MAKE} -V PKGNAME`; \ - if [ ! -d ${PKG_DBDIR}/$${tmp} ]; then \ + if ! ${PKG_CMD} -e $${tmp}; then \ ${MAKE} fetch-list; \ fi ); \ fi; \ @@ -4307,7 +4264,7 @@ PACKAGE-DEPENDS-LIST?= \ if [ "${CHILD_DEPENDS}" ]; then \ - installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \ + installed=$$(${PKG_CMD} -qo list ${PKGORIGIN}:${PKGNAME} 2>/dev/null || \ ${TRUE}); \ if [ "$$installed" ]; then \ break; \ @@ -4341,11 +4298,45 @@ # Print out package names. -package-depends: -.if ${OSVERSION} >= 460102 || exists(${LOCALBASE}/sbin/pkg_info) - @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}' +package-depends-args: +.if defined(LIB_DEPENDS) + @for i in ${LIB_DEPENDS}; do \ + pkgdep=`${ECHO_CMD} $$i | ${SED} -e 's/:.*//'`; \ + ${ECHO_CMD} "-L $$pkgdep"; \ + done | sort -u +.endif +.if defined(RUN_DEPENDS) + @for i in ${RUN_DEPENDS}; do \ + pkgdep=`${ECHO_CMD} $$i | ${SED} -e 's/:.*//'`; \ + ${ECHO_CMD} "-R $$pkgdep"; \ + done | sort -u +.endif +.if defined(DEPENDS) + @for dir in $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | sort -u); do \ + if [ -d $$dir ]; then \ + pkgdep=`cd $$dir; ${MAKE} -V PKGNAME`; \ + pkgorg=`cd $$dir; ${MAKE} -V PKGORIGIN`; \ + ${ECHO_CMD} "-P $$pkgdep:$$pkgorg"; \ + else \ + ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \ + fi; \ + done | sort -u +.endif + +.if !target(check-plist-conflicts) +check-plist-conflicts: +.if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER) + @${ECHO_MSG} "===> Checking if this package will overwrite some existing files." + @conflicts=`(${ECHO} "@cwd ${PREFIX}"; ${ECHO} "@name ${PKGNAME}"; \ + ${CAT} ${TMPPLIST}) | ${PKG_CMD} which -P - )`; \ + if [ ! -z $${conflicts} ]; then \ + ${ECHO_CMD} "===> WARNING: This port will overwrite some files installed by the"; \ + ${ECHO_CMD} " following package(s):" $${conflicts:-"unknown"}; \ + exit 1; \ + fi .else - @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1}' + @${DO_NADA} +.endif .endif # Build packages for port and dependencies @@ -4620,50 +4611,8 @@ .if !target(fake-pkg) fake-pkg: .if !defined(NO_PKG_REGISTER) - @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi - @${RM} -f /tmp/${PKGNAME}-required-by -.if defined(FORCE_PKG_REGISTER) - @if [ -e ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY ]; then \ - ${CP} ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY /tmp/${PKGNAME}-required-by; \ - fi - @${RM} -rf ${PKG_DBDIR}/${PKGNAME} -.endif - @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \ - ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \ - ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \ - ${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \ - ${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \ - ${ECHO_CMD} ${COMMENT:Q} > ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \ - if [ -f ${PKGINSTALL} ]; then \ - ${CP} ${PKGINSTALL} ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \ - fi; \ - if [ -f ${PKGDEINSTALL} ]; then \ - ${CP} ${PKGDEINSTALL} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \ - fi; \ - if [ -f ${PKGREQ} ]; then \ - ${CP} ${PKGREQ} ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \ - fi; \ - if [ -f ${PKGMESSAGE} ]; then \ - ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \ - fi; \ - for dep in `${PKG_INFO} -qf ${PKGNAME} | ${GREP} -w ^@pkgdep | ${AWK} '{print $$2}' | sort -u`; do \ - if [ -d ${PKG_DBDIR}/$$dep -a -z `${ECHO_CMD} $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \ - if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \ - >/dev/null 2>&1; then \ - ${ECHO_CMD} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \ - fi; \ - fi; \ - done; \ - fi -.if !defined(NO_MTREE) - @if [ -f ${MTREE_FILE} ]; then \ - ${CP} ${MTREE_FILE} ${PKG_DBDIR}/${PKGNAME}/+MTREE_DIRS; \ - fi -.endif - @if [ -e /tmp/${PKGNAME}-required-by ]; then \ - ${CAT} /tmp/${PKGNAME}-required-by >> ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY; \ - ${RM} -f /tmp/${PKGNAME}-required-by; \ - fi + @${ECHO_MSG} "===> Registering installation for ${PKGNAME}" + @${PKG_CREATE} ${PKG_ARGS} -O ${PKGNAME} | ${PKG_ADD} -v ${PKG_FORCE_ARG} -O .else @${DO_NADA} .endif