1 |
# $MidnightBSD$ |
2 |
# |
3 |
# Documentation release building. These are used to create |
4 |
# distributions of the documentation files only. These recipes are |
5 |
# intended to mimic src/release/Makefile; the principal difference is |
6 |
# that much of the complexity brought about by the chroot environment |
7 |
# is unneeded. |
8 |
# |
9 |
HOSTNAME?= /bin/hostname |
10 |
MKISOFS?= mkisofs |
11 |
TAR?= /usr/bin/tar |
12 |
TOUCH?= /usr/bin/touch |
13 |
|
14 |
# |
15 |
# Targets: |
16 |
# |
17 |
# release Create a clean build of the documentation files, |
18 |
# obeying the usual specifications such as FORMATS=, |
19 |
# DOC_LANG=, etc. |
20 |
# |
21 |
# rerelease Similar to release, except that existing documentation |
22 |
# renderings are preserved and installed. |
23 |
# |
24 |
# Configuration variables: |
25 |
# |
26 |
# BUILDNAME Identification string to be placed in BUILDNAME file |
27 |
# in the top directory of the release. |
28 |
# |
29 |
# DOCROOTDIR Top directory to use for document release building. |
30 |
# This directory need not exist, and will be created |
31 |
# if necessary. This variable MUST be defined. |
32 |
# |
33 |
# CVSROOT $CVSROOT for checking out a doc/ tree. This variable |
34 |
# MUST be defined. |
35 |
# |
36 |
# RELEASETAG CVS tag to use for checkouts. If not defined, |
37 |
# treated as a checkout at HEAD. |
38 |
# |
39 |
# MAKE_ISOS If defined, this will enable creation of an ISO image |
40 |
# from the document release. Creation of ISO images |
41 |
# requires a mkisofs binary in the invoking user's path. |
42 |
# |
43 |
DATE!= date +%Y%m%d |
44 |
BUILDNAME?= ${DATE} |
45 |
|
46 |
# |
47 |
# Set defaults for FORMATS, DOC_LANG, and INSTALL_COMPRESSED. |
48 |
# |
49 |
FORMATS?= ps pdf html html-split html-split.tar txt pdb |
50 |
#DOC_LANG?= en_US.ISO8859-1 |
51 |
INSTALL_COMPRESSED?= zip gz |
52 |
|
53 |
# |
54 |
# Miscellaneous options for the build get set here. |
55 |
# |
56 |
# The Japanese translation team has a set of manual pages; we turn |
57 |
# these off (at least for now) because we have not worked their |
58 |
# install target into our scheme. |
59 |
# |
60 |
# Turn on RLE encoding and indexing. |
61 |
# |
62 |
# Don't make the compatability symlinks. |
63 |
# |
64 |
#MISCOPTIONS+= NO_JPMAN=yes RLE=yes GEN_INDEX=1 IGNORE_COMPAT_SYMLINK=YES |
65 |
MISCOPTIONS+= NO_JPMAN=yes RLE=yes IGNORE_COMPAT_SYMLINK=YES |
66 |
|
67 |
DOC_PREFIX= ${DOCROOTDIR}/doc |
68 |
DOCSTAGEDIR= ${DOCROOTDIR}/R |
69 |
DOCBUILDFILE= ${DOCSTAGEDIR}/build.txt |
70 |
DOCKEYFILE= ${DOCSTAGEDIR}/pgpkeyring.txt |
71 |
DOCFTPSTAGEDIR= ${DOCSTAGEDIR}/ftp |
72 |
DOCCDROMSTAGEDIR= ${DOCSTAGEDIR}/cdrom |
73 |
|
74 |
rerelease release: release.1 ftp.1 cdrom.1 |
75 |
@${ECHO} ">>> make ${.TARGET} finished on `LC_ALL=C TZ=GMT date`" |
76 |
|
77 |
release.1: |
78 |
.if !defined(DOCROOTDIR) |
79 |
@${ECHO} "To make a release you must define DOCROOTDIR" && false |
80 |
.endif |
81 |
.if !defined(CVSROOT) |
82 |
@${ECHO} "To make a release you must define CVSROOT" && false |
83 |
.endif |
84 |
@${ECHO} ">>> make ${.TARGET} started on `LC_ALL=C TZ=GMT date`" |
85 |
# If we're doing a release (from scratch), clean out DOCROOTDIR |
86 |
# (this is the equivalent of CHROOTDIR for src/release) and checkout |
87 |
# a clean copy of the documentation. |
88 |
.if make(release) |
89 |
${RM} -rf ${DOCROOTDIR} |
90 |
${MKDIR} ${DOCROOTDIR} |
91 |
.if defined(RELEASETAG) |
92 |
cd ${DOCROOTDIR}; \ |
93 |
cvs -R -d ${CVSROOT} co -r${RELEASETAG} -P doc |
94 |
.else |
95 |
cd ${DOCROOTDIR}; \ |
96 |
cvs -R -d ${CVSROOT} co -P doc |
97 |
.endif |
98 |
${MKDIR} ${DOCSTAGEDIR} |
99 |
.endif |
100 |
# Build documents. |
101 |
cd ${DOC_PREFIX} && \ |
102 |
${MAKE} all FORMATS="${FORMATS}" INSTALL_COMPRESSED="${INSTALL_COMPRESSED}" ${MISCOPTIONS} |
103 |
# Build PGP key ring |
104 |
${RM} -f ${DOCKEYFILE} |
105 |
cd ${DOC_PREFIX}/en_US.ISO8859-1/books/handbook && ${MAKE} pgpkeyring > ${DOCKEYFILE} |
106 |
# Construct the build.txt file with the documentation build info. |
107 |
${RM} -f ${DOCBUILDFILE} |
108 |
${TOUCH} ${DOCBUILDFILE} |
109 |
${ECHO} "FreeBSD Documentation ${BUILDNAME}" >> ${DOCBUILDFILE} |
110 |
${ECHO} "Generated on: `LC_ALL=C TZ=GMT date`" >> ${DOCBUILDFILE} |
111 |
${ECHO} "Generated by: ${USER}@`${HOSTNAME}`">> ${DOCBUILDFILE} |
112 |
${ECHO} "Formats: ${FORMATS}" >> ${DOCBUILDFILE} |
113 |
${ECHO} "Languages: ${DOC_LANG}" >> ${DOCBUILDFILE} |
114 |
|
115 |
# Make FTP staging area |
116 |
ftp.1: |
117 |
${RM} -rf ${DOCFTPSTAGEDIR} |
118 |
${MKDIR} ${DOCFTPSTAGEDIR} |
119 |
cd ${DOC_PREFIX} && \ |
120 |
${MAKE} all install DOCDIR=${DOCFTPSTAGEDIR} FORMATS="${FORMATS}" INSTALL_COMPRESSED="${INSTALL_COMPRESSED}" ${MISCOPTIONS} |
121 |
# Copy newly generated files to staging area |
122 |
${CP} ${DOCBUILDFILE} ${DOCKEYFILE} ${DOCFTPSTAGEDIR} |
123 |
# Copy any files in our texts/ directory to staging area |
124 |
${TAR} --exclude CVS -cf - -C ${.CURDIR}/texts . | \ |
125 |
${TAR} xf - -C ${DOCFTPSTAGEDIR} |
126 |
|
127 |
# Make CDROM staging area, optionally do ISO images too |
128 |
cdrom.1: |
129 |
${RM} -rf ${DOCCDROMSTAGEDIR} |
130 |
${MKDIR} ${DOCCDROMSTAGEDIR} |
131 |
cd ${DOC_PREFIX} && \ |
132 |
${MAKE} all install DOCDIR=${DOCCDROMSTAGEDIR} FORMATS="${FORMATS}" INSTALL_COMPRESSED="" ${MISCOPTIONS} |
133 |
# Copy newly generated files to staging area |
134 |
${CP} ${DOCBUILDFILE} ${DOCKEYFILE} ${DOCCDROMSTAGEDIR} |
135 |
# Copy any files in our texts/ directory to the staging area. |
136 |
${TAR} --exclude CVS -cf - -C ${.CURDIR}/texts . | \ |
137 |
${TAR} xf - -C ${DOCCDROMSTAGEDIR} |
138 |
# Make ISO images if desired. |
139 |
.if defined(MAKE_ISOS) |
140 |
cd ${DOCROOTDIR} && ${MKISOFS} -r -J -V fbsd_doc -o ${DOCSTAGEDIR}/doc.iso ${DOCCDROMSTAGEDIR} |
141 |
.endif |
142 |
|
143 |
.include "../share/mk/doc.project.mk" |