Date: Mon, 10 Aug 1998 02:35:49 -0700 (PDT) From: asami@FreeBSD.ORG (Satoshi Asami) To: ac199@hwcn.org Cc: ports@FreeBSD.ORG, markm@FreeBSD.ORG Subject: Re: perl and other fixes to bsd.port.mk Message-ID: <199808100935.CAA01065@silvia.hip.berkeley.edu> In-Reply-To: <19980810035209.C4794@zappo> (message from Tim Vanderhoek on Mon, 10 Aug 1998 03:52:09 -0400)
next in thread | previous in thread | raw e-mail | index | archive | help
* Can you fix the spacing after * * ${ECHO_MSG} "===> * * to be consistent, too? Some of those lines have three spaces, some * of them have two spaces, and one of them has one space. Actually, they're supposed to be either two or three, depending on whether they are the "main" targets or not. See if this looks better. * Haha! A small addition to bsd.port.mk along the lines of * * fixee: * .if ${PLIST} == "${.CURDIR}/pkg/PLIST" * .for x in ${__MANPAGES} * perl -pi -e 'm!$x! && ($$_ = "")' pkg/PLIST * .endfor * .else * @echo "Can't handle ${.CURDIR}" * .endif * * would probably do the trick for most of them (w/ appropriate change to * bsd.subdir.mk), but you're nuts if you think I'm going to do that on * for you! :-) Am I? :) * Done in one big mega-commit, that would hit about 1600 files at * once. Wow. How long would that take.... * .if defined(_MANPAGES) && defined(NOMANCOMPRESS) * __MANPAGES:= ${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g} * .elif defined(_MANPAGES) * __MANPAGES:= ${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/.gz/} * .endif Of course. I wasn't thinking, the whole point of this was to have it generate a correct PLIST no matter the setting of NOMANCOMPRESS. Now, the only remaining thing is something to the equivalent of MLINKS in bsd.man.mk. Do you want to take a stab at that too? * Out of curiousity, under what circumstances will the :S/""// be * used? The default value of MANLANG is "". It is probably not necessary to remove it (the shell will take it out anyway) but it looked ugly when I stuck in some echo statements. ;) * Hmm... This seems to interact correctly with MANPREFIX. Already tested with a bunch of p5-* ports, sir! :) * PLIST_SUB+= PERL_VERSION=5.00501 \ * PERL_VER=5.005 \ * OSREL=${OSREL} * * .for sub in ${PLIST_SUB} * _sedsubplist!= sym=`echo "${sub}" | ${SED} -e 's/=.*//'`; \ * val=`echo "${sub}" | ${SED} -e 's/^[^=][^=]*=//'`; \ * echo "${_sedsubplist} -e s!%%$${sym}%%!$${val}!g" * .endfor That's cool. * @${SED} ${_sedsubplist} ${PLIST} > ${TMPPLIST} >> * The only reason I could think of for testing -e ${PLIST} via the shell * was that ${PLIST} might be created during the make process. However, * since this stuff is being done before the pre-install target and since * bsd.port.mk is called recursively for each new major target, I didn't * see how this could happen. Regardless, I could have been wrong in * changing the test to exists(${PLIST}). :-) I don't know. I changed it here. Let's see if it blows up. * .if PREFIX==/usr * PLIST_SUB= POSSIBLY_INSTALLED_FILE= VARDIR=/var * .else * PLIST_SUB= POSSIBLE_INSTALLED_FILE=bin/netu VARDIR=. * .endif * * Perhaps with a @cwd %%VARDIR%% in the plist. That's evil. ;) Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.227.2.43 diff -u -r1.227.2.43 bsd.port.mk --- bsd.port.mk 1998/08/10 04:03:38 1.227.2.43 +++ bsd.port.mk 1998/08/10 08:47:05 @@ -105,7 +105,7 @@ # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from # the "install" target. # MTREE_FILE - The name of the mtree file (default: /etc/mtree/BSD.x11.dist -# if USE_IMAKE or USE_X11 is set, /etc/mtree/BSD.local.dist +# if USE_X_PREFIX is set, /etc/mtree/BSD.local.dist # otherwise.) # # NO_BUILD - Use a dummy (do-nothing) build target. @@ -128,8 +128,8 @@ # USE_AUTOCONF - Says that the port uses autoconf. Implies GNU_CONFIGURE. # USE_PERL5 - Says that the port uses perl5 for building and running. # USE_IMAKE - Says that the port uses imake. Implies USE_X_PREFIX. -# USE_X_PREFIX - Says that the port installs in ${X11BASE}. Implies USE_X11. -# USE_X11 - Says that the port uses X libraries. +# USE_X_PREFIX - Says that the port installs in ${X11BASE}. Implies USE_XLIB. +# USE_XLIB - Says that the port uses X libraries. # NO_INSTALL_MANPAGES - For imake ports that don't like the install.man # target. # HAS_CONFIGURE - Says that the port has its own configure script. @@ -273,6 +273,7 @@ # Get the operating system revision OSREL!= uname -r | sed -e 's/[-(].*//' +PLIST_SUB+= OSREL=${OSREL} .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -355,7 +356,7 @@ USE_X_PREFIX= yes .endif .if defined(USE_X_PREFIX) -USE_X11= yes +USE_XLIB= yes .endif .if defined(USE_X_PREFIX) PREFIX?= ${X11BASE} @@ -370,14 +371,25 @@ GNU_CONFIGURE= yes BUILD_DEPENDS+= autoconf:${PORTSDIR}/devel/autoconf .endif + +PERL_VERSION= 5.00501 +PERL_VER= 5.005 +PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \ + PERL_VER=${PERL_VER} + .if defined(USE_PERL5) -BUILD_DEPENDS+= perl5.00501:${PORTSDIR}/lang/perl5 -RUN_DEPENDS+= perl5.00501:${PORTSDIR}/lang/perl5 +BUILD_DEPENDS+= perl${PERL_VERSION}:${PORTSDIR}/lang/perl5 +RUN_DEPENDS+= perl${PERL_VERSION}:${PORTSDIR}/lang/perl5 .endif -.if defined(USE_X11) + +.if defined(USE_XLIB) LIB_DEPENDS+= X11\\.6:${PORTSDIR}/x11/XFree86 .endif +.if defined(USE_QT) +LIB_DEPENDS+= qt\\.1\\.\\\(33\\\|40\\\):${PORTSDIR}/x11-toolkits/qt140 +.endif + .if exists(${PORTSDIR}/../Makefile.inc) .include "${PORTSDIR}/../Makefile.inc" .endif @@ -495,10 +507,11 @@ COMMENT?= ${PKGDIR}/COMMENT DESCR?= ${PKGDIR}/DESCR PLIST?= ${PKGDIR}/PLIST +TMPPLIST?= ${WRKDIR}/PLIST.mktmp PKG_CMD?= /usr/sbin/pkg_create .if !defined(PKG_ARGS) -PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`" +PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`" .if exists(${PKGDIR}/INSTALL) PKG_ARGS+= -i ${PKGDIR}/INSTALL .endif @@ -553,6 +566,12 @@ # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} +.for sub in ${PLIST_SUB} +_sedsubplist!= sym=`${ECHO} "${sub}" | ${SED} -e 's/=.*//'`; \ + val=`${ECHO} "${sub}" | ${SED} -e 's/^[^=][^=]*=//'`; \ + echo "${_sedsubplist} -e s!%%$${sym}%%!$${val}!g" +.endfor + ALL_TARGET?= all INSTALL_TARGET?= install @@ -742,6 +761,12 @@ .endfor +.if defined(_MANPAGES) && defined(NOMANCOMPRESS) +__MANPAGES:= ${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g} +.elif defined(_MANPAGES) +__MANPAGES:= ${_MANPAGES:S^${PREFIX}/^^:S/""//:S^//^/^g:S/$/.gz/} +.endif + .if defined(_MANPAGES) && defined(MANCOMPRESSED) _MANPAGES:= ${_MANPAGES:S/$/.gz/} .endif @@ -1204,6 +1229,13 @@ fi .endif .endif +.if (make(real-install) || make(real-package)) && exists(${PLIST}) + @>${TMPPLIST} +.for man in ${__MANPAGES} + @${ECHO} ${man} >> ${TMPPLIST} +.endfor + @${SED} ${_sedsubplist} ${PLIST} >> ${TMPPLIST} +.endif @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/} @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ @@ -1345,7 +1377,7 @@ .if !target(deinstall) deinstall: - @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}" + @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}" @pkg_delete -f ${PKGNAME} @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} .endif @@ -1376,7 +1408,7 @@ fi; \ fi .else - @${RM} -f ${WRKDIR}/.*_done + @${RM} -f ${WRKDIR}/.*_done ${TMPPLIST} .endif .endif @@ -1562,28 +1594,28 @@ fi; \ if expr "$$prog" : \\/ >/dev/null; then \ if [ -e "$$prog" ]; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \ notfound=0; \ else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \ notfound=1; \ fi; \ else \ if which "$$prog" > /dev/null 2>&1 ; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ notfound=0; \ else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ notfound=1; \ fi; \ fi; \ if [ $$notfound != 0 ]; then \ - ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \ + ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \ if [ ! -d "$$dir" ]; then \ - ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \ + ${ECHO_MSG} " >> No directory for $$prog. Skipping.."; \ else \ (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \ - ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ + ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi; \ done @@ -1609,15 +1641,15 @@ target=${DEPENDS_TARGET}; \ fi; \ if /sbin/ldconfig -r | ${GREP} -q -e "-l$$lib"; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - found"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - found"; \ else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - not found"; \ - ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - not found"; \ + ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \ if [ ! -d "$$dir" ]; then \ - ${ECHO_MSG} ">> No directory for $$lib. Skipping.."; \ + ${ECHO_MSG} " >> No directory for $$lib. Skipping.."; \ else \ (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \ - ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ + ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi; \ done @@ -1636,15 +1668,15 @@ else \ target=${DEPENDS_TARGET}; \ fi; \ - ${ECHO_MSG} "===> ${PKGNAME} depends on: $$dir"; \ - ${ECHO_MSG} "===> Verifying $$target for $$dir"; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on: $$dir"; \ + ${ECHO_MSG} "===> Verifying $$target for $$dir"; \ if [ ! -d $$dir ]; then \ - ${ECHO_MSG} ">> No directory for $$dir. Skipping.."; \ + ${ECHO_MSG} " >> No directory for $$dir. Skipping.."; \ else \ (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \ fi \ done - @${ECHO_MSG} "===> Returning to build of ${PKGNAME}" + @${ECHO_MSG} "===> Returning to build of ${PKGNAME}" .endif .else @${DO_NADA} @@ -1727,7 +1759,7 @@ .endif README.html: - @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}" + @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}" @${CAT} ${TEMPLATES}/README.port | \ ${SED} -e 's%%PORT%%'`${ECHO} ${.CURDIR} | ${SED} -e 's.*/\([^/]*/[^/]*\)$$\1'`'g' \ -e 's%%PKG%%${PKGNAME}g' \ @@ -1762,13 +1794,13 @@ .if !target(fake-pkg) fake-pkg: - @if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi + @if [ ! -f ${TMPPLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi .if defined(FORCE_PKG_REGISTER) @${RM} -rf ${PKG_DBDIR}/${PKGNAME} .endif @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \ - ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \ + ${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; \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808100935.CAA01065>