From e8450595d3dbd3301eefcd2744701b55bce6162f Mon Sep 17 00:00:00 2001
From: jkito <belter@riseup.net>
Date: Thu, 5 Sep 2024 01:09:22 +0530
Subject: [PATCH] deb: add intermediate makefile target to prepare deb package

---
 Makefile                             | 3 +++
 branding/templates/makefile/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 83ba2818..fbe58b8c 100644
--- a/Makefile
+++ b/Makefile
@@ -437,6 +437,9 @@ package_snap:
 	@ln -s build/${PROVIDER}/snap snap
 	@${MAKE} -C build/${PROVIDER} pkg_snap
 
+prepare_deb:
+	@${MAKE} -C build/${PROVIDER} prepare_deb
+
 package_deb:
 	@${MAKE} -C build/${PROVIDER} pkg_deb
 
diff --git a/branding/templates/makefile/Makefile b/branding/templates/makefile/Makefile
index e99abe66..3845854c 100755
--- a/branding/templates/makefile/Makefile
+++ b/branding/templates/makefile/Makefile
@@ -91,7 +91,7 @@ pkg_snap:
 	-@rm ../../snap
 	@mv ../../$(BINNAME)* ../../deploy
 
-pkg_deb:
+prepare_deb:
 	echo "[+] building debian package version" ${DEB_VERSION}
 	-@mkdir -p ../../deploy
 	@if [ $(BUILD_RELEASE) = no ]; then\
@@ -106,6 +106,8 @@ pkg_deb:
 	@rm -rf build/${BINNAME}_${DEB_VERSION} build/bitmask-vpn_${VERSION}-src
 	@cd build && tar xzf $(BINNAME)_${DEB_VERSION}.orig.tar.gz && mv bitmask-vpn_${VERSION}-src ${BINNAME}_${DEB_VERSION}
 	@cp -r debian/ build/$(BINNAME)_$(DEB_VERSION)/
+
+pkg_deb: prepare_deb
 	@cd build/$(BINNAME)_$(DEB_VERSION) && debuild -us -uc
 	@mv build/*.deb ../../deploy
 
-- 
GitLab