403200 Use Python3 for code generation

Authored and Committed by peter 5 years ago
    Use Python3 for code generation
    
    Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
    
        
rabbitmq-amqp1.0-common-0001-force-python3.patch ADDED
@@ -0,0 +1,29 @@
1
+ From: Lon Hohberger <lhh@redhat.com>
2
+ Date: Tue, 29 Jan 2019 11:36:11 -0500
3
+ Subject: [PATCH] force python3
4
+
5
+ Signed-off-by: Lon Hohberger <lhh@redhat.com>
6
+
7
+ diff --git a/codegen.py b/codegen.py
8
+ index dc4480a..cf93227 100755
9
+ --- a/codegen.py
10
+ +++ b/codegen.py
11
+ @@ -1,4 +1,4 @@
12
+ -#!/usr/bin/env python
13
+ +#!/usr/bin/python3
14
+
15
+ from __future__ import print_function
16
+
17
+ diff --git a/development.post.mk b/development.post.mk
18
+ index 3f8301a..b7f960a 100644
19
+ --- a/development.post.mk
20
+ +++ b/development.post.mk
21
+ @@ -2,7 +2,7 @@
22
+ # Framing sources generation.
23
+ # --------------------------------------------------------------------
24
+
25
+ -PYTHON ?= python
26
+ +PYTHON ?= python3
27
+ CODEGEN = $(CURDIR)/codegen.py
28
+ CODEGEN_DIR ?= $(DEPS_DIR)/rabbitmq_codegen
29
+ CODEGEN_AMQP = $(CODEGEN_DIR)/amqp_codegen.py
rabbitmq-aws-0001-Rename-some-types-to-make-it-build-on-21.3.patch ADDED
@@ -0,0 +1,39 @@
1
+ From: Daniil Fedotov <hairyhum@gmail.com>
2
+ Date: Mon, 18 Mar 2019 18:29:08 -0400
3
+ Subject: [PATCH] Rename some types to make it build on 21.3.
4
+
5
+ ssl_api.hrl does not contain types starting from 21.3.
6
+ Use non-existent types instead. This will dyalize, but there is no type
7
+ I know of, to fit both old and new types.
8
+
9
+ diff --git a/include/rabbitmq_aws.hrl b/include/rabbitmq_aws.hrl
10
+ index f6fffd8..a3e906e 100644
11
+ --- a/include/rabbitmq_aws.hrl
12
+ +++ b/include/rabbitmq_aws.hrl
13
+ @@ -8,8 +8,6 @@
14
+ %% @end
15
+ %% ====================================================================
16
+
17
+ --include_lib("ssl/src/ssl_api.hrl").
18
+ -
19
+ -define(MIME_AWS_JSON, "application/x-amz-json-1.0").
20
+ -define(SCHEME, https).
21
+
22
+ @@ -27,7 +25,7 @@
23
+ -type expiration() :: calendar:datetime() | undefined.
24
+ -type security_token() :: nonempty_string() | undefined.
25
+ -type region() :: nonempty_string() | undefined.
26
+ -
27
+ +-type path() :: ssl:path().
28
+
29
+ -type sc_ok() :: {ok, access_key(), secret_access_key(), expiration(), security_token()}.
30
+ -type sc_error() :: {error, Reason :: atom()}.
31
+ @@ -72,7 +70,7 @@
32
+ -type headers() :: [header()].
33
+ -type body() :: string() | binary().
34
+
35
+ --type ssl_options() :: [ssl_option()].
36
+ +-type ssl_options() :: [ssl:ssl_option()].
37
+
38
+ -type http_option() :: {timeout, timeout()} |
39
+ {connect_timeout, timeout()} |
rabbitmq-common-0002-force-python3.patch ADDED
@@ -0,0 +1,29 @@
1
+ From: Lon Hohberger <lhh@redhat.com>
2
+ Date: Tue, 29 Jan 2019 11:36:11 -0500
3
+ Subject: [PATCH] force python3
4
+
5
+ Signed-off-by: Lon Hohberger <lhh@redhat.com>
6
+
7
+ diff --git a/codegen.py b/codegen.py
8
+ index a0300ed..b0484ee 100755
9
+ --- a/codegen.py
10
+ +++ b/codegen.py
11
+ @@ -1,4 +1,4 @@
12
+ -#!/usr/bin/env python
13
+ +#!/usr/bin/python3
14
+
15
+ ## The contents of this file are subject to the Mozilla Public License
16
+ ## Version 1.1 (the "License"); you may not use this file except in
17
+ diff --git a/development.post.mk b/development.post.mk
18
+ index 65708db..ec905a4 100644
19
+ --- a/development.post.mk
20
+ +++ b/development.post.mk
21
+ @@ -2,7 +2,7 @@
22
+ # Framing sources generation.
23
+ # --------------------------------------------------------------------
24
+
25
+ -PYTHON ?= python
26
+ +PYTHON ?= python3
27
+ CODEGEN = $(CURDIR)/codegen.py
28
+ CODEGEN_DIR ?= $(DEPS_DIR)/rabbitmq_codegen
29
+ CODEGEN_AMQP = $(CODEGEN_DIR)/amqp_codegen.py
file modified
+18 -4
rabbitmq-server.spec CHANGED
@@ -5,7 +5,7 @@
5
5
6
6
Name: rabbitmq-server
7
7
Version: 3.7.13
8
- Release: 1%{?dist}
8
+ Release: 2%{?dist}
9
9
License: MPLv1.1
10
10
Source0: https://github.com/rabbitmq/rabbitmq-server/releases/download/v%{version}/%{name}_%{version}.orig.tar.xz
11
11
Source1: https://github.com/rabbitmq/rabbitmq-server/releases/download/v%{version}/%{name}_%{version}.orig.tar.xz.asc
@@ -18,16 +18,18 @@ Patch2: rabbitmq-server-0002-Add-systemd-notification-support.patch
18
18
Patch3: rabbitmq-server-0003-Allow-guest-login-from-non-loopback-connections.patch
19
19
Patch4: rabbitmq-server-0004-rabbit_prelaunch-must-use-RABBITMQ_SERVER_ERL_ARGS.patch
20
20
Patch101: rabbitmq-common-0001-Use-proto_dist-from-command-line.patch
21
+ Patch102: rabbitmq-common-0002-force-python3.patch
21
22
Patch201: rabbitmq-server-release-0001-Don-t-use-templates.patch
23
+ Patch301: rabbitmq-amqp1.0-common-0001-force-python3.patch
24
+ Patch401: rabbitmq-aws-0001-Rename-some-types-to-make-it-build-on-21.3.patch
22
25
23
26
URL: https://www.rabbitmq.com/
24
27
BuildArch: noarch
25
28
BuildRequires: elixir
26
29
BuildRequires: erlang >= %{erlang_minver}
27
30
BuildRequires: libxslt
28
- BuildRequires: python-unversioned-command
29
- BuildRequires: python2
31
+ BuildRequires: python3
32
+ BuildRequires: python3-simplejson
30
- BuildRequires: python2-simplejson
31
33
BuildRequires: rsync
32
34
BuildRequires: systemd
33
35
BuildRequires: xmlto
@@ -69,10 +71,19 @@ cd ../..
69
71
70
72
cd deps/rabbit_common
71
73
%patch101 -p1
74
+ %patch102 -p1
72
75
cd ../..
73
76
74
77
%patch201 -p1
75
78
79
+ cd deps/amqp10_common
80
+ %patch301 -p1
81
+ cd ../..
82
+
83
+ cd deps/rabbitmq_aws
84
+ %patch401 -p1
85
+ cd ../..
86
+
76
87
# We have to remove it until common_test subpackage lands RHOS
77
88
rm -f \
78
89
deps/amqp_client/src/rabbit_ct_client_helpers.erl \
@@ -189,6 +200,9 @@ done
189
200
190
201
191
202
%changelog
203
+ * Thu Mar 21 2019 Peter Lemenkov <lemenkov@gmail.com> - 3.7.13-2
204
+ - Force Python3
205
+
192
206
* Mon Mar 11 2019 Peter Lemenkov <lemenkov@gmail.com> - 3.7.13-1
193
207
- Ver. 3.7.13
194
208
rabbitmq-server_3.7.12.orig.tar.xz.asc DELETED
@@ -1,17 +0,0 @@
1
- -----BEGIN PGP SIGNATURE-----
2
- Version: GnuPG v1
3
-
4
- iQIcBAABAgAGBQJcZnw+AAoJEGtzo25gJt/KiogP/AxWaZmmw4pOQbs/tv0nrIct
5
- nq+eIrlc8rmTfQi5TgbipC3kEqeDvxW8jhTPkWZt2vHdC6KOYudY3oT2DJr297Ng
6
- SFe39iOT8t/WcKUwVHlBamRsGbn7KH/1S0k6vKGDR8wtce7kuqDqCAwqV4eSq2HS
7
- zAOV3yzEfrUYbF+i5jFaHCisSEzpx1U4gbJhS4vZrVR+TBc8GIehsnc7/Y9HV4eu
8
- LebMKVVhpNVq0gB6t1fxFLRuOc+PKEl99KypTlK1RLYk7nEHlXuNZYjjgBdALitN
9
- LH9gyeA49oktCEhDl0XlgJp04BZIA2Jj08zscjpVqF1WRG17KUhozTlqYngEDEpr
10
- CPyEN7j8NWWeBu87X09h2BC47/Nol7CcZk9bhQ+5EaVlmiHZg8IT0/bLqWdmKgC7
11
- TEv3hx25XdEP8OYRwrhEbyt55igVQeevO3pW94UYwGSwukvJEHfigD2aem0Feb70
12
- enBxZ/huipID9a43z2SEXkxUkldPv+QKespl+NlBZmfoiDkKOSFQAypsboY/okNU
13
- I5YGb/k8jAUr7jlnDhRiqvXNlsWVJniivNmWRI4/XEbDrouVy8zXBG+h0RecTjJb
14
- p9JvWJuftuvS6DhRO00mbZE8O1vZemhaEXeeg6YQTqjf34uevqArhOKnFXeGSQvw
15
- zHtvFPC0kJwGJNeO8EzE
16
- =RIcO
17
- -----END PGP SIGNATURE-----