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