Fix 'make package' to generate valid packages

After introduction of shared images concept it was not possible to realize
how images should be put into packages, so built images references were
used.  It result up tgz file with lots filename which contained of '..'.

In order to workaround this issue I used temporary directory to install
complete packaging document, then generate PLIST based on content of
temporary directory and create actual package then.

Prodded by:	The FreeBSD Russian Documentation Project
This commit is contained in:
Alexey Zelkin 2004-03-24 09:45:31 +00:00
parent 95d48edff2
commit 7f574a3bf2
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=20406

View file

@ -893,29 +893,22 @@ packagelist:
# target depends on the corresponding install target running.
#
.for _curformat in ${KNOWN_FORMATS}
_cf=${_curformat}
.if ${_cf} == "html-split"
PLIST.${_curformat}: index.html
@${SORT} HTML.manifest > PLIST.${_curformat}
.else
PLIST.${_curformat}: ${DOC}.${_curformat}
@${ECHO_CMD} ${DOC}.${_curformat} > PLIST.${_curformat}
.endif
.if (${_cf} == "html-split" || ${_cf} == "html") && \
(!empty(LOCAL_IMAGES_LIB) || !empty(IMAGES_PNG) || !empty(CSS_SHEET))
@${ECHO_CMD} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG} ${LOCAL_CSS_SHEET} | \
${XARGS} -n1 >> PLIST.${_curformat}
.elif (${_cf} == "tex" || ${_cf} == "dvi") && !empty(IMAGES_EPS)
@${ECHO_CMD} ${IMAGES_EPS} | ${XARGS} -n1 >> PLIST.${_curformat}
.elif ${_cf} == "pdb"
@${ECHO_CMD} ${.CURDIR:T}.${_curformat} >> PLIST.${_curformat}
.endif
PKGDOCPFX!= realpath ${DOC_PREFIX}
${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz: PLIST.${_cf}
@${PKG_CREATE} -v -f ${.ALLSRC} -p ${DESTDIR} -s ${.OBJDIR} \
.for _curformat in ${KNOWN_FORMATS}
${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz:
${MKDIR} -p ${.OBJDIR}/pkg; \
(cd ${.CURDIR} && \
${MAKE} FORMATS=${_curformat} DOCDIR=${.OBJDIR}/pkg 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}
-d -"FDP ${.CURDIR:T} ${_curformat} package" ${.TARGET} || \
(${RM} -fr ${.TARGET} PLIST.${_curformat} && false); \
${RM} -rf ${.OBJDIR}/pkg
package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz
.endfor