Merge branch 'stable-3.10' into stable-3.11

* stable-3.10:
  Set Gerrit to 3.10.6
  Set Gerrit to 3.9.11
  Set Gerrit to 3.10.5

Change-Id: I29aedc06debe594e4fe5deec2189478ae5d0a4d8
diff --git a/Version.mk b/Version.mk
new file mode 100644
index 0000000..1d16948
--- /dev/null
+++ b/Version.mk
@@ -0,0 +1,4 @@
+VERSION=3.11.2
+WAR_VERSION=3.11.2
+BRANCH=stable-3.11
+RELEASE=1
diff --git a/fpm/Makefile b/fpm/Makefile
index 8fce4ff..ffeab92 100644
--- a/fpm/Makefile
+++ b/fpm/Makefile
@@ -1,9 +1,7 @@
-VERSION=3.10.6
-WAR_VERSION=3.10.6
-BRANCH=stable-3.10
+include ../Version.mk
+
 URL=https://storage.googleapis.com/gerrit-releases/gerrit-$(WAR_VERSION).war
 CI_URL=https://gerrit-ci.gerritforge.com
-RELEASE=1
 
 NAME=gerrit
 CATEGORY=Development
diff --git a/fpm/scripts/before-install.sh b/fpm/scripts/before-install.sh
index 96cb67a..6c4a1c6 100755
--- a/fpm/scripts/before-install.sh
+++ b/fpm/scripts/before-install.sh
@@ -24,11 +24,11 @@
 
 echo -n "Checking Java version ... "
 JAVA_VERSION=$(java -version 2>&1)
-[ $? != 0 ] && echo -e "NOT FOUND\nPlease install Java 11 and try again" && exit 2
+[ $? != 0 ] && echo -e "NOT FOUND\nPlease install Java 21 or later and try again" && exit 2
 
-VERSION=`expr "$JAVA_VERSION" : '.*"\(17\..*\)["_]'`
+VERSION=`expr "$JAVA_VERSION" : '.*"\(21\..*\)["_]'`
 echo "$VERSION"
-test "$VERSION" "<" "17" && echo "ERROR: Java 17 required by Gerrit" && exit 3
+test "$VERSION" "<" "17" && echo "ERROR: Java 21 or later is required by Gerrit" && exit 3
 
 # Script is invoked even before upgrade, we need to stop Gerrit if active
 GERRIT_PID=$(ps -o pid,command -u $USER | grep gerrit | awk '{print $1}')
diff --git a/macOS/Makefile b/macOS/Makefile
index 164d91c..90e5339 100644
--- a/macOS/Makefile
+++ b/macOS/Makefile
@@ -1,4 +1,4 @@
-VERSION := 3.10.6
+include ../Version.mk
 
 all: server
 
@@ -8,8 +8,8 @@
 	cd uninstaller; make clean
 
 server:
-	curl -o gerrit-$(VERSION).war https://gerrit-releases.storage.googleapis.com/gerrit-$(VERSION).war
-	mv gerrit-$(VERSION).war gerrit/gerrit/gerrit.war
+	curl -o gerrit-$(WAR_VERSION).war https://gerrit-releases.storage.googleapis.com/gerrit-$(WAR_VERSION).war
+	mv gerrit-$(WAR_VERSION).war gerrit/gerrit/gerrit.war
 	pkgbuild --root ./gerrit --scripts scripts --identifier com.gerrit.gerrit --version 1 --install-location /private/var gerrit-installer.pkg
 	cd uninstaller; make
 
diff --git a/tarball/Makefile b/tarball/Makefile
index 98e22d6..7fda41e 100644
--- a/tarball/Makefile
+++ b/tarball/Makefile
@@ -1,5 +1,5 @@
-WAR_VERSION=3.10.6
-BRANCH=stable-3.10
+include ../Version.mk
+
 URL=https://storage.googleapis.com/gerrit-releases/gerrit-$(WAR_VERSION).war
 CI_URL=https://gerrit-ci.gerritforge.com
 
@@ -16,9 +16,12 @@
   plugin-uploadvalidator-bazel-master-$(BRANCH)/lastSuccessfulBuild/artifact/bazel-bin/plugins/uploadvalidator/uploadvalidator.jar
 
 TAR_OUT=$(OUT)/gerrit-$(WAR_VERSION).tar.gz
+TAR_OUT_SIG=$(TAR_OUT).asc
+TAR_OUT_SHA256=$(TAR_OUT).sha256
+TAR_OUT_SHA256_SIG=$(TAR_OUT_SHA256).asc
 CONFIGS=$(wildcard etc/*)
 
-all: prepare $(TAR_OUT)
+all: prepare $(TAR_OUT) $(TAR_OUT_SIG) $(TAR_OUT_SHA256) $(TAR_OUT_SHA256_SIG)
 
 clean:
 	rm -Rf $(OUT)
@@ -54,4 +57,10 @@
 $(TAR_OUT): $(WAR) plugins libs $(CONFIGS)
 	tar -C $(BUILD_ROOT) -f $@ -cvz .
 
+%.asc: %
+	GPG_TTY=`tty` gpg --output $@ --armor -b --sign $<
+
+%.sha256: %
+	sha256sum $< > $@
+
 .PHONY: clean clobber prepare plugins libs