diff options
author | agc <agc@pkgsrc.org> | 1997-11-21 17:44:11 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1997-11-21 17:44:11 +0000 |
commit | 0d929991a3a9df282a523b51ffcdd5bf70969f9a (patch) | |
tree | 0c08b6b47c93c845a53a9e80cf979c44e59bb13f | |
parent | f0a82f7acbe033af8cf85b99258576c1aa966e54 (diff) | |
download | pkgsrc-0d929991a3a9df282a523b51ffcdd5bf70969f9a.tar.gz |
Remove the magic control characters in a similar way to Bill Fenner's
patch for bsd.port.subdir.mk.
-rw-r--r-- | mk/bsd.pkg.mk | 27 | ||||
-rw-r--r-- | mk/bsd.port.mk | 27 |
2 files changed, 42 insertions, 12 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index e7f29634f1a..433f8e26d2b 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.18 1997/11/19 16:41:21 agc Exp $ +# $NetBSD: bsd.pkg.mk,v 1.19 1997/11/21 17:44:11 agc Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1731,16 +1731,31 @@ 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 +README_NAME= ${TEMPLATES}/README.port +.endif + README.html: @${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' \ + @${MAKE} print-depends-list | ${HTMLIFY} >> $@.tmp1 + @${MAKE} print-package-depends | ${HTMLIFY} >> $@.tmp2 + @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3 + @${CAT} ${README_NAME} | \ + ${SED} -e 's/%%PORT%%/'"`basename ${.CURDIR}`"'/g' \ + -e '/%%PKG%%/r$@.tmp3' \ + -e '/%%PKG%%/d' \ -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \ -e '/%%COMMENT%%/d' \ - -e 's%%BUILD_DEPENDS%%'"`${MAKE} print-depends-list`"'' \ - -e 's%%RUN_DEPENDS%%'"`${MAKE} print-package-depends`"'' \ + -e '/%%BUILD_DEPENDS%%/r$@.tmp1' \ + -e '/%%BUILD_DEPENDS%%/d' \ + -e '/%%RUN_DEPENDS%%/r$@.tmp2' \ + -e '/%%RUN_DEPENDS%%/d' \ >> $@ + @rm -f $@.tmp1 $@.tmp2 $@.tmp3 .if !target(print-depends-list) print-depends-list: diff --git a/mk/bsd.port.mk b/mk/bsd.port.mk index f5b809fba0a..4fdcd0476e9 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.18 1997/11/19 16:41:21 agc Exp $ +# $NetBSD: bsd.port.mk,v 1.19 1997/11/21 17:44:11 agc Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1731,16 +1731,31 @@ 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 +README_NAME= ${TEMPLATES}/README.port +.endif + README.html: @${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' \ + @${MAKE} print-depends-list | ${HTMLIFY} >> $@.tmp1 + @${MAKE} print-package-depends | ${HTMLIFY} >> $@.tmp2 + @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3 + @${CAT} ${README_NAME} | \ + ${SED} -e 's/%%PORT%%/'"`basename ${.CURDIR}`"'/g' \ + -e '/%%PKG%%/r$@.tmp3' \ + -e '/%%PKG%%/d' \ -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \ -e '/%%COMMENT%%/d' \ - -e 's%%BUILD_DEPENDS%%'"`${MAKE} print-depends-list`"'' \ - -e 's%%RUN_DEPENDS%%'"`${MAKE} print-package-depends`"'' \ + -e '/%%BUILD_DEPENDS%%/r$@.tmp1' \ + -e '/%%BUILD_DEPENDS%%/d' \ + -e '/%%RUN_DEPENDS%%/r$@.tmp2' \ + -e '/%%RUN_DEPENDS%%/d' \ >> $@ + @rm -f $@.tmp1 $@.tmp2 $@.tmp3 .if !target(print-depends-list) print-depends-list: |