From 416d24859669b4d357b02f1167abd7915206f681 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 13 Jan 2023 15:57:40 -0500
Subject: [PATCH] packaging: fix permissions error on deploy

Because docker mount extras/packaging/gnu-linux/packages:/opt/output
the Makefile MUST creates the directory for current user else
the resulting directory will use the Docker user (root), causing
the file to not be removed.

Change-Id: I91dadfa766730d163de4cf091bb1b9b8193f7d24
---
 extras/packaging/gnu-linux/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/extras/packaging/gnu-linux/Makefile b/extras/packaging/gnu-linux/Makefile
index d374c8300..f3adcbbd1 100644
--- a/extras/packaging/gnu-linux/Makefile
+++ b/extras/packaging/gnu-linux/Makefile
@@ -163,7 +163,6 @@ DISTRIBUTIONS := \
 	debian_11 \
 	debian_testing \
 	debian_unstable \
-	raspbian_10_armhf \
 	ubuntu_18.04 \
 	ubuntu_20.04 \
 	ubuntu_22.04 \
@@ -217,13 +216,13 @@ $$($(1)-docker-image-file): extras/packaging/gnu-linux/docker/Dockerfile_$(1)
 	  -f extras/packaging/gnu-linux/docker/Dockerfile_$(1) $(2) $(CURDIR) && \
 	touch "$$@"
 
-packages/$(1)/.packages-built: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
+extras/packaging/gnu-linux/packages/$(1)/.packages-built: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
 	mkdir -p "$$$$(dirname "$$@")" && \
 	$$($(1)-docker-run-command) && \
 	touch "$$@"
 
 .PHONY: $(1)
-$(1): packages/$(1)/.packages-built
+$(1): extras/packaging/gnu-linux/packages/$(1)/.packages-built
 PACKAGE-TARGETS += $(1)
 
 .PHONY: $(1)-interactive
@@ -253,7 +252,7 @@ endef
 
 # Arg1: the GNU architecture type (e.g., x86_64, i686, powerpcle, etc.)
 define define-deb-pack-rule
-deb-file-name := packages/guix-deb-pack/jami-$(RELEASE_VERSION)-$(1).deb
+deb-file-name := extras/packaging/gnu-linux/packages/guix-deb-pack/jami-$(RELEASE_VERSION)-$(1).deb
 DEB_PACK_TARGETS += deb-pack-$(subst _,-,$(1))
 .PHONY: deb-pack-$(subst _,-,$(1))
 deb-pack-$(subst _,-,$(1)): $$(deb-file-name)
@@ -298,7 +297,7 @@ clean:
 	rm -rf env
 	rm -rf docs/build
 	rm -f jami_*.tar.gz
-	rm -rf packages
+	rm -rf extras/packaging/gnu-linux/packages
 	rm -f Makefile.packaging.distro_targets
 	rm -f .docker-image-*
 	rm -rf client-qt/daemon/contrib/tarballs/*
-- 
GitLab