From d5cd9edd167277c6d264b7488ec7afb1668cf36969f09d7a405a16bc4a5d2fb3 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 28 Apr 2020 08:21:00 +0000
Subject: [PATCH] - Switch to python3

OBS-URL: https://build.opensuse.org/package/show/devel:tools/coccinelle?expand=0&rev=77
---
 coccinelle.changes |  5 +++++
 coccinelle.spec    | 15 ++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/coccinelle.changes b/coccinelle.changes
index f0dfeeb..3535046 100644
--- a/coccinelle.changes
+++ b/coccinelle.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Tue Apr 28 08:11:49 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
+
+- Switch to python3
+
 -------------------------------------------------------------------
 Tue Feb 18 11:11:11 UTC 2020 - olaf@aepfle.de
 
diff --git a/coccinelle.spec b/coccinelle.spec
index a691a5c..b028aa1 100644
--- a/coccinelle.spec
+++ b/coccinelle.spec
@@ -29,15 +29,16 @@ BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  fdupes
 BuildRequires:  ncurses-devel
-BuildRequires:  ocaml(ocaml.opt)
 BuildRequires:  ocaml-findlib
 BuildRequires:  ocaml-menhir-devel
 BuildRequires:  ocaml-ocamlbuild
 BuildRequires:  ocaml-ocamldoc >= 3.11
 BuildRequires:  ocaml-parmap-devel
 BuildRequires:  ocaml-pcre-devel
-BuildRequires:  pkgconfig(python)
-Requires:       python-base
+BuildRequires:  python-rpm-macros
+BuildRequires:  ocaml(ocaml.opt)
+BuildRequires:  pkgconfig(python3)
+Requires:       python3-base
 
 %description
 Coccinelle is a program matching and transformation engine which
@@ -79,15 +80,15 @@ rm -Rf "%buildroot/%_libdir/%name"/{commons,globals,ocaml,parsing_c} \
 %fdupes %buildroot/%_prefix
 
 # Python library have been named after directories in the site-packages hierarchy
-mkdir -p "%buildroot/%python_sitelib"
-mv "%buildroot/%_libdir/%name/python/coccilib" "%buildroot/%python_sitelib"
-%fdupes %buildroot/%python_sitelib/coccilib
+mkdir -p "%buildroot/%python3_sitelib"
+mv "%buildroot/%_libdir/%name/python/coccilib" "%buildroot/%python3_sitelib"
+%fdupes %buildroot/%python3_sitelib/coccilib
 
 %files
 %doc authors.txt bugs.txt changes.txt copyright.txt credits.txt
 %license license.txt
 %doc readme.txt
-%{python_sitelib}/coccilib
+%python3_sitelib/coccilib
 %_mandir/man?/*
 %_bindir/sp*
 %_libdir/%name