summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorobache <obache>2012-04-15 13:03:11 +0000
committerobache <obache>2012-04-15 13:03:11 +0000
commit953357545314094448de80178c92f70d369eded0 (patch)
tree3da64a08a25a93ed13b41671288fb138ccf48d28 /pkgtools
parentec7839862342c8b1a7732fac5041678f4e078b1f (diff)
downloadpkgsrc-953357545314094448de80178c92f70d369eded0.tar.gz
Update to 20120415.
Rewrite OpenBSD.bsd.man.mk, based on current NetBSD.bsd.man.mk and changed to use mandoc. Fixes manual pages installation with packages using USE_BSD_MAKEFILE=yes on OpenBSD-5.0.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/bootstrap-mk-files/Makefile4
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk250
2 files changed, 149 insertions, 105 deletions
diff --git a/pkgtools/bootstrap-mk-files/Makefile b/pkgtools/bootstrap-mk-files/Makefile
index efd96bacc8d..e9f9814a592 100644
--- a/pkgtools/bootstrap-mk-files/Makefile
+++ b/pkgtools/bootstrap-mk-files/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.30 2012/03/05 07:26:37 sbd Exp $
+# $NetBSD: Makefile,v 1.31 2012/04/15 13:03:11 obache Exp $
-DISTNAME= bootstrap-mk-files-20120305
+DISTNAME= bootstrap-mk-files-20120415
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk
index bc367109075..f0c6286c1a3 100644
--- a/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk
+++ b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk
@@ -1,137 +1,181 @@
-# $NetBSD: OpenBSD.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
-# From:
-# OpenBSD: bsd.man.mk,v 1.23 2001/07/20 23:02:21 espie Exp
-# NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp
-# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+# $NetBSD: OpenBSD.bsd.man.mk,v 1.2 2012/04/15 13:03:11 obache Exp $
+# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
-MANTARGET?= cat
-NROFF?= nroff -Tascii
-TBL?= tbl
-
-.if !target(.MAIN)
+.if !target(__initialized__)
+__initialized__:
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
-
-.MAIN: all
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
.endif
-.SUFFIXES: .1 .2 .3 .3p .4 .5 .6 .7 .8 .9 .1tbl .2tbl .3tbl .4tbl .5tbl .6tbl \
- .7tbl .8tbl .9tbl .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
- .ps1 .ps2 .ps3 .ps4 .ps5 .ps6 .ps7 .ps8 .ps9
-
-.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3p.cat3p .3.cat3 .2.cat2 .1.cat1:
- @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
- @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
-
-.9tbl.cat9 .8tbl.cat8 .7tbl.cat7 .6tbl.cat6 .5tbl.cat5 .4tbl.cat4 .3tbl.cat3 \
-.2tbl.cat2 .1tbl.cat1:
- @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
- @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
- (rm -f ${.TARGET}; false)
+.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
+.if ${MKMAN} != "no"
+realinstall: ${MANINSTALL}
+.endif
+cleandir: cleanman
-.9.ps9 .8.ps8 .7.ps7 .6.ps6 .5.ps5 .4.ps4 .3p.ps3p .3.ps3 .2.ps2 .1.ps1:
- @echo "nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET}"
- @nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
+HTMLDIR?= ${DESTDIR}/usr/share/man
-.9tbl.ps9 .8tbl.ps8 .7tbl.ps7 .6tbl.ps6 .5tbl.ps5 .4tbl.ps4 .3tbl.ps3 \
-.2tbl.ps2 .1tbl.ps1:
- @echo "${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET}"
- @${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET} || (rm -f ${.TARGET}; false)
+MANTARGET?= cat
+MANDOC?= mandoc -Tascii
-.if defined(MAN) && !empty(MAN) && !defined(MANALL)
-MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.3p$/.cat3p/g:S/.4$/.cat4/g:S/.5$/.cat5/g:S/.6$/.cat6/g:S/.7$/.cat7/g:S/.8$/.cat8/g:S/.9$/.cat9/g:S/.1tbl$/.cat1/g:S/.2tbl$/.cat2/g:S/.3tbl$/.cat3/g:S/.4tbl$/.cat4/g:S/.5tbl$/.cat5/g:S/.6tbl$/.cat6/g:S/.7tbl$/.cat7/g:S/.8tbl$/.cat8/g:S/.9tbl$/.cat9/g}
+.SUFFIXES: .1 .2 .3 .3p .4 .5 .6 .7 .8 .9 \
+ .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
-.if defined(MANPS)
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 3p.cat3p .3.cat3 .2.cat2 .1.cat1:
+ @echo "${MANDOC} ${.IMPSRC} > ${.TARGET}"
+ @${MANDOC} ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
-PSALL= ${MAN:S/.1$/.ps1/g:S/.2$/.ps2/g:S/.3$/.ps3/g:S/.3p$/.ps3p/g:S/.4$/.ps4/g:S/.5$/.ps5/g:S/.6$/.ps6/g:S/.7$/.ps7/g:S/.8$/.ps8/g:S/.9$/.ps9/g:S/.1tbl$/.ps1/g:S/.2tbl$/.ps2/g:S/.3tbl$/.ps3/g:S/.4tbl$/.ps4/g:S/.5tbl$/.ps5/g:S/.6tbl$/.ps6/g:S/.7tbl$/.ps7/g:S/.8tbl$/.ps8/g:S/.9tbl$/.ps9/g}
+.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3p.html3p .3.html3 .2.html2 .1.html1:
+ @echo "${MANDOC} -Thtml ${.IMPSRC} > ${.TARGET}"
+ @${MANDOC} -Thtml ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.if defined(MAN) && !empty(MAN)
+MANPAGES= ${MAN}
+CATPAGES= ${MANPAGES:C/(.*).([1-9]p?)/\1.cat\2/}
+.NOPATH: ${CATPAGES}
+.if !defined(NOHTML)
+HTMLPAGES= ${MANPAGES:C/(.*).([1-9]p?)/\1.html\2/}
.endif
-
.endif
-MINSTALL= ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+
.if defined(MANZ)
# chown and chmod are done afterward automatically
MCOMPRESS= gzip -cf
MCOMPRESSSUFFIX= .gz
.endif
-.if defined(MANSUBDIR)
-# Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping
-MANSUBDIR:=${MANSUBDIR:S,^,/,}
+catinstall: catlinks
+maninstall: manlinks
+
+__installpage: .USE
+.if defined(MCOMPRESS) && !empty(MCOMPRESS)
+ @rm -f ${.TARGET}
+ ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+ @chown ${MANOWN}:${MANGRP} ${.TARGET}
+ @chmod ${MANMODE} ${.TARGET}
.else
-# XXX MANSUBDIR must be non empty for the mlink loops to work
-MANSUBDIR=''
-.endif
-
-maninstall:
-.if defined(MANALL)
- @for page in ${MANALL}; do \
- set -- ${MANSUBDIR}; \
- subdir=$$1; \
- dir=${DESTDIR}${MANDIR}$${page##*.cat}; \
- base=$${page##*/}; \
- instpage=$${dir}$${subdir}/$${base%.*}.0${MCOMPRESSSUFFIX}; \
- if [ X"${MCOMPRESS}" = X ]; then \
- echo ${MINSTALL} $$page $$instpage; \
- ${MINSTALL} $$page $$instpage; \
- else \
- rm -f $$instpage; \
- echo ${MCOMPRESS} $$page \> $$instpage; \
- ${MCOMPRESS} $$page > $$instpage; \
- chown ${MANOWN}:${MANGRP} $$instpage; \
- chmod ${MANMODE} $$instpage; \
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+ ${MINSTALL} ${.ALLSRC} ${.TARGET})
+.endif
+
+
+# Rules for cat'ed man page installation
+.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
+catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${CATPAGES:O:u}
+. if !defined(BUILD) && !make(all) && !make(${P})
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
+. endif
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+catpages::
+.endif
+
+# Rules for source page installation
+.if defined(MANPAGES) && !empty(MANPAGES)
+manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${MANPAGES:O:u}
+${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+manpages::
+.endif
+
+.if ${MKCATPAGES} != "no"
+catlinks: catpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
fi; \
- while test $$# -ge 2; do \
- shift; \
- extra=$${dir}$$1/$${base%.*}.0${MCOMPRESSSUFFIX}; \
- echo $$extra -\> $$instpage; \
- ln -f $$instpage $$extra; \
- done; \
done
.endif
-.if defined(PSALL)
- @for page in ${PSALL}; do \
- set -- ${MANSUBDIR}; \
- subdir=$$1; \
- dir=${DESTDIR}${PSDIR}$${page##*.ps}; \
- base=$${page##*/}; \
- instpage=$${dir}$${subdir}/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
- if [ X"${MCOMPRESS}" = X ]; then \
- echo ${MINSTALL} $$page $$instpage; \
- ${MINSTALL} $$page $$instpage; \
- else \
- rm -f $$instpage; \
- echo ${MCOMPRESS} $$page \> $$instpage; \
- ${MCOMPRESS} $$page > $$instpage; \
- chown ${PSOWN}:${PSGRP} $$instpage; \
- chmod ${PSMODE} $$instpage; \
+.else
+catlinks:
+.endif
+
+manlinks: manpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
fi; \
- while test $$# -ge 2; do \
- shift; \
- extra=$${dir}$$1/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
- echo $$extra -\> $$instpage; \
- ln -f $$instpage $$extra; \
- done; \
done
.endif
-.if defined(MLINKS) && !empty(MLINKS)
-. for sub in ${MANSUBDIR}
-. for lnk file in ${MLINKS}
- @l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk:R}.0${MCOMPRESSSUFFIX}; \
- t=${DESTDIR}${MANDIR}${file:E}${sub}/${file:R}.0${MCOMPRESSSUFFIX}; \
- echo $$t -\> $$l; \
- rm -f $$t; ln $$l $$t;
-. endfor
-. endfor
+
+# PS rules
+ps: ${PSPAGES}
+
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+.for P in ${HTMLPAGES:O:u}
+${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
+ ${MINSTALL} ${.ALLSRC} ${.TARGET}
+.endfor
.endif
+installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
-.if (defined(MANALL) || defined(PSALL)) && !defined(MANLOCALBUILD)
-all: ${MANALL} ${PSALL}
+cleanhtml:
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+ rm -f ${HTMLPAGES}
+.endif
+
+
+.if defined(CATPAGES)
+.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
+realall: ${CATPAGES}
+.else
+realall:
+.endif
-cleandir: cleanman
cleanman:
- rm -f ${MANALL} ${PSALL}
+ rm -f ${CATPAGES}
+.else
+cleanman:
.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags: