1 # $NetBSD: Makefile,v 1.38 2011/12/01 22:23:33 minskim Exp $
4 DISTNAME
= pkgsrc-guide-
${PKGVERSION}
6 MASTER_SITES
= ${MASTER_SITE_LOCAL}
7 DISTFILES
= htdocs-share-20111201.
tar.gz
9 MAINTAINER
= pkgsrc-users@NetBSD.org
10 HOMEPAGE
= http
://www.NetBSD.org
/docs
/pkgsrc
/
11 COMMENT
= The pkgsrc guide
13 # To regenerate pkgsrc/doc/pkgsrc.{html,txt} and
14 # htdocs/docs/pkgsrc, just run "make regen".
16 PKGVERSION
!= date
'+%Y%m%d'
17 DIST_SUBDIR
= ${PKGBASE}
18 USE_LANGUAGES
= # empty
19 MAKE_ENV
+= SED
=${SED
:Q
}
21 PLIST_VARS
= ascii html pdf
23 DOCDIR
= ${PREFIX}/share
/doc
/pkgsrc
24 .if exists
(/usr
/cvs
/htdocs
)
25 HTDOCSDIR?
= /usr
/cvs
/htdocs
27 HTDOCSDIR?
= ${.CURDIR
}/..
/..
/..
/htdocs
30 OUTPUTS?
= lint html html-split ascii pdf
32 INSTALLATION_DIRS
= ${DOCDIR}
35 . if
!empty
(OUTPUTS
:Mascii
)
36 # the html is needed to build the ascii version.
41 . if
!empty
(OUTPUTS
:Mhtml
) ||
!empty
(OUTPUTS
:Mhtml-split
)
45 . if
!empty
(OUTPUTS
:Mpdf
)
49 # only override the Makefile.common default if it is explicitly set
50 _GUIDE_OUTPUTS
= ${OUTPUTS}
53 .
include "Makefile.common"
55 # The source files are only symlinked into the WRKSRC, so that they can
56 # be easily modified, should the "lint" phase fail.
59 ${LN} -s
${FILESDIR}/* ${WRKSRC}
62 .for _output_ in
${OUTPUTS}
63 @
${ECHO} "-----> Building ${_output_} output"
64 @cd
${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${_output_}
68 @
${RM} -f
${WRKSRC}/pkgsrc.tmp.html
71 .if
!empty
(OUTPUTS
:Mhtml
) ||
!empty
(OUTPUTS
:Mhtml-split
)
72 ${INSTALL_DATA} ${WRKSRC}/*.html
${DESTDIR}${DOCDIR}
73 ${INSTALL_DATA} ${WRKDIR}/htdocs
/global.css
${DESTDIR}${DOCDIR}
75 .if
!empty
(OUTPUTS
:Mascii
)
76 ${INSTALL_DATA} ${WRKSRC}/pkgsrc.txt
${DESTDIR}${DOCDIR}
78 .if
!empty
(OUTPUTS
:Mpdf
)
79 ${INSTALL_DATA} ${WRKSRC}/pkgsrc.ps
${DESTDIR}${DOCDIR}
80 ${INSTALL_DATA} ${WRKSRC}/pkgsrc.pdf
${DESTDIR}${DOCDIR}
83 # install the single-file HTML and ascii output into the pkgsrc doc/
84 # directory, for distribution with pkgsrc.
86 # note that this uses ${CP} and not ${INSTALL_DATA} because the files
87 # stay in the development directories and have nothing to do with
88 # the permissions or ownership of installed files.
91 ${CP} ${WRKSRC}/pkgsrc.html
${PKGSRCDIR}/doc
92 ${CP} ${WRKSRC}/pkgsrc.txt
${PKGSRCDIR}/doc
95 cd
${WRKSRC} && ${CP} pkgsrc.txt pkgsrc.pdf pkgsrc.ps
*.html \
96 ${HTDOCSDIR}/docs
/pkgsrc
98 .PHONY
: regen regen-doc regen-htdocs
99 regen
: regen-doc regen-htdocs
102 @
${STEP_MSG} "Updating the files in pkgsrc/doc"
103 cd ..
&& cvs update pkgsrc.
*
104 ${MAKE} ${MAKEFLAGS} install-doc
105 @
${STEP_MSG} "Committing the files in pkgsrc/doc"
106 cd ..
&& cvs commit
-m
"regen" pkgsrc.
*
109 @
${STEP_MSG} "Updating the files in htdocs"
110 cd
${HTDOCSDIR}/docs
/pkgsrc
&& cvs update
111 ${MAKE} ${MAKEFLAGS} install-htdocs
112 @
${STEP_MSG} "Committing the files in htdocs"
113 cd
${HTDOCSDIR}/docs
/pkgsrc
&& cvs commit
-m
"regen"
116 cd
${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} lint
119 if
(/<programlisting
>/ ..
/<\
/programlisting
>/) { \
120 while
(/(.
*?
)\t(.
*)/s
) { \
121 my
$$filler = " " x
(8 - (length
($$1) % 8)); \
122 $$_ = "$$1$$filler$$2"; \
126 # remove tabulators from the <programlisting> tags.
127 # TeX does not like them.
131 perl
-p
-i
".detab.tmp" -e
'${DETAB_PROGRAM}' *.xml
&& \
132 ${RM} -f
*.xml.detab.tmp
134 # Generates a new htdocs-share-*.tar.gz archive from the current
135 # contents of the htdocs directory. To make it available, it should
136 # be copied to ftp.NetBSD.org/pub/pkgsrc/distfiles/LOCAL_PORTS/.
140 && ${PAX} -wz
-f
${.CURDIR
}/htdocs-share-
${PKGVERSION}.
tar.gz \
144 .
include "../../mk/bsd.pkg.mk"