5 STAGEDIR?= ${WRKDIR}/stage
8 .if defined(_DESTDIR_VIA_ENV)
9 MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
11 MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
13 QA_ENV+= STAGEDIR=${STAGEDIR} \
15 LOCALBASE=${LOCALBASE} \
16 USESDESKTOPFILEUTILS=${USES:Mdesktop-file-utils} \
17 USESSHAREDMIMEINFO=${USES:Mshared-mime-info} \
19 CO_ENV+= STAGEDIR=${STAGEDIR} \
21 LOCALBASE=${LOCALBASE} \
24 MTREE_FILE=${MTREE_FILE} \
25 GNOME_MTREE_FILE=${GNOME_MTREE_FILE} \
26 TMPPLIST=${TMPPLIST} \
28 EXAMPLESDIR=${EXAMPLESDIR} \
29 PLIST_SUB='${PLIST_SUB:NPREFIX=*:NLOCALBASE=*:NOSREL=*:NLIB32DIR=*:NDOCSDIR=*:NEXAMPLESDIR=*:N*="* *"}'
31 .if !target(stage-dir)
33 @${MKDIR} ${STAGEDIR}${PREFIX}
34 .if !defined(NO_MTREE)
35 @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
39 # Compress all manpage not already compressed which are not hardlinks
40 # Find all manpages which are not compressed and are hadlinks, and only get the list of inodes concerned, for each of them compress the first one found and recreate the hardlinks for the others
41 # Fixes all dead symlinks left by the previous round
42 .if !target(compress-man)
44 @${ECHO_MSG} "====> Compressing man pages (compress-man)"
46 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
47 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
49 for dir in $$mdirs; do \
50 ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
51 ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
52 ${SORT} -u | while read inode ; do \
54 for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
55 if [ -z $$ref ]; then \
61 (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
64 ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
65 dest=$$(readlink $$link) ; \
67 (cd $${link%/*} ; ${LN} -sf $${dest##*/}.gz $${link##*/}.gz) ;\
72 .if !target(makeplist)
74 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
77 .if !target(check-orphans)
79 @${ECHO_MSG} "====> Items missing from pkg-plist (check-orphans)"
80 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh orphans
85 @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
86 @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh