From c46fc7308d9f2fd268049b74cf23fa324b9c20e468c51b0fd17043b50955dc6d Mon Sep 17 00:00:00 2001
From: Robert Schweikert <rjschwei@suse.com>
Date: Mon, 18 Sep 2017 14:45:35 +0000
Subject: [PATCH] Accepting request 526948 from home:kukuk:branches:Cloud:Tools

- python_sitelib does not seem to exist for non single-spec
  python modules, use python2_sitelib and python3_sitelib instead.

OBS-URL: https://build.opensuse.org/request/show/526948
OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=85
---
 cloud-init.changes |  6 ++++++
 cloud-init.spec    | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/cloud-init.changes b/cloud-init.changes
index 6d2f907..3b274a1 100644
--- a/cloud-init.changes
+++ b/cloud-init.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Mon Sep 18 09:39:26 CEST 2017 - kukuk@suse.de
+
+- python_sitelib does not seem to exist for non single-spec
+  python modules, use python2_sitelib and python3_sitelib instead.
+
 -------------------------------------------------------------------
 Mon Sep 11 18:21:54 UTC 2017 - rjschwei@suse.com
 
diff --git a/cloud-init.spec b/cloud-init.spec
index 9027b27..f4527ab 100644
--- a/cloud-init.spec
+++ b/cloud-init.spec
@@ -262,7 +262,7 @@ python3 -m testtools.run
 %if 0%{?suse_version} && 0%{?suse_version} <= 1315
 python setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python_sitelib} --init-system=%{initsys}
 %else
-python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python_sitelib} --init-system=%{initsys}
+python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} --init-system=%{initsys}
 %endif
 find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete
 # from debian install script
@@ -319,7 +319,11 @@ popd
 
 # remove duplicate files
 %if 0%{?suse_version}
+%if 0%{?suse_version} <= 1315
 %fdupes -n %{buildroot}%{python_sitelib}
+%else
+%fdupes -n %{buildroot}%{python3_sitelib}
+%endif
 %endif
 
 %if 0%{?suse_version} && 0%{?suse_version} <= 1210
@@ -338,11 +342,12 @@ popd
 %config(noreplace) %{_sysconfdir}/cloud/templates
 %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
 %{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
-%{python_sitelib}/cloudinit
 %if 0%{?suse_version} && 0%{?suse_version} <= 1315
+%{python_sitelib}/cloudinit
 %{python_sitelib}/cloud_init-%{version}-py%{py_ver}.egg-info
 %else
-%{python_sitelib}/cloud_init-%{version}-py%{py3_ver}.egg-info
+%{python3_sitelib}/cloudinit
+%{python3_sitelib}/cloud_init-%{version}-py%{py3_ver}.egg-info
 %endif
 %{_prefix}/lib/cloud-init
 %if 0%{?suse_version} && 0%{?suse_version} <= 1210
@@ -394,6 +399,10 @@ popd
 
 %files test
 %defattr(-,root,root)
+%if 0%{?suse_version} && 0%{?suse_version} <= 1315
 %{python_sitelib}/tests
+%else
+%{python3_sitelib}/tests
+%endif
 
 %changelog