Index: Mk/Uses/lha.mk =================================================================== --- Mk/Uses/lha.mk +++ Mk/Uses/lha.mk @@ -16,7 +16,7 @@ EXTRACT_DEPENDS+= lha:${PORTSDIR}/archivers/lha EXTRACT_CMD?= ${LHA_CMD} -EXTRACT_BEFORE_ARGS?= xfpw=${WRKDIR} +EXTRACT_BEFORE_ARGS?= xfpw=${EXTRACT_WRKDIR} EXTRACT_AFTER_ARGS?= .endif Index: Mk/Uses/zip.mk =================================================================== --- Mk/Uses/zip.mk +++ Mk/Uses/zip.mk @@ -13,7 +13,7 @@ EXTRACT_SUFX?= .zip EXTRACT_BEFORE_ARGS?= -qo -EXTRACT_AFTER_ARGS?= -d ${WRKDIR} +EXTRACT_AFTER_ARGS?= -d ${EXTRACT_WRKDIR} .if empty(zip_ARGS) EXTRACT_CMD?= ${UNZIP_NATIVE_CMD} Index: Mk/bsd.linux-rpm.mk =================================================================== --- Mk/bsd.linux-rpm.mk +++ Mk/bsd.linux-rpm.mk @@ -108,11 +108,10 @@ # Please, define them in the Makefile of the port in case this assumption # is not true. -DISTVERSION= ${PORTVERSION}-${RPMVERSION} -DISTNAME?= ${PORTNAME}-${DISTVERSION} -DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} +DISTNAME?= ${PORTNAME}-${PORTVERSION} +DISTFILES?= ${DISTNAME}-${RPMVERSION}${EXTRACT_SUFX} BIN_DISTFILES:= ${DISTFILES} -SRC_DISTFILES?= ${DISTNAME}${SRC_SUFX}:SOURCE +SRC_DISTFILES?= ${DISTNAME}-${RPMVERSION}${SRC_SUFX}:SOURCE EXTRACT_ONLY?= ${BIN_DISTFILES:C/:[^:]+$//} . if defined(PACKAGE_BUILDING) @@ -175,7 +174,7 @@ . if !target(linux-rpm-generate-plist) linux-rpm-generate-plist: cd ${WRKSRC} && \ - ${FIND} * ! -path "stage/*" ! -type d | ${SORT} > ${PLIST} + ${FIND} * ! -type d | ${SORT} > ${PLIST} . endif . endif @@ -189,7 +188,7 @@ . if ${BRANDELF_FILES} @cd ${WRKSRC} && ${BRANDELF} -t Linux ${BRANDELF_FILES} . endif - cd ${WRKSRC} && ${FIND} * ! -path "stage*" -type d -exec ${MKDIR} "${STAGEDIR}${PREFIX}/{}" \; - cd ${WRKSRC} && ${FIND} * ! -path "stage/*" ! -type d | ${CPIO} -pm -R root:wheel ${STAGEDIR}${PREFIX} + cd ${WRKSRC} && ${FIND} * -type d -exec ${MKDIR} "${STAGEDIR}${PREFIX}/{}" \; + cd ${WRKSRC} && ${FIND} * ! -type d | ${CPIO} -pm -R root:wheel ${STAGEDIR}${PREFIX} . endif .endif Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -521,12 +521,12 @@ # Default: ${WRKDIRPREFIX}${.CURDIR}/work # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually # unpacks to. -# Default: ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set, -# in which case simply ${WRKDIR} +# Default: ${WRKDIR}/${DISTNAME} # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually # builds in. # Default: not set -# NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}. +# NO_WRKSUBDIR - Assume port unpacks without a subdirectory, and extract it in +# ${WRKSRC} instead of ${WRKDIR}. # PATCHDIR - A directory containing any additional patches you made # to port this software to FreeBSD. # Default: ${MASTERDIR}/files @@ -1577,10 +1577,13 @@ .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) WRKSRC?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT} .endif +WRKSRC?= ${WRKDIR}/${DISTNAME} +.if !defined(EXTRACT_WRKDIR) .if defined(NO_WRKSUBDIR) -WRKSRC?= ${WRKDIR} +EXTRACT_WRKDIR:= ${WRKSRC} .else -WRKSRC?= ${WRKDIR}/${DISTNAME} +EXTRACT_WRKDIR:= ${WRKDIR} +.endif .endif .if defined(WRKSRC_SUBDIR) WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR} @@ -3022,7 +3025,7 @@ @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}" .endif -${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${WRKSRC}: +${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} ${WRKSRC}: @${MKDIR} ${.TARGET} # Warn user about deprecated packages. Advisory only. @@ -3243,9 +3246,9 @@ @${RM} -rf ${WRKDIR} .if !target(do-extract) -do-extract: +do-extract: ${EXTRACT_WRKDIR} @for file in ${EXTRACT_ONLY}; do \ - if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ + if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ then \ exit 1; \ fi; \