diff --git a/heimdal-7.7.0-58c8ad96-py3.patch b/heimdal-7.7.0-58c8ad96-py3.patch new file mode 100644 index 0000000..61882ed --- /dev/null +++ b/heimdal-7.7.0-58c8ad96-py3.patch @@ -0,0 +1,296 @@ +commit 58c8ad967e765f703273c95140f7f7a7f1694ae0 +Author: Alexander Boström +Date: Sat Mar 21 13:56:33 2020 +0100 + + Changes generated by 2to3 for all Python sources. + +diff --git a/cf/symbol-version.py b/cf/symbol-version.py +index 414f06f8f..23666ecf8 100644 +--- a/cf/symbol-version.py ++++ b/cf/symbol-version.py +@@ -40,7 +40,7 @@ t_SYMBOL = r'[a-zA-Z_][a-zA-Z0-9_\.]*' + t_ignore = " \t\n" + + def t_error(t): +- print "Illegal character '%s'" % t.value[0] ++ print("Illegal character '%s'" % t.value[0]) + t.lexer.skip(1) + + import ply.lex as lex +@@ -51,7 +51,7 @@ symbols = [] + + def p_syms(p): + 'syms : SYMBOL "{" elements "}"' +- print "# %s" % p[1] ++ print("# %s" % p[1]) + + def p_elements(p): + '''elements : element +@@ -68,9 +68,9 @@ def p_element(p): + + def p_error(p): + if p: +- print "Syntax error at '%s'" % p.value ++ print("Syntax error at '%s'" % p.value) + else: +- print "Syntax error at EOF" ++ print("Syntax error at EOF") + + import ply.yacc as yacc + yacc.yacc() +@@ -82,4 +82,4 @@ for line in lines: + + for symbol in symbols: + if symbol[0] == "global": +- print "%s" % symbol[1] ++ print("%s" % symbol[1]) +diff --git a/lib/hx509/quote.py b/lib/hx509/quote.py +index 41887e5d4..95898d4c5 100644 +--- a/lib/hx509/quote.py ++++ b/lib/hx509/quote.py +@@ -76,26 +76,26 @@ chars[ord('>')] |= RFC2253_QUOTE + chars[ord('#')] |= RFC2253_QUOTE + chars[ord(';')] |= RFC2253_QUOTE + +-print "#define Q_CONTROL_CHAR 1" +-print "#define Q_PRINTABLE 2" +-print "#define Q_RFC2253_QUOTE_FIRST 4" +-print "#define Q_RFC2253_QUOTE_LAST 8" +-print "#define Q_RFC2253_QUOTE 16" +-print "#define Q_RFC2253_HEX 32" +-print "" +-print "#define Q_RFC2253 (Q_RFC2253_QUOTE_FIRST|Q_RFC2253_QUOTE_LAST|Q_RFC2253_QUOTE|Q_RFC2253_HEX)" +-print "\n" * 2 ++print("#define Q_CONTROL_CHAR 1") ++print("#define Q_PRINTABLE 2") ++print("#define Q_RFC2253_QUOTE_FIRST 4") ++print("#define Q_RFC2253_QUOTE_LAST 8") ++print("#define Q_RFC2253_QUOTE 16") ++print("#define Q_RFC2253_HEX 32") ++print("") ++print("#define Q_RFC2253 (Q_RFC2253_QUOTE_FIRST|Q_RFC2253_QUOTE_LAST|Q_RFC2253_QUOTE|Q_RFC2253_HEX)") ++print("\n" * 2) + + + + +-print "unsigned char char_map[] = {\n\t", ++print("unsigned char char_map[] = {\n\t", end=' ') + for x in range(0, 256): + if (x % 8) == 0 and x != 0: +- print "\n\t", +- print "0x%(char)02x" % { 'char' : chars[x] }, ++ print("\n\t", end=' ') ++ print("0x%(char)02x" % { 'char' : chars[x] }, end=' ') + if x < 255: +- print ", ", ++ print(", ", end=' ') + else: +- print "" +-print "};" ++ print("") ++print("};") +diff --git a/lib/wind/gen-bidi.py b/lib/wind/gen-bidi.py +index e2efcbb55..fdadcbec7 100644 +--- a/lib/wind/gen-bidi.py ++++ b/lib/wind/gen-bidi.py +@@ -42,7 +42,7 @@ import generate + import rfc3454 + + if len(sys.argv) != 3: +- print("usage: %s rfc3454.txt outdir" % sys.argv[0]) ++ print(("usage: %s rfc3454.txt outdir" % sys.argv[0])) + sys.exit(1) + + tables = rfc3454.read(sys.argv[1]) +diff --git a/lib/wind/gen-combining.py b/lib/wind/gen-combining.py +index 43e0d52eb..4e73840b5 100644 +--- a/lib/wind/gen-combining.py ++++ b/lib/wind/gen-combining.py +@@ -42,13 +42,13 @@ import generate + import UnicodeData + + if len(sys.argv) != 3: +- print("usage: %s UnicodeData.txt out-dir" % sys.argv[0]) ++ print(("usage: %s UnicodeData.txt out-dir" % sys.argv[0])) + sys.exit(1) + + ud = UnicodeData.read(sys.argv[1]) + + trans = {} +-for k,v in ud.items(): ++for k,v in list(ud.items()): + if int(v[2]) != 0 : + trans[k] = [int(v[2]), v[1]] + +diff --git a/lib/wind/gen-errorlist.py b/lib/wind/gen-errorlist.py +index 97646cf5a..345be300b 100644 +--- a/lib/wind/gen-errorlist.py ++++ b/lib/wind/gen-errorlist.py +@@ -44,13 +44,13 @@ import rfc4518 + import stringprep + + if len(sys.argv) != 3: +- print("usage: %s rfc3454.txt out-dir" % sys.argv[0]) ++ print(("usage: %s rfc3454.txt out-dir" % sys.argv[0])) + sys.exit(1) + + tables = rfc3454.read(sys.argv[1]) + t2 = rfc4518.read() + +-for x in t2.keys(): ++for x in list(t2.keys()): + tables[x] = t2[x] + + error_list = stringprep.get_errorlist() +@@ -85,7 +85,7 @@ const struct error_entry _wind_errorlist_table[] = { + + trans=[] + +-for t in error_list.keys(): ++for t in list(error_list.keys()): + for l in tables[t]: + m = re.search('^ *([0-9A-F]+)-([0-9A-F]+); *(.*) *$', l) + if m: +@@ -104,7 +104,7 @@ for x in trans: + (start, length, description, tables) = x + symbols = stringprep.symbols(error_list, tables) + if len(symbols) == 0: +- print("no symbol for %s" % description) ++ print(("no symbol for %s" % description)) + sys.exit(1) + errorlist_c.file.write(" {0x%x, 0x%x, %s}, /* %s: %s */\n" + % (start, length, symbols, ",".join(tables), description)) +diff --git a/lib/wind/gen-map.py b/lib/wind/gen-map.py +index dc10d6fae..c84d71cd2 100644 +--- a/lib/wind/gen-map.py ++++ b/lib/wind/gen-map.py +@@ -45,7 +45,7 @@ import stringprep + import util + + if len(sys.argv) != 3: +- print("usage: %s rfc3454.txt out-dir" % sys.argv[0]) ++ print(("usage: %s rfc3454.txt out-dir" % sys.argv[0])) + sys.exit(1) + + tables = rfc3454.read(sys.argv[1]) +@@ -114,7 +114,7 @@ trans = stringprep.sort_merge_trans(trans) + + for x in trans: + if x[0] == 0xad: +- print("fooresult %s" % ",".join(x[3])) ++ print(("fooresult %s" % ",".join(x[3]))) + + for x in trans: + (key, value, description, table) = x +@@ -130,7 +130,7 @@ for x in trans: + (key, value, description, tables) = x + symbols = stringprep.symbols(map_list, tables) + if len(symbols) == 0: +- print("no symbol for %s %s (%s)" % (key, description, tables)) ++ print(("no symbol for %s %s (%s)" % (key, description, tables))) + sys.exit(1) + v = value.split() + map_c.file.write(" {0x%x, %u, %u, %s}, /* %s: %s */\n" +diff --git a/lib/wind/gen-normalize.py b/lib/wind/gen-normalize.py +index daf3c3dc4..901a07fee 100644 +--- a/lib/wind/gen-normalize.py ++++ b/lib/wind/gen-normalize.py +@@ -43,8 +43,8 @@ import UnicodeData + import util + + if len(sys.argv) != 4: +- print("usage: %s UnicodeData.txt" +- " CompositionExclusions-3.2.0.txt out-dir" % sys.argv[0]) ++ print(("usage: %s UnicodeData.txt" ++ " CompositionExclusions-3.2.0.txt out-dir" % sys.argv[0])) + sys.exit(1) + + ud = UnicodeData.read(sys.argv[1]) +@@ -56,10 +56,10 @@ def sortedKeys(d): + return keys + + trans = dict([(k, [re.sub('<[a-zA-Z]+>', '', v[4]), v[0]]) +- for k,v in ud.items() if v[4]]) ++ for k,v in list(ud.items()) if v[4]]) + + maxLength = 0 +-for v in trans.values(): ++for v in list(trans.values()): + maxLength = max(maxLength, len(v[0].split())) + + normalize_h = generate.Header('%s/normalize_table.h' % sys.argv[3]) +@@ -135,7 +135,7 @@ exclusions = UnicodeData.read(sys.argv[2]) + + inv = dict([(''.join(["%05x" % int(x, 0x10) for x in v[4].split(' ')]), + [k, v[0]]) +- for k,v in ud.items() ++ for k,v in list(ud.items()) + if v[4] and not re.search('<[a-zA-Z]+> *', v[4]) and not k in exclusions]) + + table = 0 +@@ -162,7 +162,7 @@ def add(table, k, v): + + top = createTable() + +-for k,v in inv.items(): ++for k,v in list(inv.items()): + add(tables[top], k, v) + + next_table = [] +diff --git a/lib/wind/gen-punycode-examples.py b/lib/wind/gen-punycode-examples.py +index f2eddbb37..44d2c5d9a 100644 +--- a/lib/wind/gen-punycode-examples.py ++++ b/lib/wind/gen-punycode-examples.py +@@ -40,7 +40,7 @@ import sys + import generate + + if len(sys.argv) != 3: +- print("usage: %s rfc3492.txt" % sys.argv[0]) ++ print(("usage: %s rfc3492.txt" % sys.argv[0])) + sys.exit(1) + + f = open(sys.argv[1], 'r') +diff --git a/lib/wind/stringprep.py b/lib/wind/stringprep.py +index cff4d02a7..73c9d43c2 100644 +--- a/lib/wind/stringprep.py ++++ b/lib/wind/stringprep.py +@@ -38,7 +38,7 @@ import re + import string + + def _merge_table(res, source): +- for table in source.keys(): ++ for table in list(source.keys()): + res[table] = res.get(table, []) + source.get(table, []) + + name_error = ['C.1.2', 'C.2.2', 'C.3', 'C.4', 'C.5', 'C.6', 'C.7', 'C.8', 'C.9'] +@@ -57,21 +57,21 @@ def symbols(tabledict, tables): + list = list + tabledict.get(x, []) + if len(list) == 0: + return "" +- return "|".join(map(lambda x: "WIND_PROFILE_%s" % (x.upper()), list)) ++ return "|".join(["WIND_PROFILE_%s" % (x.upper()) for x in list]) + + def get_errorlist(): + d = dict() +- _merge_table(d, dict(map(lambda x: [x, ['name']], name_error))) +- _merge_table(d, dict(map(lambda x: [x, ['ldap']], ldap_error))) +- _merge_table(d, dict(map(lambda x: [x, ['sasl']], sasl_error))) ++ _merge_table(d, dict([[x, ['name']] for x in name_error])) ++ _merge_table(d, dict([[x, ['ldap']] for x in ldap_error])) ++ _merge_table(d, dict([[x, ['sasl']] for x in sasl_error])) + return d + + def get_maplist(): + d = dict() +- _merge_table(d, dict(map(lambda x: [x, ['name']], name_map))) +- _merge_table(d, dict(map(lambda x: [x, ['ldap']], ldap_map))) +- _merge_table(d, dict(map(lambda x: [x, ['ldap_case']], ldap_case_map))) +- _merge_table(d, dict(map(lambda x: [x, ['sasl']], sasl_map))) ++ _merge_table(d, dict([[x, ['name']] for x in name_map])) ++ _merge_table(d, dict([[x, ['ldap']] for x in ldap_map])) ++ _merge_table(d, dict([[x, ['ldap_case']] for x in ldap_case_map])) ++ _merge_table(d, dict([[x, ['sasl']] for x in sasl_map])) + return d + + def sort_merge_trans(trans): diff --git a/heimdal-7.7.0-pythonpath.patch b/heimdal-7.7.0-pythonpath.patch new file mode 100644 index 0000000..75fcef6 --- /dev/null +++ b/heimdal-7.7.0-pythonpath.patch @@ -0,0 +1,156 @@ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/hx509/quote.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/hx509/quote.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/hx509/quote.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # + # Copyright (c) 2010 Kungliga Tekniska Högskolan +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/Makefile.am +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/Makefile.am ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/Makefile.am +@@ -89,7 +89,7 @@ idn_lookup_SOURCES = idn-lookup.c + + LDADD = libwind.la $(LIB_roken) + +-PYTHON = python ++PYTHON = python3 + + if !MAINTAINER_MODE + skip_python = test -f $@ || +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/UnicodeData.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/UnicodeData.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/UnicodeData.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-bidi.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-bidi.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-bidi.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-combining.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-combining.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-combining.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-errorlist.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-errorlist.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-errorlist.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-map.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-map.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-map.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-normalize.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-normalize.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-normalize.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-punycode-examples.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/gen-punycode-examples.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/gen-punycode-examples.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/generate.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/generate.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/generate.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/rfc3454.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/rfc3454.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/rfc3454.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/rfc4518.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/rfc4518.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/rfc4518.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/stringprep.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/stringprep.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/stringprep.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/util.py +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/lib/wind/util.py ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/lib/wind/util.py +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/python ++#!/usr/bin/python3 + # -*- coding: iso-8859-1 -*- + + # $Id$ +Index: heimdal-3e58559362dd3f485e6d6659d587a9169a131391/windows/NTMakefile.w32 +=================================================================== +--- heimdal-3e58559362dd3f485e6d6659d587a9169a131391.orig/windows/NTMakefile.w32 ++++ heimdal-3e58559362dd3f485e6d6659d587a9169a131391/windows/NTMakefile.w32 +@@ -120,7 +120,7 @@ RC=rc + AWK_CMD=gawk.exe + YACC_CMD=bison.exe + LEX_CMD=flex.exe +-PYTHON=python.exe ++PYTHON=python3.exe + PERL=perl.exe + CMP=cmp.exe + MAKECAT=makecat.exe diff --git a/heimdal.spec b/heimdal.spec index cde65c0..3dce8af 100644 --- a/heimdal.spec +++ b/heimdal.spec @@ -9,7 +9,7 @@ Name: heimdal Version: 7.7.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Kerberos 5 implementation without export restrictions License: BSD and MIT URL: http://www.heimdal.software/ @@ -36,9 +36,9 @@ Source31: %{name}-ipropd-slave-wrapper # klist, kswitch, and kvno are symlinks to "heimtools", and this utility needs # to know how to interpret the "heimdal-" prefixes. Patch1: heimdal-1.6.0-c25f45a-rename-commands.patch -# Use Python2 explicity. -Patch3: heimdal-7.5.0-explicit-python2.patch +Patch3: heimdal-7.7.0-pythonpath.patch Patch4: heimdal-7.7.0-configure.patch +Patch5: heimdal-7.7.0-58c8ad96-py3.patch BuildRequires: gettext BuildRequires: bison @@ -62,7 +62,7 @@ BuildRequires: libdb-devel %endif BuildRequires: doxygen BuildRequires: graphviz -BuildRequires: python2 +BuildRequires: python3 %if (0%{?rhel} && 0%{?rhel} < 7) BuildRequires: groff %else @@ -149,8 +149,9 @@ PATH. %prep %setup -q %patch1 -p1 -b .cmds -%patch3 -p1 -b .python2 +%patch3 -p1 -b .pythonpath %patch4 -p1 -b .config +%patch5 -p1 -b .2to3 ./autogen.sh @@ -494,6 +495,11 @@ fi %{_sysconfdir}/profile.d/%{name}.csh %changelog +* Sat Mar 21 2020 Alexander Boström - 7.7.0-5 +- Add Python 3 code patch +- Use Python 3 binary path +- BuildRequire Python 3 + * Wed Jan 29 2020 Fedora Release Engineering - 7.7.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild