diff --git a/Makefile b/Makefile index a5cd379b0b..0ba06ce4e6 100644 --- a/Makefile +++ b/Makefile @@ -1,59 +1,51 @@ -# $FreeBSD$ -# # The user can override the default list of languages to build and install # with the DOC_LANG variable. # .if defined(ENGLISH_ONLY) && !empty(ENGLISH_ONLY) DOC_LANG= en_US.ISO8859-1 .endif .if defined(DOC_LANG) && !empty(DOC_LANG) SUBDIR = ${DOC_LANG} .else SUBDIR = en_US.ISO8859-1 SUBDIR+= bn_BD.UTF-8 SUBDIR+= da_DK.ISO8859-1 SUBDIR+= de_DE.ISO8859-1 SUBDIR+= el_GR.ISO8859-7 SUBDIR+= es_ES.ISO8859-1 SUBDIR+= fr_FR.ISO8859-1 SUBDIR+= hu_HU.ISO8859-2 SUBDIR+= it_IT.ISO8859-15 SUBDIR+= ja_JP.eucJP SUBDIR+= ko_KR.UTF-8 SUBDIR+= mn_MN.UTF-8 SUBDIR+= nl_NL.ISO8859-1 SUBDIR+= pl_PL.ISO8859-2 SUBDIR+= pt_BR.ISO8859-1 SUBDIR+= ru_RU.KOI8-R SUBDIR+= tr_TR.ISO8859-9 SUBDIR+= zh_CN.UTF-8 SUBDIR+= zh_TW.UTF-8 .endif SUBDIR+= share DOC_PREFIX?= ${.CURDIR} -.if exists(/usr/bin/svnlite) -SVN?= /usr/bin/svnlite -.elif exists(/usr/bin/svn) -SVN?= /usr/bin/svn -.else -SVN?= /usr/local/bin/svn -.endif +GIT?= /usr/local/bin/git update: -.if !exists(${SVN}) +.if !exists(${GIT}) @${ECHODIR} "--------------------------------------------------------------" - @${ECHODIR} ">>> ${SVN} is required to update ${.CURDIR}" + @${ECHODIR} ">>> ${GIT} is required to update ${.CURDIR}" @${ECHODIR} "--------------------------------------------------------------" @${EXIT} .else @${ECHODIR} "--------------------------------------------------------------" - @${ECHODIR} ">>> Updating ${.CURDIR} from svn repository" + @${ECHODIR} ">>> Updating ${.CURDIR} from git repository" @${ECHODIR} "--------------------------------------------------------------" - cd ${.CURDIR}; ${SVN} update + cd ${.CURDIR}; ${GIT} pull --ff-only .endif .include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/share/misc/svn_props.txt b/share/misc/svn_props.txt deleted file mode 100644 index a0293097ff..0000000000 --- a/share/misc/svn_props.txt +++ /dev/null @@ -1,72 +0,0 @@ -# Make sure you have a ~/.subversion/config. Simply using it (svn --help) -# will cause a default one to be created if you don't already have one. -# Add the following changes to ~/.subversion/config: -# -# -# Set: -# enable-auto-props = yes -# -# -# Append/edit auto-props section: -# - -[auto-props] -*.c = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.h = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.s = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.S = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.cc = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.cpp = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.cxx = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.in = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.sh = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain; svn:executable -*.pl = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain; svn:executable -*.pm = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.py = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.rb = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.awk = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.sed = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.txt = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.log = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.conf = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -Makefile* = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.1 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.2 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.3 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.4 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.5 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.6 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.7 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.8 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain -*.9 = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/plain - -*.css = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/css -*.docbook = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/sgml -*.dtd = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/xml-dtd -*.ent = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/xml-dtd -*.html = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/html -*.mml = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/mathml+xml -*.js = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/javascript -*.rss = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/rss+xml -*.sgml = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/sgml -*.xhtml = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/html+xml -*.xml = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/xml -*.xsd = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/xml -*.xsl = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/xslt+xml -*.xslt = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=application/xslt+xml -*.xul = svn:eol-style=native; svn:keywords=FreeBSD=%H; svn:mime-type=text/xul - -*.bin = svn:mime-type=application/octet-stream -*.eps = svn:mime-type=application/postscript -*.exe = svn:mime-type=application/octet-stream -*.gz = svn:mime-type=application/gzip -*.pdf = svn:mime-type=application/pdf -*.ps = svn:mime-type=application/postscript - -*.gif = svn:mime-type=image/gif -*.ico = svn:mime-type=image/vnd.microsoft.icon -*.jpeg = svn:mime-type=image/jpeg -*.jpg = svn:mime-type=image/jpeg -*.png = svn:mime-type=image/png -*.svg = svn:mime-type=image/svg+xml -*.tiff = svn:mime-type=image/tiff diff --git a/share/mk/doc.docbook.mk b/share/mk/doc.docbook.mk index 44a46bbb16..bcab2d712d 100644 --- a/share/mk/doc.docbook.mk +++ b/share/mk/doc.docbook.mk @@ -1,741 +1,722 @@ -# -# $FreeBSD$ -# # This include file handles building and installing of # DocBook documentation in the FreeBSD Documentation Project. # # Documentation using DOCFORMAT=docbook is expected to be marked up # according to the DocBook DTD # # ------------------------------------------------------------------------ # # Document-specific variables # # DOC This should be set to the name of the DocBook # marked-up file, without the .xml suffix. # # It also determins the name of the output files - # ${DOC}.html. # # SRCS The names of all the files that are needed to # build this document - This is useful if any of # them need to be generated. Changing any file in # SRCS causes the documents to be rebuilt. # # ------------------------------------------------------------------------ # # Variables used by both users and documents: # # EXTRA_CATALOGS Additional catalog files that should be used by # any XML processing applications. # # CSS_SHEET Full path to a CSS stylesheet suitable for DocBook. # Default is ${DOC_PREFIX}/share/misc/docbook.css # # Package building options: # # BZIP2_PACKAGE Use bzip2(1) utility to compress package tarball # instead of gzip(1). It results packages to have # suffix .tbz instead of .tgz. Using bzip2(1) # provides better compression, but requires longer # time and utilizes more CPU resources than gzip(1). # Either dblatex or fop RENDERENGINE?= fop # # Documents should use the += format to access these. # MASTERDOC?= ${.CURDIR}/${DOC}.xml DB5RNC?= ${DOC_PREFIX}/share/xml/freebsd50.rnc XSLPROF?= http://docbook.sourceforge.net/release/xsl-ns/current/profiling/profile.xsl XSLXHTML?= http://www.FreeBSD.org/XML/share/xml/freebsd-xhtml.xsl XSLXHTMLCHUNK?= http://www.FreeBSD.org/XML/share/xml/freebsd-xhtml-chunk.xsl XSLEPUB?= http://www.FreeBSD.org/XML/share/xml/freebsd-epub.xsl XSLFO?= http://www.FreeBSD.org/XML/share/xml/freebsd-fo.xsl XSLSCH?= /usr/local/share/xsl/iso-schematron/xslt1/iso_schematron_skeleton_for_xslt1.xsl IMAGES_LIB?= SCHEMATRONS?= ${DOC_PREFIX}/share/xml/freebsd.sch XSLTPROCOPTS?= --nonet IMGDIR?= ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} CALLOUTDIR= ${.CURDIR}/imagelib/callouts XSLDBLATEX= ${DOC_PREFIX}/share/xml/freebsd-dblatex.xsl DBLATEXOPTS?= -I ${IMGDIR} -p ${XSLDBLATEX} -b xetex -d FOPJAVAOPTS?= -Xss1024k -Xmx1431552k FOPOPTS?= -c ${DOC_PREFIX}/share/misc/fop.xconf KNOWN_FORMATS= html html.tar html-split html-split.tar \ epub txt rtf pdf tex dvi tar CSS_SHEET?= ${DOC_PREFIX}/share/misc/docbook.css # # Instruction for bsd.subdir.mk to not to process SUBDIR directive. # It is not necessary since doc.docbook.mk do it too. # NO_SUBDIR= YES # # Determine latest revision # # This needs to contain all of: # --stringparam latestrevision.timestamp "timestamp" # --stringparam latestrevision.committer "committer" # --stringparam latestrevision.number "revision id" # If using git, use git log. The revision won't work with the generated links, # because it is a hash, and git log doesn't know about git svn find-rev. .if exists(${DOC_PREFIX}/.git) && exists(${GIT}) LATESTREVISION!=cd ${.CURDIR} && ${GIT} log -1 --pretty=format:'\ --stringparam latestrevision.timestamp "%ci" \ --stringparam latestrevision.committer "%cn" \ --stringparam latestrevision.number "%h"' ${SRCS} -.else -# if using Subversion, get information from metadata -# rather than embedded version strings -.if exists(${DOC_PREFIX}/.svn) && exists(${SVN}) -LATESTREVISION!=cd ${.CURDIR} && ${SVN} info ${SRCS} 2>/dev/null | \ - ${AWK} 'BEGIN { genfmt="--stringparam latestrevision."; \ - timefmt=genfmt"timestamp \"%s %s\""; \ - comtfmt=genfmt"committer \"%s\""; \ - revnfmt=genfmt"number \"%u\""; \ - fmt=timefmt" "comtfmt"\t\t"revnfmt"\n"; } \ - /^Last Changed Author:/ { committer=$$4 } \ - /^Last Changed Rev:/ { number=$$4 } \ - /^Last Changed Date:/ { date=$$4; time=$$5; \ - printf(fmt, date, time, committer, number) }' \ - | ${SORT} | ${TAIL} -n1 -.endif -.endif - -# if neither Subversion nor Git revision numbers are available, use +.endif + +# If the Git revision number is not available, use # the revision date from the timestamp of the most recent file and # set the revision number to "filedate" .if empty(LATESTREVISION) LATESTREVISION!=${STAT} 2>/dev/null -t '%F %T %Z' -f '\ --stringparam latestrevision.timestamp "%Sc" \ --stringparam latestrevision.committer "%Su" \ --stringparam latestrevision.number "filedate"' \ ${SRCS} | ${SORT} -r | ${TAIL} -n1 .endif XSLTPROCOPTS+= ${LATESTREVISION} # ------------------------------------------------------------------------ # # Look at ${FORMATS} and work out which documents need to be generated. # It is assumed that the HTML transformation will always create a file # called index.html, and that for every other transformation the name # of the generated file is ${DOC}.format. # # ${_docs} will be set to a list of all documents that must be made # up to date. # # ${CLEANFILES} is a list of files that should be removed by the "clean" # target. ${COMPRESS_EXT:S/^/${DOC}.${_cf}.&/ takes the COMPRESS_EXT # var, and prepends the filename to each listed extension, building a # second list of files with the compressed extensions added. # # Note: ".for _curformat in ${KNOWN_FORMATS}" is used several times in # this file. I know they could have been rolled together in to one, much # larger, loop. However, that would have made things more complicated # for a newcomer to this file to unravel and understand, and a syntax # error in the loop would have affected the entire # build/compress/install process, instead of just one of them, making it # more difficult to debug. # # Note: It is the aim of this file that *all* the targets be available, # not just those appropriate to the current ${FORMATS} and # ${INSTALL_COMPRESSED} values. # # For example, if FORMATS=html and INSTALL_COMPRESSED=gz you could still # type # # make book.rtf.bz2 # # and it will do the right thing. Or # # make install-rtf.bz2 # # for that matter. But don't expect "make clean" to work if the FORMATS # and INSTALL_COMPRESSED variables are wrong. # .if ${.OBJDIR} != ${.CURDIR} LOCAL_CSS_SHEET= ${.OBJDIR}/${CSS_SHEET:T} .else LOCAL_CSS_SHEET= ${CSS_SHEET:T} .endif CLEANFILES+= ${DOC}.parsed.xml ${DOC}.parsed.print.xml .if ${FORMATS:R:Mhtml-split} && ${FORMATS:R:Mhtml} XSLTPROCOPTS+= --param docformatnav "'1'" .endif .for _curformat in ${FORMATS} _cf=${_curformat} .if ${_cf} == "html-split" _docs+= index.html HTML.manifest ln*.html CLEANFILES+= $$([ -f HTML.manifest ] && ${XARGS} < HTML.manifest) \ HTML.manifest ln*.html CLEANFILES+= PLIST.${_curformat} .else _docs+= ${DOC}.${_curformat} CLEANFILES+= ${DOC}.${_curformat} CLEANFILES+= PLIST.${_curformat} .if ${_cf} == "html-split.tar" CLEANFILES+= $$([ -f HTML.manifest ] && ${XARGS} < HTML.manifest) \ HTML.manifest ln*.html .elif ${_cf} == "epub" CLEANFILES+= ${DOC}.epub mimetype CLEANDIRS+= META-INF OEBPS .elif ${_cf} == "html.tar" CLEANFILES+= ${DOC}.html .elif ${_cf} == "txt" CLEANFILES+= ${DOC}.html-text .elif ${_cf} == "dvi" CLEANFILES+= ${DOC}.aux ${DOC}.log ${DOC}.out ${DOC}.tex ${DOC}.tex-tmp .elif ${_cf} == "rtf" CLEANFILES+= ${DOC}.rtf-nopng .elif ${_cf} == "tex" CLEANFILES+= ${DOC}.aux ${DOC}.log .elif ${_cf} == "pdf" CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-pdf ${DOC}.tex-pdf-tmp \ ${DOC}.tex ${DOC}.fo .if ${RENDERENGINE} == "fop" XSLTPROCOPTS+= --param img.src.path "'${IMGDIR}/'" XSLTPROCOPTS+= --param callout.graphics.path "'${CALLOUTDIR}/'" XSLTPROCOPTS+= --maxdepth 12000 .endif .for _curimage in ${LOCAL_IMAGES_EPS:M*share*} CLEANFILES+= ${_curimage:T} ${_curimage:H:T}/${_curimage:T} .endfor .endif .endif .if (${LOCAL_CSS_SHEET} != ${CSS_SHEET}) && \ (${_cf} == "html-split" || ${_cf} == "html-split.tar" || \ ${_cf} == "html" || ${_cf} == "html.tar" || ${_cf} == "txt") CLEANFILES+= ${LOCAL_CSS_SHEET} .endif .if !defined(WITH_INLINE_LEGALNOTICE) || empty(WITH_INLINE_LEGALNOTICE) && \ (${_cf} == "html-split" || ${_cf} == "html-split.tar" || \ ${_cf} == "html" || ${_cf} == "html.tar" || ${_cf} == "txt") .endif .endfor # _curformat in ${FORMATS} # # # Build a list of install-${format}.${compress_format} targets to be # by "make install". Also, add ${DOC}.${format}.${compress_format} to # ${_docs} and ${CLEANFILES} so they get built/cleaned by "all" and # "clean". # .if defined(INSTALL_COMPRESSED) && !empty(INSTALL_COMPRESSED) .for _curformat in ${FORMATS} _cf=${_curformat} .for _curcomp in ${INSTALL_COMPRESSED} .if ${_cf} != "html-split" && ${_cf} != "html" && ${_cf} != "epub" _curinst+= install-${_curformat}.${_curcomp} _docs+= ${DOC}.${_curformat}.${_curcomp} CLEANFILES+= ${DOC}.${_curformat}.${_curcomp} .endif .endfor .endfor .endif .MAIN: all all: ${SRCS} ${_docs} .if defined(SCHEMATRONS) .for sch in ${SCHEMATRONS} schxslts+= ${sch:T}.xsl CLEANFILES+= ${sch:T}.xsl ${sch:T}.xsl: ${sch} ${XSLTPROC} --param allow-foreign "true" ${XSLSCH} ${.ALLSRC} > ${.TARGET} .endfor .endif # Parsed XML ------------------------------------------------------- ${DOC}.parsed.xml: ${SRCS} ${XML_INCLUDES} ${XMLLINT} --nonet --noent --valid --dropdtd --xinclude ${MASTERDOC} > ${.TARGET}.tmp .if defined(PROFILING) @${ECHO} "==> Profiling" ${XSLTPROC} ${PROFILING} ${XSLPROF} ${.TARGET}.tmp > ${.TARGET} ${RM} ${.TARGET}.tmp .else ${MV} ${.TARGET}.tmp ${.TARGET} .endif ${SED} 's|@@URL_RELPREFIX@@|https://www.FreeBSD.org|g' < ${.TARGET} > ${DOC}.parsed.print.xml ${SED} -i '' -e 's|@@URL_RELPREFIX@@|../../../..|g' ${.TARGET} # translation ------------------------------------------------------- .include "${DOC_PREFIX}/share/mk/doc.translate.mk" # XHTML ------------------------------------------------------------- index.html: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \ ${HTML_SPLIT_INDEX} ${LOCAL_CSS_SHEET} ${XML_INCLUDES} ${XSLTPROC} ${XSLTPROCOPTS} ${XSLXHTMLCHUNK} ${DOC}.parsed.xml ${DOC}.html: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \ ${LOCAL_CSS_SHEET} ${XML_INCLUDES} ${XSLTPROC} ${XSLTPROCOPTS} ${XSLXHTML} ${DOC}.parsed.xml > ${.TARGET} ${DOC}.html-split.tar: HTML.manifest ${LOCAL_IMAGES_LIB} \ ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET} ${TAR} cf ${.TARGET} $$(${XARGS} < HTML.manifest) \ ${LOCAL_IMAGES_LIB} ${IMAGES_PNG:N*share*} ${CSS_SHEET:T} .for _curimage in ${IMAGES_PNG:M*share*} ${TAR} rf ${.TARGET} -C ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} ${_curimage:S|${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}/||} .endfor ${DOC}.html.tar: ${DOC}.html ${LOCAL_IMAGES_LIB} \ ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET} ${TAR} cf ${.TARGET} ${DOC}.html \ ${LOCAL_IMAGES_LIB} ${IMAGES_PNG:N*share*} ${CSS_SHEET:T} .for _curimage in ${IMAGES_PNG:M*share*} ${TAR} rf ${.TARGET} -C ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} ${_curimage:S|${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}/||} .endfor # EPUB ------------------------------------------------------------- ${DOC}.epub: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \ ${CSS_SHEET} ${XML_INCLUDES} ${XSLTPROC} ${XSLTPROCOPTS} ${XSLEPUB} ${DOC}.parsed.xml .if defined(LOCAL_IMAGES_LIB) .for f in ${LOCAL_IMAGES_LIB} [ -d "OEBPS/${f:H}" ] || ${MKDIR} -pv "OEBPS/${f:H}" ${CP} ${f} OEBPS/${f} .endfor .endif .if defined(LOCAL_IMAGES_PNG) .for f in ${LOCAL_IMAGES_PNG} [ -d "OEBPS/${f:H:T}" ] || ${MKDIR} -pv "OEBPS/${f:H:T}" ${CP} -v ${f} OEBPS/${f:H:T}/${f:T} .endfor .endif ${ZIP} ${ZIPOPTS} -r -X ${DOC}.epub mimetype OEBPS META-INF # TXT -------------------------------------------------------------------- .if !target(${DOC}.txt) .if !defined(NO_PLAINTEXT) ${DOC}.txt: ${DOC}.html ${HTML2TXT} ${HTML2TXTOPTS} ${.ALLSRC} > ${.TARGET} .else ${DOC}.txt: ${TOUCH} ${.TARGET} .endif .endif # PS/PDF/RTF ----------------------------------------------------------------- ${DOC}.fo: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${DOC}.parsed.xml ${XML_INCLUDES} ${XSLTPROC} ${XSLTPROCOPTS} ${XSLFO} ${DOC}.parsed.print.xml > ${.TARGET} .if ${RENDERENGINE} == "fop" ${DOC}.pdf: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${SETENV} FOP_OPTS="${FOPJAVAOPTS}" ${FOP} ${FOPOPTS} ${DOC}.fo -pdf ${.TARGET} ${DOC}.rtf: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${SETENV} FOP_OPTS="${FOPJAVAOPTS}" ${FOP} ${FOPOPTS} ${DOC}.fo -rtf ${.TARGET} .else # Default is dblatex ${DOC}.pdf: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${DBLATEX} ${DOC}.parsed.print.xml ${DBLATEXOPTS} -tpdf -o ${.TARGET} .endif ${DOC}.tar: ${SRCS} ${LOCAL_IMAGES} ${LOCAL_CSS_SHEET} ${TAR} cf ${.TARGET} -C ${.CURDIR} ${SRCS} \ -C ${.OBJDIR} ${IMAGES} ${CSS_SHEET:T} # # Build targets for any formats we've missed that we don't handle. # .for _curformat in ${ALL_FORMATS} .if !target(${DOC}.${_curformat}) ${DOC}.${_curformat}: @${ECHO_CMD} \"${_curformat}\" is not a valid output format for this document. .endif .endfor # ------------------------------------------------------------------------ # # Validation targets # # # Lets you quickly check that the document conforms to the DTD without # having to convert it to any other formats # # # XXX: There is duplicated code below. In general, we want to see what # is actually run but when validation is executed, it is better to # silence the command invocation so that only error messages appear. # lint validate: ${SRCS} ${schxslts} @${ECHO} "==> Basic validation" @${XMLLINT} --nonet --noent --valid --dropdtd --xinclude ${MASTERDOC} > ${DOC}.parsed.xml .if defined(schxslts) @${ECHO} "==> Validating with Schematron constraints" .for sch in ${schxslts} @( out=`${XSLTPROC} ${sch} ${DOC}.parsed.xml`; \ if [ -n "$${out}" ]; then \ echo "$${out}" | ${GREP} -v '^ Validating with RELAX NG" @${JING} -c ${DB5RNC} ${DOC}.parsed.xml .endif @${RM} -rf ${CLEANFILES} ${CLEANDIRS} ${DOC}.parsed.xml # ------------------------------------------------------------------------ # # Compress targets # # # The list of compression extensions this Makefile knows about. If you # add new compression schemes, add to this list (which is a list of # extensions, hence bz2, *not* bzip2) and extend the _PROG_COMPRESS_* # targets. # KNOWN_COMPRESS= gz bz2 zip # # You can't build suffix rules to do compression, since you can't # wildcard the source suffix. So these are defined .USE, to be tacked on # as dependencies of the compress-* targets. # _PROG_COMPRESS_gz: .USE ${GZIP} ${GZIPOPTS} < ${.ALLSRC} > ${.TARGET} _PROG_COMPRESS_bz2: .USE ${BZIP2} ${BZIP2OPTS} < ${.ALLSRC} > ${.TARGET} _PROG_COMPRESS_zip: .USE ${ZIP} ${ZIPOPTS} ${.TARGET} ${.ALLSRC} # # Build a list of targets for each compression scheme and output format. # Don't compress the html-split or html output format (because they need # to be rolled in to tar files first). # .for _curformat in ${KNOWN_FORMATS} _cf=${_curformat} .for _curcompress in ${KNOWN_COMPRESS} .if ${_cf} == "html-split" || ${_cf} == "html" ${DOC}.${_cf}.tar.${_curcompress}: ${DOC}.${_cf}.tar \ _PROG_COMPRESS_${_curcompress} .else ${DOC}.${_cf}.${_curcompress}: ${DOC}.${_cf} _PROG_COMPRESS_${_curcompress} .endif .endfor .endfor # # Build targets for any formats we've missed that we don't handle. # .for _curformat in ${ALL_FORMATS} .for _curcompress in ${KNOWN_COMPRESS} .if !target(${DOC}.${_curformat}.${_curcompress}) ${DOC}.${_curformat}.${_curcompress}: @${ECHO_CMD} \"${_curformat}.${_curcompress}\" is not a valid output format for this document. .endif .endfor .endfor # ------------------------------------------------------------------------ # # Install targets # # Build install-* targets, one per allowed value in FORMATS. Need to # build two specific targets; # # install-html-split - Handles multiple .html files being generated # from one source. Uses the HTML.manifest file # created by the stylesheets, which should list # each .html file that's been created. # # install-* - Every other format. The wildcard expands to # the other allowed formats, all of which should # generate just one file. # # "beforeinstall" and "afterinstall" are hooks in to this process. # Redefine them to do things before and after the files are installed, # respectively. populate_html_docs: .if exists(HTML.manifest) _html_docs!=${CAT} HTML.manifest .endif spellcheck-html-split: populate_html_docs .for _html_file in ${_html_docs} @echo "Spellcheck ${_html_file}" @${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_html_file} | ${ISPELL} ${ISPELLOPTS} .endfor spellcheck-html: .for _entry in ${_docs} @echo "Spellcheck ${_entry}" @${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_entry} | ${ISPELL} ${ISPELLOPTS} .endfor spellcheck-txt: .for _entry in ${_docs:M*.txt} @echo "Spellcheck ${_entry}" @ < ${.CURDIR}/${_entry} ${ISPELL} ${ISPELLOPTS} .endfor .for _curformat in ${FORMATS} .if !target(spellcheck-${_curformat}) spellcheck-${_curformat}: @echo "Spellcheck is not currently supported for the ${_curformat} format." .endif .endfor spellcheck: ${FORMATS:C/^/spellcheck-/} # # Build a list of install-format targets to be installed. These will be # dependencies for the "realinstall" target. # .if !defined(INSTALL_ONLY_COMPRESSED) || empty(INSTALL_ONLY_COMPRESSED) _curinst+= ${FORMATS:S/^/install-/g} .endif .if defined(NO_TEX) _curinst_filter+=N*dvi* N*tex* N*pdf* .endif .if defined(NO_RTF) _curinst_filter+=N*rtf* .endif .if defined(NO_PLAINTEXT) _curinst_filter+=N*txt* .endif _cff!=${ECHO_CMD} "${_curinst_filter}" | ${SED} 's, ,:,g' .if !defined(_cff) || empty(_cff) realinstall: ${_curinst} .else .for i in ${_cff} realinstall: ${_curinst:$i} .endfor .endif .for _curformat in ${KNOWN_FORMATS} _cf=${_curformat} .if !target(install-${_cf}) .if ${_cf} == "html-split" install-${_curformat}: index.html .else install-${_curformat}: ${DOC}.${_curformat} .endif @[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR} .if ${_cf} == "html-split" ${INSTALL_DOCS} $$(${XARGS} < HTML.manifest) ${DESTDIR} .else ${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR} .endif .if (${_cf} == "html-split" || ${_cf} == "html") && !empty(LOCAL_CSS_SHEET) ${INSTALL_DOCS} ${LOCAL_CSS_SHEET} ${DESTDIR} .if ${_cf} == "html-split" @if [ -f ln*.html ]; then \ ${INSTALL_DOCS} ln*.html ${DESTDIR}; \ fi @if [ -f LEGALNOTICE.html ]; then \ ${INSTALL_DOCS} LEGALNOTICE.html ${DESTDIR}; \ fi @if [ -f trademarks.html ]; then \ ${INSTALL_DOCS} trademarks.html ${DESTDIR}; \ fi @if [ -f ${.OBJDIR}/${DOC}.ln ]; then \ cd ${DESTDIR}; sh ${.OBJDIR}/${DOC}.ln; \ fi .endif .for _curimage in ${IMAGES_LIB} @[ -d ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ] || \ ${MKDIR} -p ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ${INSTALL_DOCS} ${LOCAL_IMAGES_LIB_DIR}/${_curimage} \ ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} .endfor # Install the images. First, loop over all the image names that contain a # directory separator, make the subdirectories, and install. Then loop over # the ones that don't contain a directory separator, and install them in the # top level. # Install at first images from /usr/share/images then localized ones # cause of a different origin path. .for _curimage in ${IMAGES_PNG:M*/*:M*share*} ${MKDIR} -p ${DESTDIR:H:H}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR}||} ${INSTALL_DOCS} ${_curimage} ${DESTDIR:H:H}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR}||} .endfor .for _curimage in ${IMAGES_PNG:M*/*:N*share*} ${MKDIR} -p ${DESTDIR}/${_curimage:H} ${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage:H} .endfor .for _curimage in ${IMAGES_PNG:N*/*} ${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage} .endfor .elif ${_cf} == "tex" || ${_cf} == "dvi" .for _curimage in ${IMAGES_EPS:M*/*} ${MKDIR} -p ${DESTDIR}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR:T}/||} ${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR:T}/||} .endfor .for _curimage in ${IMAGES_EPS:N*/*} ${INSTALL_DOCS} ${_curimage} ${DESTDIR} .endfor .endif .if ${_cf} == "html-split" .for _compressext in ${KNOWN_COMPRESS} install-${_curformat}.tar.${_compressext}: ${DOC}.${_curformat}.tar.${_compressext} @[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR} ${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR} .endfor .else .for _compressext in ${KNOWN_COMPRESS} .if !target(install-${_curformat}.${_compressext}) install-${_curformat}.${_compressext}: ${DOC}.${_curformat}.${_compressext} @[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR} ${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR} .endif .endfor .endif .endif .endfor # # Build install- targets for any formats we've missed that we don't handle. # .for _curformat in ${ALL_FORMATS} .if !target(install-${_curformat}) install-${_curformat}: @${ECHO_CMD} \"${_curformat}\" is not a valid output format for this document. .for _compressext in ${KNOWN_COMPRESS} install-${_curformat}.${_compressext}: @${ECHO_CMD} \"${_curformat}.${_compressext}\" is not a valid output format for this document. .endfor .endif .endfor # ------------------------------------------------------------------------ # # Package building # # # realpackage is what is called in each subdirectory when a package # target is called, or, rather, package calls realpackage in each # subdirectory as it goes. # # packagelist returns the list of targets that would be called during # package building. # realpackage: ${FORMATS:S/^/package-/} packagelist: @${ECHO_CMD} ${FORMATS:S/^/package-/} # # Build a list of package targets for each output target. Each package # target depends on the corresponding install target running. # .if defined(BZIP2_PACKAGE) PKG_SUFFIX= tbz .else PKG_SUFFIX= tgz .endif PKGDOCPFX!= realpath ${DOC_PREFIX} .for _curformat in ${KNOWN_FORMATS} __curformat=${_curformat} ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX}: ${MKDIR} -p ${.OBJDIR}/pkg; \ (cd ${.CURDIR} && \ ${MAKE} FORMATS=${_curformat} \ DOCDIR=${.OBJDIR}/pkg \ ${PKGMAKEFLAGS} \ install); \ PKGSRCDIR=${.OBJDIR}/pkg/${.CURDIR:S/${PKGDOCPFX}\///}; \ /bin/ls -1 $$PKGSRCDIR > ${.OBJDIR}/PLIST.${_curformat}; \ ${PKG_CREATE} -v -f ${.OBJDIR}/PLIST.${_curformat} \ -p ${DESTDIR} -s $$PKGSRCDIR \ -c -"FDP ${.CURDIR:T} ${_curformat} package" \ -d -"FDP ${.CURDIR:T} ${_curformat} package" ${.TARGET} || \ (${RM} -fr ${.TARGET} PLIST.${_curformat} && false); \ ${RM} -rf ${.OBJDIR}/pkg .if !defined(_cff) || empty(_cff) package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX} .else .for i in ${_cff} .if !empty(__curformat:$i) package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX} .else package-${_curformat}: .endif .endfor .endif .endfor .if ${LOCAL_CSS_SHEET} != ${CSS_SHEET} ${LOCAL_CSS_SHEET}: ${CSS_SHEET} ${RM} -f ${.TARGET} ${CAT} ${.ALLSRC} > ${.TARGET} .if defined(CSS_SHEET_ADDITIONS) ${CAT} ${.CURDIR}/${CSS_SHEET_ADDITIONS} >> ${.TARGET} .endif .endif HTML.manifest: index.html diff --git a/share/tools/webupdate b/share/tools/webupdate index 4b2322ab72..7c247a486c 100755 --- a/share/tools/webupdate +++ b/share/tools/webupdate @@ -1,191 +1,189 @@ #!/bin/sh # Copyright (c) 2001-2017 Wolfram Schneider # Copyright (c) 2001 Dima Dorfman # -# Update the FreeBSD web site from the SVN repository. +# Update the FreeBSD web site from the Git repository. # # # NOTE: Changes to this file is NOT automatically used for the web # site build on www.FreeBSD.org. If an update to the main build # script is required, please contact webmaster@FreeBSD.org or a member # of the wwwadm team. # # # Major variables: # # PATH - The search path as interpreted by the shell. # SVNROOT - Path to the FreeBSD SVN repository. # GITROOT - Path to the FreeBSD Git repository. # BUILDDIR - Where the checked out copies of the files are stored. # DESTDIR - Where the rendered copies should wind up. # PUBDIR - Where the rendered files are published. # LOGFILE - Name of the log file to use (in $BUILDDIR). # BUILDARGS - Arguments to pass to make(1) when {build,install}ing. # INSTARGS - Arguments to pass to make(1) when installing. # WEBMAILTO - Address to send mail to if the build fails. # -# subtrees - List of directores in $BUILDDIR which are from SVN. +# subtrees - List of directories in $BUILDDIR which are from VCS. # # Variables which are in uppercase are derived from the environment # unless they don't exist, in which case a value suitable for # www.FreeBSD.org is used. Variables in lowercase can't be safely # changed without editing other parts of the script; thus, their value # in the environment is ignored. # # Exit codes: # # 0 - success # 1 - unknown failure # 2 - failure in VCS operations # 3 - failure in make operations # -# $FreeBSD$ -# # # Default configuration. # DEFAULT_PATH=/bin:/usr/bin:/usr/local/bin; DEFAULT_SVNROOT=svn://svn.FreeBSD.org DEFAULT_GITROOT=https://git.FreeBSD.org DEFAULT_BUILDDIR=/usr/local/www/build; #DEFAULT_LOGDIR=/usr/local/www/build/log; DEFAULT_LOGDIR=/usr/local/www/logs/build; DEFAULT_DESTDIR=/usr/local/www; DEFAULT_LOGFILE=webbuild.log DEFAULT_BUILDARGS=''; DEFAULT_INSTARGS=''; DEFAULT_WEBMAILTO=freebsd-doc; # # Variable setup. # PATH=${PATH:-${DEFAULT_PATH}}; export PATH; SVNROOT=${SVNROOT:-${DEFAULT_SVNROOT}}; export SVNROOT; GITROOT=${GITROOT:-${DEFAULT_GITROOT}}; export GITROOT; BUILDDIR=${BUILDDIR:-${DEFAULT_BUILDDIR}}; LOGDIR=${LOGDIR:-${DEFAULT_LOGDIR}}; DESTDIR=${DESTDIR:-${DEFAULT_DESTDIR}}; export DESTDIR LOGFILE=${LOGFILE:-${LOGDIR}/${DEFAULT_LOGFILE}}; BUILDARGS=${BUILDARGS:-${DEFAULT_BUILDARGS}}; INSTARGS="${BUILDARGS} ${INSTARGS:-${DEFAULT_INSTARGS}}"; WEBMAILTO=${WEBMAILTO:-${DEFAULT_WEBMAILTO}}; # too fragile, see PR: 222488 export NO_OBJ=YES # Notes on the names of the release notes directories: # # - They weren't named the same way they will be on the web site # (CURRENT, 11-STABLE) becuase that wouldn't make it obvious that they # were release notes. # # - They weren't named after their path names in the repository # (src/release/doc) because that doesn't play well with branches. # # - The '/doc' part is necessary because of the way doc.subdir.mk finds # ${LANGCODE}. It strips off the last component of ${.CURDIR} one by # one and compares the last component to 'doc'. When it finds it, it # assumes that the directory right below that is the language code. # This works fine if all the languages are in a directory called # 'doc', and not at all if they aren't. subtrees='src/share/man/man4 relnotes11/doc relnotes11/man4 ports'; subtrees="${subtrees} main" # # Update the checked out copies. Check out new copies every Sunday or # if they don't exist. # # Only create $BUILDDIR if the directory right above it exists. cd `dirname $BUILDDIR` || exit 1; if [ ! -d $BUILDDIR ]; then mkdir $BUILDDIR; fi umask 002 cd $BUILDDIR || exit 1; # We use newsyslog now... mkdir -p $LOGDIR buildstart=`date +%s` echo Build started `date` >> ${LOGFILE} # XXX If one of the directories in $subtrees doesn't exist, *all* of # them will be wiped and checked out again. This should only happen # if something went terribly wrong, or if there's a new entry in # $subtrees, so I (dd) don't plan on fixing it; there's no sense in # optimizing something that should only happen twice a year (if that). #cond="X`date '+%u'` = X7 `echo $subtrees | sed -E 's/([^ ]*)/-o ! -d \1/g'`"; cond="-e $BUILDDIR/fullbuild-clean.flag `echo $subtrees | sed -E 's/([^ ]*)/-o ! -d \1/g'`"; if [ $cond ]; then # Remove the old copies. rm -Rf $subtrees 2>/dev/null; chflags -R noschg $subtrees 2>/dev/null; rm -Rf $subtrees 2>/dev/null; # Check out the new copies. This creates all the $subtrees. git clone -b main $GITROOT/doc.git main >> $LOGFILE 2>&1 || exit 2; test -d relnotes || mkdir relnotes; mkdir -p src/share/man/man4 svn co $SVNROOT/base/head/share/man/man4 src/share/man/man4 >> $LOGFILE 2>&1 || exit 2; svn co $SVNROOT/base/stable/11/release/doc relnotes11/doc >> $LOGFILE 2>&1 || exit 2; svn co $SVNROOT/base/stable/11/share/man/man4 relnotes11/man4 >> $LOGFILE 2>&1 || exit 2; svn co --depth immediates $SVNROOT/ports/head ports >> $LOGFILE 2>&1 || exit 2 svn up --set-depth infinity ports/Mk >> $LOGFILE 2>&1 || exit 2 rm -f $BUILDDIR/fullbuild-clean.flag else for dir in ${subtrees}; do git -C main pull --rebase >> $LOGFILE 2>&1 || exit 2; done fi if [ ! -e "${PINDEX_OVERRIDE}" ]; then [ -e ${PORTSDIR}/INDEX-${INDEXNUM} ] && rm -f ${PORTSDIR}/INDEX-${INDEXNUM} make -C ${PORTSDIR} fetchindex >> $LOGFILE 2>&1 || exit 2 fi # # Build the web site. # #cd $BUILDDIR/head || exit 1; cd $BUILDDIR/main || exit 1; # get latest revision LATESTREVISION=$LOGDIR/LATESTREVISION make -C en_US.ISO8859-1/articles/pam/ SRCS="$(pwd)" -V LATESTREVISION | \ sed -E 's/--stringparam[ ]+/!/g' | tr '!' '\n' > $LATESTREVISION time make ${BUILDARGS} p-all >> $LOGFILE 2>&1 || (cat $LATESTREVISION >> $LOGFILE body="$(tail -50 $LOGFILE)" subject="FreeBSD web build failed on $(hostname)" printf "From: www-data@freebsd.org\nTo: ${WEBMAILTO}\nSubject: ${subject}\n\n${body}\n\n" \ | /usr/sbin/sendmail -oi -f www-data@freebsd.org ${WEBMAILTO}; exit 3) || exit 3; #cd $BUILDDIR/head/en_US.ISO8859-1/htdocs || exit 1; cd $BUILDDIR/main/en_US.ISO8859-1/htdocs || exit 1; ( time make ${INSTARGS} -j8 all && time make ${INSTARGS} install ) >> $LOGFILE 2>&1 || (cat $LATESTREVISION >> $LOGFILE body="$(tail -50 $LOGFILE)" subject="FreeBSD web build failed on $(hostname)" printf "From: www-data@freebsd.org\nTo: ${WEBMAILTO}\nSubject: ${subject}\n\n${body}\n\n" \ | /usr/sbin/sendmail -oi -f www-data@freebsd.org ${WEBMAILTO}; exit 3) || exit 3; if [ "X${PUBDIR}" != "X" ]; then /usr/local/bin/rsync ${RSYNC_FLAGS} ${DESTDIR}/ ${PUBDIR} \ >> ${LOGFILE} 2>&1 fi cat $LATESTREVISION >> ${LOGFILE} buildstop=`date +%s` buildd=$(($buildstop - $buildstart)) echo "Build ended `date` (${buildd}s)" >> ${LOGFILE} exit 0;