Annotation of pkgsrc/doc/guide/Makefile, Revision 1.34
1.34 ! rillig 1: # $NetBSD: Makefile,v 1.33 2009/01/09 10:58:47 rillig Exp $
1.1 grant 2: #
3:
1.22 rillig 4: DISTNAME= pkgsrc-guide-${PKGVERSION}
1.1 grant 5: CATEGORIES= # empty
6: MASTER_SITES= ${MASTER_SITE_LOCAL}
1.31 dmcmahil 7: DISTFILES= htdocs-share-20071010.tar.gz
1.1 grant 8:
1.34 ! rillig 9: MAINTAINER= pkgsrc-users@NetBSD.org
1.29 tnn 10: HOMEPAGE= http://www.NetBSD.org/docs/pkgsrc/
1.1 grant 11: COMMENT= The pkgsrc guide
12:
1.28 rillig 13: # To regenerate pkgsrc/doc/pkgsrc.{html,txt} and
1.29 tnn 14: # htdocs/docs/pkgsrc, just run "make regen".
1.1 grant 15:
16: PKGVERSION!= date '+%Y%m%d'
17: DIST_SUBDIR= ${PKGBASE}
1.14 rillig 18: NO_MTREE= yes
1.1 grant 19: USE_LANGUAGES= # empty
1.33 rillig 20: MAKE_ENV+= SED=${SED:Q}
1.1 grant 21:
22: PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
23: DOCDIR= ${PREFIX}/share/doc/pkgsrc
1.15 rillig 24: .if exists(/usr/cvs/htdocs)
1.5 hubertf 25: HTDOCSDIR?= /usr/cvs/htdocs
1.15 rillig 26: .endif
1.23 rillig 27: HTDOCSDIR?= ${.CURDIR}/../../../htdocs
1.1 grant 28:
29: BUILD_DEFS+= OUTPUTS
1.8 hubertf 30: OUTPUTS?= lint html html-split ascii pdf
1.1 grant 31:
1.16 tv 32: .if defined(OUTPUTS)
33: . if !empty(OUTPUTS:Mascii)
1.1 grant 34: # the html is needed to build the ascii version.
35: OUTPUTS+= html
1.16 tv 36: . endif
1.1 grant 37:
1.16 tv 38: # only override the Makefile.common default if it is explicitly set
39: _GUIDE_OUTPUTS= ${OUTPUTS}
1.1 grant 40: .endif
41:
1.16 tv 42: .include "Makefile.common"
1.1 grant 43:
1.18 rillig 44: # The source files are only symlinked into the WRKSRC, so that they can
45: # be easily modified, should the "lint" phase fail.
1.1 grant 46: pre-extract:
1.9 ben 47: ${MKDIR} ${WRKSRC}
1.22 rillig 48: ${LN} -s ${FILESDIR}/* ${WRKSRC}
1.1 grant 49:
50: do-build:
51: .for _output_ in ${OUTPUTS}
1.30 dmcmahil 52: @${ECHO} "-----> Building ${_output_} output"
1.1 grant 53: @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${_output_}
54: .endfor
55:
1.2 grant 56: post-build:
57: @${RM} -f ${WRKSRC}/pkgsrc.tmp.html
58:
1.1 grant 59: do-install:
60: ${INSTALL_DATA_DIR} ${DOCDIR}
61: .if !empty(OUTPUTS:Mhtml) || !empty(OUTPUTS:Mhtml-split)
62: ${INSTALL_DATA} ${WRKSRC}/*.html ${DOCDIR}
1.29 tnn 63: ${INSTALL_DATA} ${WRKDIR}/htdocs/global.css ${DOCDIR}
1.1 grant 64: .endif
65: .if !empty(OUTPUTS:Mascii)
66: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.txt ${DOCDIR}
67: .endif
68: .if !empty(OUTPUTS:Mpdf)
69: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.ps ${DOCDIR}
70: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.pdf ${DOCDIR}
71: .endif
72:
73: post-install:
1.22 rillig 74: ${FIND} ${DOCDIR} \( -type f -o -type l \) -print \
1.1 grant 75: | ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \
76: >> ${PLIST_SRC}
1.22 rillig 77: ${FIND} ${DOCDIR} -type d -print \
1.1 grant 78: | ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \
79: >> ${PLIST_SRC}
80:
81: # install the single-file HTML and ascii output into the pkgsrc doc/
82: # directory, for distribution with pkgsrc.
83: #
1.23 rillig 84: # note that this uses ${CP} and not ${INSTALL_DATA} because the files
85: # stay in the development directories and have nothing to do with
86: # the permissions or ownership of installed files.
1.1 grant 87: #
88: install-doc: build
1.23 rillig 89: ${CP} ${WRKSRC}/pkgsrc.html ${PKGSRCDIR}/doc
90: ${CP} ${WRKSRC}/pkgsrc.txt ${PKGSRCDIR}/doc
1.1 grant 91:
1.5 hubertf 92: install-htdocs: build
1.23 rillig 93: cd ${WRKSRC} && ${CP} pkgsrc.txt pkgsrc.pdf pkgsrc.ps *.html \
1.29 tnn 94: ${HTDOCSDIR}/docs/pkgsrc
1.5 hubertf 95:
1.25 rillig 96: .PHONY: regen regen-doc regen-htdocs
97: regen: regen-doc regen-htdocs
1.23 rillig 98:
1.25 rillig 99: regen-doc: build
1.23 rillig 100: @${STEP_MSG} "Updating the files in pkgsrc/doc"
101: cd .. && cvs update pkgsrc.*
102: ${MAKE} ${MAKEFLAGS} install-doc
103: @${STEP_MSG} "Committing the files in pkgsrc/doc"
1.25 rillig 104: cd .. && cvs commit -m "regen" pkgsrc.*
1.23 rillig 105:
1.25 rillig 106: regen-htdocs: build
1.23 rillig 107: @${STEP_MSG} "Updating the files in htdocs"
1.29 tnn 108: cd ${HTDOCSDIR}/docs/pkgsrc && cvs update
1.23 rillig 109: ${MAKE} ${MAKEFLAGS} install-htdocs
110: @${STEP_MSG} "Committing the files in htdocs"
1.29 tnn 111: cd ${HTDOCSDIR}/docs/pkgsrc && cvs commit -m "regen"
1.23 rillig 112:
1.7 hubertf 113: do-lint:
1.23 rillig 114: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} lint
1.7 hubertf 115:
1.11 rillig 116: DETAB_PROGRAM= \
117: if (/<programlisting>/ .. /<\/programlisting>/) { \
118: while (/(.*?)\t(.*)/s) { \
119: my $$filler = " " x (8 - (length($$1) % 8)); \
120: $$_ = "$$1$$filler$$2"; \
121: } \
122: }
123:
124: # remove tabulators from the <programlisting> tags.
125: # TeX does not like them.
126: .PHONY: detab
127: detab:
1.21 rillig 128: cd ${FILESDIR} && \
129: perl -p -i".detab.tmp" -e '${DETAB_PROGRAM}' *.xml && \
1.11 rillig 130: ${RM} -f *.xml.detab.tmp
131:
1.26 rillig 132: # Generates a new htdocs-share-*.tar.gz archive from the current
133: # contents of the htdocs directory. To make it available, it should
134: # be copied to ftp.NetBSD.org/pub/pkgsrc/distfiles/LOCAL_PORTS/.
135: .PHONY: htdocs-share
136: htdocs-share:
137: cd ${HTDOCSDIR} \
1.31 dmcmahil 138: && ${PAX} -wz -f ${.CURDIR}/htdocs-share-${PKGVERSION}.tar.gz \
1.26 rillig 139: -s ',^,htdocs/,' \
1.29 tnn 140: global.css share
1.26 rillig 141:
1.1 grant 142: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>