changeset 43360:0b65f18edc4f stable

packaging: refactor "fedora29" target to a single more generic "fedora" target Fedora moves fast in version numbers, and often with Mercurial packaging being backwards compatible. Also, most people use the system package. There is thus much work and tech debt and little value in providing explicit built-in support for several versions. Thus, only aim for providing built-in support for latest Fedora version, and make it easy to update.
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 01 Nov 2019 13:51:44 +0100
parents e66a3bfcb19b
children 9892599de2dc
files Makefile contrib/packaging/Makefile
diffstat 2 files changed, 15 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Nov 01 15:29:14 2019 +0100
+++ b/Makefile	Fri Nov 01 13:51:44 2019 +0100
@@ -189,7 +189,7 @@
   docker-centos7 \
   docker-debian-jessie \
   docker-debian-stretch \
-  docker-fedora29 \
+  docker-fedora \
   docker-ubuntu-trusty \
   docker-ubuntu-trusty-ppa \
   docker-ubuntu-xenial \
@@ -198,7 +198,7 @@
   docker-ubuntu-artful-ppa \
   docker-ubuntu-bionic \
   docker-ubuntu-bionic-ppa \
-  fedora29 \
+  fedora \
   linux-wheels \
   linux-wheels-x86_64 \
   linux-wheels-i686 \
--- a/contrib/packaging/Makefile	Fri Nov 01 15:29:14 2019 +0100
+++ b/contrib/packaging/Makefile	Fri Nov 01 13:51:44 2019 +0100
@@ -11,8 +11,7 @@
   cosmic \
   disco
 
-FEDORA_RELEASES := \
-  29
+FEDORA_RELEASE := 29
 
 CENTOS_RELEASES := \
   5 \
@@ -31,8 +30,8 @@
 	@echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
 	@echo '   Build Debian packages specific to a Debian distro using Docker.'
 	@echo ''
-	@echo 'docker-fedora{$(strip $(FEDORA_RELEASES))}'
-	@echo '   Build an RPM for a specific Fedora version using Docker.'
+	@echo 'docker-fedora'
+	@echo '   Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.'
 	@echo ''
 	@echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}'
 	@echo '   Build Debian package specific to an Ubuntu distro using Docker.'
@@ -56,8 +55,8 @@
 	@echo 'centos{$(strip $(CENTOS_RELEASES))}'
 	@echo '   Build an RPM for a specific CentOS version locally'
 	@echo ''
-	@echo 'fedora{$(strip $(FEDORA_RELEASES))}'
-	@echo '   Build an RPM for a specific Fedora version locally'
+	@echo 'fedora'
+	@echo '   Build an RPM for Fedora $(FEDORA_RELEASE) locally'
 
 .PHONY: help
 
@@ -94,22 +93,17 @@
 $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename))))
 
 # Fedora targets.
-define fedora_targets
-.PHONY: fedora$(1)
-fedora$(1):
-	mkdir -p $$(HGROOT)/packages/fedora$(1)
+.PHONY: fedora
+fedora:
+	mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
 	./buildrpm
-	cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/fedora$(1)
-	cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/fedora$(1)
+	cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
+	cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
 	rm -rf $(HGROOT)/rpmbuild
 
-.PHONY: docker-fedora$(1)
-docker-fedora$(1):
-	./dockerrpm fedora$(1)
-
-endef
-
-$(foreach release,$(FEDORA_RELEASES),$(eval $(call fedora_targets,$(release))))
+.PHONY: docker-fedora
+docker-fedora:
+	./dockerrpm fedora$(FEDORA_RELEASE)
 
 # CentOS targets.
 define centos_targets