diff --git a/sysutils/debootstrap/Makefile b/sysutils/debootstrap/Makefile index d8934457e10e..f0b4d63438d4 100644 --- a/sysutils/debootstrap/Makefile +++ b/sysutils/debootstrap/Makefile @@ -1,53 +1,53 @@ # Created by: Martin Matuska PORTNAME= debootstrap PORTVERSION= 1.0.123 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= sysutils MASTER_SITES= DEBIAN DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= trasz@FreeBSD.org COMMENT= Install Debian or Ubuntu base system into a directory LICENSE= MIT LICENSE_FILE= ${WRKSRC}/debian/copyright RUN_DEPENDS= wget:ftp/wget \ bash:shells/bash \ ${LOCALBASE}/bin/grep:textproc/gnugrep \ gpgv2:security/gnupg \ ${LOCALBASE}/share/keyrings/ubuntu-archive-keyring.gpg:security/ubuntu-keyring WRKSRC= ${WRKDIR}/${PORTNAME} NO_BUILD= yes NO_ARCH= yes USES= gmake perl5 USE_PERL5= run post-patch: @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \ ${WRKSRC}/Makefile \ ${WRKSRC}/debootstrap @${REINPLACE_CMD} -e 's,%%DATADIR%%,${DATADIR},g' \ ${WRKSRC}/Makefile \ ${WRKSRC}/debootstrap @${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' \ ${WRKSRC}/Makefile \ ${WRKSRC}/debootstrap @${REINPLACE_CMD} -e 's,gpgv,gpgv2,g' \ ${WRKSRC}/Makefile \ ${WRKSRC}/debootstrap \ ${WRKSRC}/functions @${FIND} ${WRKSRC}/scripts -type f | \ ${XARGS} ${REINPLACE_CMD} -e 's,/usr/share/keyrings,${LOCALBASE}/share/keyrings,g' # Workaround for bin/255525 @${REINPLACE_CMD} -e 's,grep,${LOCALBASE}/bin/grep,g' \ ${WRKSRC}/functions post-install: ${INSTALL_MAN} ${WRKSRC}/debootstrap.8 \ ${STAGEDIR}${MAN8PREFIX}/man/man8/debootstrap.8 .include diff --git a/sysutils/debootstrap/files/patch-debootstrap b/sysutils/debootstrap/files/patch-debootstrap index dc2822ec82a9..b8b633661c06 100644 --- a/sysutils/debootstrap/files/patch-debootstrap +++ b/sysutils/debootstrap/files/patch-debootstrap @@ -1,44 +1,47 @@ --- debootstrap.orig 2020-03-13 02:03:08 UTC +++ debootstrap @@ -1,4 +1,4 @@ -#!/bin/sh +#!%%LOCALBASE%%/bin/bash set -e VERSION='@VERSION@' @@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then if [ -x /debootstrap/debootstrap ]; then DEBOOTSTRAP_DIR=/debootstrap else - DEBOOTSTRAP_DIR=/usr/share/debootstrap + DEBOOTSTRAP_DIR=%%DATADIR%% fi fi @@ -516,13 +516,7 @@ fi ########################################################################### -if in_path dpkg && \ - dpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/dpkg --print-architecture) -elif in_path udpkg && \ - udpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/udpkg --print-architecture) -elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then +if [ -e "$DEBOOTSTRAP_DIR/arch" ]; then HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") fi HOST_OS="$HOST_ARCH" -@@ -542,6 +536,11 @@ if [ -z "$HOST_OS" ]; then +@@ -542,6 +536,14 @@ if [ -z "$HOST_OS" ]; then HOST_OS=freebsd ;; esac +fi + +if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then + HOST_ARCH=`/sbin/sysctl -n hw.machine_arch` ++ if [ "$HOST_ARCH" = "aarch64" ]; then ++ HOST_ARCH=arm64 ++ fi + EXTRACTOR_OVERRIDE=ar fi if [ -z "$ARCH" ]; then