[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / doc / guide

Annotation of pkgsrc/doc/guide/Makefile, Revision 1.66

1.66    ! leot        1: # $NetBSD: Makefile,v 1.65 2020/06/21 10:41:36 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.66    ! leot        6: DISTFILES=             htdocs-share-20200704.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.64      rillig     29: OUTPUTS?=              lint html html-split ascii ps 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.63      rillig    117: .PHONY: regen cvs-update regen-doc regen-htdocs
                    118: regen: cvs-update regen-doc regen-htdocs
                    119:
                    120: regen: cvs-update
                    121:
                    122: cvs-update:
                    123:        cvs -q update -dP
1.23      rillig    124:
1.25      rillig    125: regen-doc: build
1.23      rillig    126:        @${STEP_MSG} "Updating the files in pkgsrc/doc"
                    127:        cd .. && cvs update pkgsrc.*
                    128:        ${MAKE} ${MAKEFLAGS} install-doc
                    129:        @${STEP_MSG} "Committing the files in pkgsrc/doc"
1.47      leot      130:        cd .. && cvs commit -m "doc/pkgsrc.*: regen" pkgsrc.*
1.23      rillig    131:
1.25      rillig    132: regen-htdocs: build
1.23      rillig    133:        @${STEP_MSG} "Updating the files in htdocs"
1.29      tnn       134:        cd ${HTDOCSDIR}/docs/pkgsrc && cvs update
1.23      rillig    135:        ${MAKE} ${MAKEFLAGS} install-htdocs
                    136:        @${STEP_MSG} "Committing the files in htdocs"
1.29      tnn       137:        cd ${HTDOCSDIR}/docs/pkgsrc && cvs commit -m "regen"
1.23      rillig    138:
1.7       hubertf   139: do-lint:
1.23      rillig    140:        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} lint
1.7       hubertf   141:
1.11      rillig    142: DETAB_PROGRAM= \
                    143:        if (/<programlisting>/ .. /<\/programlisting>/) {               \
                    144:                while (/(.*?)\t(.*)/s) {                                \
                    145:                        my $$filler = " " x (8 - (length($$1) % 8));    \
                    146:                        $$_ = "$$1$$filler$$2";                         \
                    147:                }                                                       \
                    148:        }
                    149:
                    150: # remove tabulators from the <programlisting> tags.
                    151: # TeX does not like them.
                    152: .PHONY: detab
                    153: detab:
1.21      rillig    154:        cd ${FILESDIR} &&                                               \
                    155:        perl -p -i".detab.tmp" -e '${DETAB_PROGRAM}' *.xml &&           \
1.11      rillig    156:        ${RM} -f *.xml.detab.tmp
                    157:
1.26      rillig    158: # Generates a new htdocs-share-*.tar.gz archive from the current
                    159: # contents of the htdocs directory. To make it available, it should
1.48      leot      160: # be copied to ftp.NetBSD.org:/pub/pkgsrc/distfiles/LOCAL_PORTS/, i.e.:
                    161: #
                    162: # % scp htdocs-share-*.tar.gz ftp.NetBSD.org:/pub/pkgsrc/distfiles/LOCAL_PORTS/
                    163: # [... adjust DISTFILES variable ...]
                    164: # % make makesum
                    165: #
1.26      rillig    166: .PHONY: htdocs-share
                    167: htdocs-share:
                    168:        cd ${HTDOCSDIR}                                                 \
1.31      dmcmahil  169:        && ${PAX} -wz -f ${.CURDIR}/htdocs-share-${PKGVERSION}.tar.gz   \
1.26      rillig    170:                -s ',^,htdocs/,'                                        \
1.29      tnn       171:                global.css share
1.26      rillig    172:
1.54      rillig    173: PYTHON_FOR_BUILD_ONLY= tool
                    174: .include "../../lang/python/tool.mk"
1.1       grant     175: .include "../../mk/bsd.pkg.mk"

CVSweb <webmaster@jp.NetBSD.org>