From: John Stebbins <jstebbins.hb@gmail.com>
Date: Tue, 5 Jun 2018 03:30:51 +0000 (-0700)
Subject: LinGui: make flatpak pgp signature optional
X-Git-Tag: 1.1.1~3^2~14
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6336a88c53ccc11dcfd7c7e7ad05135c559b7f0f;p=handbrake

LinGui: make flatpak pgp signature optional

To sign flatpak during build:
        make pkg.create.flatpak PGP_ID=<key id>

(cherry picked from commit cc1627f4798f4188eaa1999500867f4eef167236)
---

diff --git a/pkg/linux/module.defs b/pkg/linux/module.defs
index 16a1baebc..308981dd8 100644
--- a/pkg/linux/module.defs
+++ b/pkg/linux/module.defs
@@ -14,6 +14,10 @@ else
     PKG.rpm.hb.version = $(tag).$(HB.repo.shorthash).$(HB.repo.branch)
 endif
 
+ifneq ($(PGP_ID),)
+    PGPSIGN = --gpg-sign=$(PGP_ID)
+endif
+
 
 ###############################################################################
 
diff --git a/pkg/linux/module.rules b/pkg/linux/module.rules
index 925345018..121b07da9 100644
--- a/pkg/linux/module.rules
+++ b/pkg/linux/module.rules
@@ -1,4 +1,4 @@
-pkg.create.flatpak:: $(PKG.gui.flatpak) $(PKG.cli.flatpak)
+pkg.create.flatpak:: contrib.fetch $(PKG.gui.flatpak) $(PKG.cli.flatpak)
 pkg.create.deb:: $(PKG.gui.deb) $(PKG.cli.deb)
 pkg.create.rpm:: $(PKG.rpm.stamp)
 pkg.create.src.deb:: $(PKG.src.deb.stamp)
@@ -63,7 +63,7 @@ $(PKG.rpm.stamp): $(PKG.native.rpm.stamp)
 #
 $(PKG.src.flatpak): $(PKG.src.tar.bz2)
 	$(MKDIR.exe) -p $(STAGE.out.flatpak/)
-	-$(RM.exe) -rf $(STAGE.out.flatpak/).flatpak-builder
+	-$(RM.exe) -rf $(BUILD/).flatpak-builder
 	$(CP.exe) $(PKG.src.tar.bz2) $(PKG.src.flatpak)
 
 $(PKG.contrib.flatpak):
@@ -77,7 +77,7 @@ $(PKG.gui.flatpak): GNUmakefile $(PKG.src.flatpak) $(PKG.contrib.flatpak)
 	# of the manifest.  So put it where we have staged the files that
 	# it needs.
 	$(CP.exe) $(PKG.gui.manifest.flatpak) $(STAGE.out.flatpak/)fr.handbrake.gui.json
-	flatpak-builder --force-clean --gpg-sign=608AD8F6 --repo=$(PKG.repo.flatpak) $(PKG.gui.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.gui.json
+	flatpak-builder --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.gui.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.gui.json
 	flatpak build-bundle $(PKG.repo.flatpak) $(PKG.gui.flatpak) fr.handbrake.ghb
 
 $(PKG.cli.flatpak): GNUmakefile $(PKG.src.flatpak) $(PKG.contrib.flatpak)
@@ -87,7 +87,7 @@ $(PKG.cli.flatpak): GNUmakefile $(PKG.src.flatpak) $(PKG.contrib.flatpak)
 	# of the manifest.  So put it where we have staged the files that
 	# it needs.
 	$(CP.exe) $(PKG.cli.manifest.flatpak) $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json
-	flatpak-builder --force-clean --gpg-sign=608AD8F6 --repo=$(PKG.repo.flatpak) $(PKG.cli.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json
+	flatpak-builder --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.cli.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json
 	flatpak build-bundle $(PKG.repo.flatpak) $(PKG.cli.flatpak) fr.handbrake.HandBrakeCLI
 
 #