diff options
author | hubertf <hubertf@pkgsrc.org> | 1998-02-20 22:06:18 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 1998-02-20 22:06:18 +0000 |
commit | da9ec0b877731e40c292d0a2dbdb71bb5cb9751c (patch) | |
tree | 4ac56cf5e8a239a673668dac1edac26742523fdd | |
parent | 71712fdd015fbf51a8bc1d9d5d55f2372605f613 (diff) | |
download | pkgsrc-da9ec0b877731e40c292d0a2dbdb71bb5cb9751c.tar.gz |
Enhance look & feel of the generated README.html's.
-rw-r--r-- | mk/bsd.pkg.mk | 36 | ||||
-rw-r--r-- | mk/bsd.port.mk | 36 |
2 files changed, 54 insertions, 18 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index de2f0e5ab4d..36845c2c217 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,7 +1,7 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # -# $NetBSD: bsd.pkg.mk,v 1.48 1998/02/20 21:31:20 hubertf Exp $ +# $NetBSD: bsd.pkg.mk,v 1.49 1998/02/20 22:06:18 hubertf Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1591,11 +1591,29 @@ checksum: fetch # You probably won't need to touch these ################################################################ +HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' + +# Set to YES by the README.html target (and passed via depends-list +# and package-depends) +.ifndef PACKAGE_NAME_AS_LINK +PACKAGE_NAME_AS_LINK=NO +.endif # PACKAGE_NAME_AS_LINK + + # Nobody should want to override this unless PKGNAME is simply bogus. .if !target(package-name) package-name: - @${ECHO} ${PKGNAME} +.if (${PACKAGE_NAME_AS_LINK} == "YES") + @${ECHO} '<A HREF="../../'`${MAKE} package-path | ${HTMLIFY}`'/README.html">'`echo ${PKGNAME} | ${HTMLIFY}`'</A>' +.else + @${ECHO} '${PKGNAME}' +.endif # PACKAGE_NAME_AS_LINK != "" +.endif # !target(package-name) + +.if !target(package-path) +package-path: + @pwd | sed s@`cd ${PORTSDIR} ; pwd`/@@g .endif # Show (recursively) all the packages this package depends on. @@ -1604,7 +1622,7 @@ package-name: package-depends: @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ if [ -d $$dir ]; then \ - (cd $$dir ; ${MAKE} package-name package-depends); \ + (cd $$dir ; ${MAKE} package-name package-depends PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}); \ else \ ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \ fi; \ @@ -1780,7 +1798,7 @@ clean-depends: .if !target(depends-list) depends-list: @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ - (cd $$dir; ${MAKE} package-name depends-list); \ + (cd $$dir; ${MAKE} package-name depends-list PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}; ); \ done .endif @@ -1832,8 +1850,6 @@ readme: @cd ${.CURDIR} && make README.html .endif -HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' - .if (${OPSYS} == "NetBSD") README_NAME= ${TEMPLATES}/README.pkg .else @@ -1842,11 +1858,13 @@ README_NAME= ${TEMPLATES}/README.port README.html: @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}" - @${MAKE} print-depends-list | ${HTMLIFY} >> $@.tmp1 - @${MAKE} print-package-depends | ${HTMLIFY} >> $@.tmp2 + @${MAKE} depends-list PACKAGE_NAME_AS_LINK=YES >> $@.tmp1 + @[ -s $@.tmp1 ] || echo "(none)" >> $@.tmp1 + @${MAKE} package-depends PACKAGE_NAME_AS_LINK=YES >> $@.tmp2 + @[ -s $@.tmp2 ] || echo "(none)" >> $@.tmp2 @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3 @${CAT} ${README_NAME} | \ - ${SED} -e 's/%%PORT%%/'"`basename ${.CURDIR}`"'/g' \ + ${SED} -e 's|%%PORT%%|'"`${MAKE} package-path | ${HTMLIFY}`"'|g' \ -e '/%%PKG%%/r$@.tmp3' \ -e '/%%PKG%%/d' \ -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \ diff --git a/mk/bsd.port.mk b/mk/bsd.port.mk index 78ca1c3fc87..e248023d98e 100644 --- a/mk/bsd.port.mk +++ b/mk/bsd.port.mk @@ -1,7 +1,7 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # -# $NetBSD: bsd.port.mk,v 1.48 1998/02/20 21:31:20 hubertf Exp $ +# $NetBSD: bsd.port.mk,v 1.49 1998/02/20 22:06:18 hubertf Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1591,11 +1591,29 @@ checksum: fetch # You probably won't need to touch these ################################################################ +HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' + +# Set to YES by the README.html target (and passed via depends-list +# and package-depends) +.ifndef PACKAGE_NAME_AS_LINK +PACKAGE_NAME_AS_LINK=NO +.endif # PACKAGE_NAME_AS_LINK + + # Nobody should want to override this unless PKGNAME is simply bogus. .if !target(package-name) package-name: - @${ECHO} ${PKGNAME} +.if (${PACKAGE_NAME_AS_LINK} == "YES") + @${ECHO} '<A HREF="../../'`${MAKE} package-path | ${HTMLIFY}`'/README.html">'`echo ${PKGNAME} | ${HTMLIFY}`'</A>' +.else + @${ECHO} '${PKGNAME}' +.endif # PACKAGE_NAME_AS_LINK != "" +.endif # !target(package-name) + +.if !target(package-path) +package-path: + @pwd | sed s@`cd ${PORTSDIR} ; pwd`/@@g .endif # Show (recursively) all the packages this package depends on. @@ -1604,7 +1622,7 @@ package-name: package-depends: @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ if [ -d $$dir ]; then \ - (cd $$dir ; ${MAKE} package-name package-depends); \ + (cd $$dir ; ${MAKE} package-name package-depends PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}); \ else \ ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \ fi; \ @@ -1780,7 +1798,7 @@ clean-depends: .if !target(depends-list) depends-list: @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ - (cd $$dir; ${MAKE} package-name depends-list); \ + (cd $$dir; ${MAKE} package-name depends-list PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}; ); \ done .endif @@ -1832,8 +1850,6 @@ readme: @cd ${.CURDIR} && make README.html .endif -HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' - .if (${OPSYS} == "NetBSD") README_NAME= ${TEMPLATES}/README.pkg .else @@ -1842,11 +1858,13 @@ README_NAME= ${TEMPLATES}/README.port README.html: @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}" - @${MAKE} print-depends-list | ${HTMLIFY} >> $@.tmp1 - @${MAKE} print-package-depends | ${HTMLIFY} >> $@.tmp2 + @${MAKE} depends-list PACKAGE_NAME_AS_LINK=YES >> $@.tmp1 + @[ -s $@.tmp1 ] || echo "(none)" >> $@.tmp1 + @${MAKE} package-depends PACKAGE_NAME_AS_LINK=YES >> $@.tmp2 + @[ -s $@.tmp2 ] || echo "(none)" >> $@.tmp2 @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3 @${CAT} ${README_NAME} | \ - ${SED} -e 's/%%PORT%%/'"`basename ${.CURDIR}`"'/g' \ + ${SED} -e 's|%%PORT%%|'"`${MAKE} package-path | ${HTMLIFY}`"'|g' \ -e '/%%PKG%%/r$@.tmp3' \ -e '/%%PKG%%/d' \ -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \ |