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

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

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

CVSweb <webmaster@jp.NetBSD.org>