sysutils/debootstrap: Fix several issues

* Don't use substitutions on Makefile, pass variables instead
* Eliminate "static" substitutions, use a patch-file instead
* Fix hardcoded /usr/local in debootstrap script

PR:			269584
Approved by:		nc (maintainer), tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D38754
This commit is contained in:
Felix Palmen
2023-03-07 18:09:28 +01:00
parent 58822304cc
commit 4e0f740ddc
4 changed files with 32 additions and 18 deletions
+9 -15
View File
@@ -1,5 +1,6 @@
PORTNAME= debootstrap
PORTVERSION= ${DEB_VERSION}n${DEB_NMU}
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= DEBIAN
DISTNAME= ${PORTNAME}_${DEB_VERSION}+nmu${DEB_NMU}
@@ -17,31 +18,24 @@ RUN_DEPENDS= wget:ftp/wget \
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
MAKE_ENV= DATADIR="${DATADIR}"
NO_ARCH= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}
# The +nmu suffix used by debian for "non maintainer uploads" of a Debian
# native package doesn't play well with our versioning
DEB_VERSION= 1.0.128
DEB_NMU= 2
post-patch:
@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \
${WRKSRC}/Makefile \
@${REINPLACE_CMD} \
-e 's,%%DATADIR%%,${DATADIR},g' \
-e 's,%%LOCALBASE%%,${LOCALBASE},g' \
${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'
+1 -1
View File
@@ -5,7 +5,7 @@
clean:
-DSDIR=$(DESTDIR)/usr/share/debootstrap
+DSDIR=$(DESTDIR)$(PREFIX)/share/debootstrap
+DSDIR=$(DESTDIR)$(DATADIR)
install:
mkdir -p $(DSDIR)/scripts
- mkdir -p $(DESTDIR)/usr/sbin
+2 -2
View File
@@ -2,7 +2,7 @@
+++ debootstrap
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/local/bin/bash
+#!%%LOCALBASE%%/bin/bash
set -e
VERSION='@VERSION@'
@@ -11,7 +11,7 @@
DEBOOTSTRAP_DIR=/debootstrap
else
- DEBOOTSTRAP_DIR=/usr/share/debootstrap
+ DEBOOTSTRAP_DIR=/usr/local/share/debootstrap
+ DEBOOTSTRAP_DIR=%%DATADIR%%
fi
fi
@@ -0,0 +1,20 @@
--- functions.orig 2023-02-24 08:27:34 UTC
+++ functions
@@ -658,7 +658,7 @@ download_release_sig () {
info RELEASESIG "Checking Release signature"
# Don't worry about the exit status from gpgv; parsing the output will
# take care of that.
- (gpgv --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \
+ (gpgv2 --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \
"$relsigdest" "$reldest" || true) | read_gpg_status
progress 100 100 DOWNRELSIG "Downloading Release file signature"
fi
@@ -1706,7 +1706,7 @@ read_gpg_status () {
elif [ "$unkkey" ]; then
error 1 UNKNOWNRELSIG "Release signed by unknown key (key id %s)\n The specified keyring $KEYRING may be incorrect or out of date.\n You can find the latest Debian release key at https://ftp-master.debian.org/keys.html" "$unkkey"
else
- error 1 SIGCHECK "Error executing gpgv to check Release signature"
+ error 1 SIGCHECK "Error executing gpgv2 to check Release signature"
fi
}