Annotation of pkgsrc/doc/guide/Makefile, Revision 1.61
1.61 ! rillig 1: # $NetBSD: Makefile,v 1.60 2020/02/23 17:43:20 rillig Exp $
1.1 grant 2:
1.22 rillig 3: DISTNAME= pkgsrc-guide-${PKGVERSION}
1.1 grant 4: CATEGORIES= # empty
5: MASTER_SITES= ${MASTER_SITE_LOCAL}
1.59 leot 6: DISTFILES= htdocs-share-20200106.tar.gz
1.1 grant 7:
1.34 rillig 8: MAINTAINER= pkgsrc-users@NetBSD.org
1.29 tnn 9: HOMEPAGE= http://www.NetBSD.org/docs/pkgsrc/
1.1 grant 10: COMMENT= The pkgsrc guide
11:
1.28 rillig 12: # To regenerate pkgsrc/doc/pkgsrc.{html,txt} and
1.29 tnn 13: # htdocs/docs/pkgsrc, just run "make regen".
1.1 grant 14:
15: PKGVERSION!= date '+%Y%m%d'
16: DIST_SUBDIR= ${PKGBASE}
17: USE_LANGUAGES= # empty
1.33 rillig 18: MAKE_ENV+= SED=${SED:Q}
1.1 grant 19:
1.58 ryoon 20: PLIST_VARS= ascii html pdf epub
1.37 wiz 21:
1.1 grant 22: DOCDIR= ${PREFIX}/share/doc/pkgsrc
1.15 rillig 23: .if exists(/usr/cvs/htdocs)
1.5 hubertf 24: HTDOCSDIR?= /usr/cvs/htdocs
1.15 rillig 25: .endif
1.23 rillig 26: HTDOCSDIR?= ${.CURDIR}/../../../htdocs
1.1 grant 27:
28: BUILD_DEFS+= OUTPUTS
1.8 hubertf 29: OUTPUTS?= lint html html-split ascii pdf
1.1 grant 30:
1.37 wiz 31: INSTALLATION_DIRS= ${DOCDIR}
32:
1.40 rillig 33: SUBST_CLASSES+= docbook45
34: SUBST_STAGE.docbook45= pre-configure
35: SUBST_FILES.docbook45= ${WRKDIR}/htdocs/share/xml/*
36: SUBST_SED.docbook45= -e 's,V4\.2,V4.5,'
37: SUBST_SED.docbook45+= -e 's,/4\.2/,/4.5/,'
38:
1.16 tv 39: .if defined(OUTPUTS)
40: . if !empty(OUTPUTS:Mascii)
1.1 grant 41: # the html is needed to build the ascii version.
42: OUTPUTS+= html
1.37 wiz 43: PLIST.ascii= yes
1.16 tv 44: . endif
1.1 grant 45:
1.37 wiz 46: . if !empty(OUTPUTS:Mhtml) || !empty(OUTPUTS:Mhtml-split)
47: PLIST.html= yes
48: .endif
49:
50: . if !empty(OUTPUTS:Mpdf)
51: PLIST.pdf= yes
52: .endif
53:
1.58 ryoon 54: . if !empty(OUTPUTS:Mepub)
55: PLIST.epub= yes
56: .endif
57:
1.16 tv 58: # only override the Makefile.common default if it is explicitly set
59: _GUIDE_OUTPUTS= ${OUTPUTS}
1.1 grant 60: .endif
61:
1.16 tv 62: .include "Makefile.common"
1.1 grant 63:
1.18 rillig 64: # The source files are only symlinked into the WRKSRC, so that they can
65: # be easily modified, should the "lint" phase fail.
1.1 grant 66: pre-extract:
1.9 ben 67: ${MKDIR} ${WRKSRC}
1.22 rillig 68: ${LN} -s ${FILESDIR}/* ${WRKSRC}
1.1 grant 69:
1.54 rillig 70: pre-configure: generate-help-topics
1.53 rillig 71: generate-help-topics: .PHONY
72: ${RUN} ${MAKE} help topic=:index > ${WRKSRC}/help-topics.data
1.55 rillig 73: ${RUN} cd ${WRKSRC} && env PKGSRCDIR=${PKGSRCDIR} python fill-placeholders.py *.xml
1.53 rillig 74:
1.1 grant 75: do-build:
76: .for _output_ in ${OUTPUTS}
1.30 dmcmahil 77: @${ECHO} "-----> Building ${_output_} output"
1.1 grant 78: @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${_output_}
79: .endfor
80:
1.2 grant 81: post-build:
82: @${RM} -f ${WRKSRC}/pkgsrc.tmp.html
1.60 rillig 83: ${RUN} cd ${WRKSRC}; \
84: ${GREP} 'idm[0-9][0-9][0-9][0-9][0-9]' ./*.html || exit 0; \
85: ${FAIL_MSG} "[post-build] HTML files contain generated IDs."
1.61 ! rillig 86: # These IDs generate unnecessary changes to the generated files,
! 87: # when they are committed to pkgsrc/doc/ and htdocs.
1.2 grant 88:
1.1 grant 89: do-install:
90: .if !empty(OUTPUTS:Mhtml) || !empty(OUTPUTS:Mhtml-split)
1.37 wiz 91: ${INSTALL_DATA} ${WRKSRC}/*.html ${DESTDIR}${DOCDIR}
92: ${INSTALL_DATA} ${WRKDIR}/htdocs/global.css ${DESTDIR}${DOCDIR}
1.1 grant 93: .endif
94: .if !empty(OUTPUTS:Mascii)
1.37 wiz 95: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.txt ${DESTDIR}${DOCDIR}
1.1 grant 96: .endif
97: .if !empty(OUTPUTS:Mpdf)
1.37 wiz 98: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.ps ${DESTDIR}${DOCDIR}
99: ${INSTALL_DATA} ${WRKSRC}/pkgsrc.pdf ${DESTDIR}${DOCDIR}
1.1 grant 100: .endif
101:
102: # install the single-file HTML and ascii output into the pkgsrc doc/
103: # directory, for distribution with pkgsrc.
104: #
1.23 rillig 105: # note that this uses ${CP} and not ${INSTALL_DATA} because the files
106: # stay in the development directories and have nothing to do with
107: # the permissions or ownership of installed files.
1.1 grant 108: #
109: install-doc: build
1.23 rillig 110: ${CP} ${WRKSRC}/pkgsrc.html ${PKGSRCDIR}/doc
111: ${CP} ${WRKSRC}/pkgsrc.txt ${PKGSRCDIR}/doc
1.1 grant 112:
1.5 hubertf 113: install-htdocs: build
1.23 rillig 114: cd ${WRKSRC} && ${CP} pkgsrc.txt pkgsrc.pdf pkgsrc.ps *.html \
1.29 tnn 115: ${HTDOCSDIR}/docs/pkgsrc
1.5 hubertf 116:
1.25 rillig 117: .PHONY: regen regen-doc regen-htdocs
118: regen: regen-doc regen-htdocs
1.23 rillig 119:
1.25 rillig 120: regen-doc: build
1.23 rillig 121: @${STEP_MSG} "Updating the files in pkgsrc/doc"
122: cd .. && cvs update pkgsrc.*
123: ${MAKE} ${MAKEFLAGS} install-doc
124: @${STEP_MSG} "Committing the files in pkgsrc/doc"
1.47 leot 125: cd .. && cvs commit -m "doc/pkgsrc.*: regen" pkgsrc.*
1.23 rillig 126:
1.25 rillig 127: regen-htdocs: build
1.23 rillig 128: @${STEP_MSG} "Updating the files in htdocs"
1.29 tnn 129: cd ${HTDOCSDIR}/docs/pkgsrc && cvs update
1.23 rillig 130: ${MAKE} ${MAKEFLAGS} install-htdocs
131: @${STEP_MSG} "Committing the files in htdocs"
1.29 tnn 132: cd ${HTDOCSDIR}/docs/pkgsrc && cvs commit -m "regen"
1.23 rillig 133:
1.7 hubertf 134: do-lint:
1.23 rillig 135: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} lint
1.7 hubertf 136:
1.11 rillig 137: DETAB_PROGRAM= \
138: if (/<programlisting>/ .. /<\/programlisting>/) { \
139: while (/(.*?)\t(.*)/s) { \
140: my $$filler = " " x (8 - (length($$1) % 8)); \
141: $$_ = "$$1$$filler$$2"; \
142: } \
143: }
144:
145: # remove tabulators from the <programlisting> tags.
146: # TeX does not like them.
147: .PHONY: detab
148: detab:
1.21 rillig 149: cd ${FILESDIR} && \
150: perl -p -i".detab.tmp" -e '${DETAB_PROGRAM}' *.xml && \
1.11 rillig 151: ${RM} -f *.xml.detab.tmp
152:
1.26 rillig 153: # Generates a new htdocs-share-*.tar.gz archive from the current
154: # contents of the htdocs directory. To make it available, it should
1.48 leot 155: # be copied to ftp.NetBSD.org:/pub/pkgsrc/distfiles/LOCAL_PORTS/, i.e.:
156: #
157: # % scp htdocs-share-*.tar.gz ftp.NetBSD.org:/pub/pkgsrc/distfiles/LOCAL_PORTS/
158: # [... adjust DISTFILES variable ...]
159: # % make makesum
160: #
1.26 rillig 161: .PHONY: htdocs-share
162: htdocs-share:
163: cd ${HTDOCSDIR} \
1.31 dmcmahil 164: && ${PAX} -wz -f ${.CURDIR}/htdocs-share-${PKGVERSION}.tar.gz \
1.26 rillig 165: -s ',^,htdocs/,' \
1.29 tnn 166: global.css share
1.26 rillig 167:
1.54 rillig 168: PYTHON_FOR_BUILD_ONLY= tool
169: .include "../../lang/python/tool.mk"
1.1 grant 170: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>