Patchwork [4,of,7,stable] packaging: introduce generic local rpm build target using python3

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 27, 2019, 11:37 p.m.
Message ID <467d582886f688e01fe5.1572219432@xps>
Download mbox | patch
Permalink /patch/42603/
State Accepted
Headers show

Comments

Mads Kiilerich - Oct. 27, 2019, 11:37 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1572198921 -3600
#      Sun Oct 27 18:55:21 2019 +0100
# Branch stable
# Node ID 467d582886f688e01fe59b1d6f2de244d7be1458
# Parent  32dbdaffb2ae030119890e05b87c4677706e7c6a
packaging: introduce generic local rpm build target using python3

It is unnecessary extra work to explicitly add Makefile targets for a random
selection of Fedora versions. Generally, it just works. If not, the root cause
should be fixed.
Mads Kiilerich - Oct. 31, 2019, 11:42 a.m.
On 10/28/19 12:37 AM, Mads Kiilerich wrote:
> packaging: introduce generic local rpm build target using python3


I realize this change is bad. It has not been pushed yet - please drop 
it. The rest of the series still looks good.

/Mads
Yuya Nishihara - Oct. 31, 2019, 1:07 p.m.
On Thu, 31 Oct 2019 12:42:49 +0100, Mads Kiilerich wrote:
> On 10/28/19 12:37 AM, Mads Kiilerich wrote:
> > packaging: introduce generic local rpm build target using python3
> 
> I realize this change is bad. It has not been pushed yet - please drop 
> it. The rest of the series still looks good.

Pruned from hg-committed. Please make sure to keep your local version alive.
Mads Kiilerich - Oct. 31, 2019, 10:30 p.m.
Actually ... testing shows so many small differences between versions 
that break something. Even the very first patch in series seems to break 
docker-centos5.

Pleasedrop everything except the last 3 trivial patches (hgweb.wsgi, 
"tested on", and whitespace). I will resend.

/Mads
Gregory Szorc - Nov. 1, 2019, 2:21 a.m.
On Thu, Oct 31, 2019 at 4:00 PM Mads Kiilerich <mads@kiilerich.com> wrote:

> Actually ... testing shows so many small differences between versions
> that break something. Even the very first patch in series seems to break
> docker-centos5.
>
> Pleasedrop everything except the last 3 trivial patches (hgweb.wsgi,
> "tested on", and whitespace). I will resend.
>

I accepted these patches before I saw this email and it looks like they
were bumped to public before my drops went through. So we'll have to patch
forward. Sorry about that.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -208,7 +208,8 @@  packaging_targets := \
   linux-wheels \
   linux-wheels-x86_64 \
   linux-wheels-i686 \
-  ppa
+  ppa \
+  rpm
 
 # Forward packaging targets for convenience.
 $(packaging_targets):
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -56,6 +56,9 @@  help:
 	@echo 'ppa'
 	@echo '   Build a Debian source package locally targeting the current system'
 	@echo ''
+	@echo 'rpm'
+	@echo '   Build a RPM targeting the current system using Python 3'
+	@echo ''
 	@echo 'centos{$(strip $(CENTOS_RELEASES))}'
 	@echo '   Build an RPM for a specific CentOS version locally'
 	@echo ''
@@ -96,6 +99,14 @@  endef
 
 $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename))))
 
+# Generic RPM target, mainly for Fedora/CentOS/RHEL.
+rpm:
+	mkdir -p $$(HGROOT)/packages/rpm
+	./buildrpm --python3
+	cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/rpm
+	cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/rpm
+	rm -rf $(HGROOT)/rpmbuild
+
 # Fedora targets.
 define fedora_targets
 .PHONY: fedora$(1)