Description: On Debian Python packages are stored in 'dist-packages', not
 'site-packages'.
Author: Andrius Merkys <merkys@debian.org>
Forwarded: not-needed
--- a/cmake_support/CopyDependencies.cmake
+++ b/cmake_support/CopyDependencies.cmake
@@ -1012,7 +1012,7 @@
   endif()
   file(COPY ${python_libs} DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_DIR})
   foreach( additional_directory $ENV{PYTHONPATH})
-    file(COPY ${additional_directory}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version}/site-packages PATTERN "*.pyc" EXCLUDE)
+    file(COPY ${additional_directory}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version}/dist-packages PATTERN "*.pyc" EXCLUDE)
   endforeach()
   file(COPY ${python_root_dir}/bin/python${version} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
   set(${new_binary_path} "${CMAKE_INSTALL_PREFIX}/bin/python${version}" PARENT_SCOPE)
--- a/deployment/macos/deps.py
+++ b/deployment/macos/deps.py
@@ -188,11 +188,11 @@
   that ost was linked against the same version of Python
   """
   for p in sys.path:
-    pattern='/site-packages'
+    pattern='/dist-packages'
     index=p.find(pattern)
     if index>=0:
       return p[:index+len(pattern)]
-  raise RuntimeError("Couldn't determine site-packages location")
+  raise RuntimeError("Couldn't determine dist-packages location")
 
 def get_python_module_path(module):
   for path in sys.path:
@@ -239,7 +239,7 @@
   # when running in non-gui mode, we are most likely missing the boost
   # python library. Let's add it to the list of dependencies by
   # inspecting "_ost_base.so".
-  pymod_dir='lib/python%d.%d/site-packages' % sys.version_info[0:2]
+  pymod_dir='lib/python%d.%d/dist-packages' % sys.version_info[0:2]
   _deps_for_lib(os.path.join(stage_dir, pymod_dir, 'ost/_ost_base.so'),
                 deps, recursive=False)
   print('copying dependencies')
@@ -267,8 +267,8 @@
       print('also copying python modules from %s' % python_home)
       modules_dst=os.path.join(outdir, 'lib', os.path.basename(python_home))
       shutil.copytree(python_home, modules_dst)
-      if os.path.exists(os.path.join(modules_dst, 'site-packages')):
-        shutil.rmtree(os.path.join(modules_dst, 'site-packages'))
+      if os.path.exists(os.path.join(modules_dst, 'dist-packages')):
+        shutil.rmtree(os.path.join(modules_dst, 'dist-packages'))
       copy_binaries(os.path.join(python_home, '../..'), outdir, 
                     ['python'], [], 'bin')
       python_bin=os.path.abspath(os.path.join(python_home, '../../bin/python'))
@@ -290,7 +290,7 @@
       version_string=sys.version[0:3]
       prefix, postfix=split_framework_components(python_home)
       site_packages_dir=os.path.join(outdir, 'lib', 'Python.framework', 
-                                 postfix, 'site-packages')
+                                 postfix, 'dist-packages')
       if os.path.exists(site_packages_dir):
         shutil.rmtree(site_packages_dir)
       for directory in glob.glob(os.path.join(framework_path, 'Versions/*')):
@@ -307,7 +307,7 @@
   if no_includes:
     os.system(REMOVE_HEADERS % outdir)
     os.system(REMOVE_CURRENT % outdir)  
-  print('copying site-packages')
+  print('copying dist-packages')
   for sp in SITE_PACKAGES:
     src=get_python_module_path(sp)
     if os.path.isdir(src):
--- a/deployment/macos/pack.py
+++ b/deployment/macos/pack.py
@@ -231,11 +231,11 @@
   reasonable thing to do, as this script is most likely run with ost).
   """
   for p in sys.path:
-    pattern='/site-packages'
+    pattern='/dist-packages'
     index=p.find(pattern)
     if index>=0:
       return p[:index+len(pattern)]
-  raise RuntimeError("Couldn't determine site-packages location")
+  raise RuntimeError("Couldn't determine dist-packages location")
 
 def get_python_module_path(module):
   for path in sys.path:
@@ -263,7 +263,7 @@
     self.libexec_dir=libexec_dir
     self.libexec_scripts=libexec_scripts
     self.pymod_dir=os.path.join('lib', 'python%d.%d' % sys.version_info[0:2],
-                                'site-packages')
+                                'dist-packages')
     self.modules=modules
     self.libexec_binaries=[]
     self.site_packages=[]
@@ -314,7 +314,7 @@
     # when running in non-gui mode, we are most likely missing the boost
     # python library. Let's add it to the list of dependencies by
     # inspecting "_ost_base.so".
-    pymod_dir='lib/python%d.%d/site-packages' % sys.version_info[0:2]
+    pymod_dir='lib/python%d.%d/dist-packages' % sys.version_info[0:2]
     _deps_for_lib(os.path.join(self.root_dir, pymod_dir, 'ost/_ost_base.so'),
                   deps, recursive=False)
     self.status('copying dependencies')
--- a/deployment/win/create_archive.bat.in
+++ b/deployment/win/create_archive.bat.in
@@ -11,7 +11,7 @@
 if exist %archive_name%.zip del %archive_name%.zip*.*
 REM dir /S %inst_dir%
 mkdir "%inst_dir%\share\openstructure\examples"
-mkdir "%inst_dir%\lib\site-packages"
+mkdir "%inst_dir%\lib\dist-packages"
 mkdir "%inst_dir%\bin"
 xcopy  /E /I /Y /EXCLUDE:exclude_file_types  ..\..\examples "%inst_dir%\share\openstructure\examples"
 xcopy  /E /I /Y /EXCLUDE:exclude_file_types ..\..\stage\share "%inst_dir%\share\"
--- a/doc/conf/conf.py
+++ b/doc/conf/conf.py
@@ -13,7 +13,7 @@
 
 import sys, os
 
-site_packs='python%d.%d/site-packages' % sys.version_info[0:2]
+site_packs='python%d/dist-packages' % sys.version_info[0]
 # here we make sure that these paths are checked first...
 # note that we probably should use cmake to set these paths (see PM3)
 sys.path.insert(0, os.path.join(os.path.abspath('../../build'),
--- a/modules/gui/src/gosty.cc
+++ b/modules/gui/src/gosty.cc
@@ -111,7 +111,7 @@
 #ifdef _MSC_VER
   String loc=root+"\\lib\\"+site_pkgs.str()+"\\site-packages";
 #else  
-  String loc=root+"/lib/"+site_pkgs.str()+"/site-packages";
+  String loc=root+"/lib/"+site_pkgs.str()+"/dist-packages";
 #endif
   pi.AppendModulePath(QString::fromStdString(loc));
   // dng is an interactive python session, so add '.' to search path
--- a/scripts/dng.bat.in
+++ b/scripts/dng.bat.in
@@ -30,4 +30,4 @@
 REM "%BIN_DIR%\@BUILD_TYPE@\gosty.exe" "%DNG_ROOT%\@LIBDIR@\openstructure\dng_startup" ost %*
 
 set PATH=%BIN_DIR%;%DNG_ROOT%\@LIBDIR@\;%PATH%
-"%DNG_ROOT%\libexec\openstructure\gosty.exe" "%DNG_ROOT%\@LIBDIR@\python3.6\site-packages\ost\dng_startup" ost %*
+"%DNG_ROOT%\libexec\openstructure\gosty.exe" "%DNG_ROOT%\@LIBDIR@\python3.6\dist-packages\ost\dng_startup" ost %*
--- a/scripts/ost-nightly-build.sh
+++ b/scripts/ost-nightly-build.sh
@@ -148,9 +148,9 @@
     'dirs': ["include/ost"],
 }
 
-# add \$INSTALLDIR/lib64/python3.6/site-packages to PYTHONPATH
+# add \$INSTALLDIR/lib64/python3.6/dist-packages to PYTHONPATH
 modextrapaths = {
-    'PYTHONPATH': 'lib64/python%s/site-packages' % (pythonshortversion)
+    'PYTHONPATH': 'lib64/python%s/dist-packages' % (pythonshortversion)
 }
 
 # OST_ROOT env var points to install directory
--- a/scripts/ost_startup.py.in
+++ b/scripts/ost_startup.py.in
@@ -79,7 +79,7 @@
         sys.exit(-1)
 
 
-_site_packs = "python%d.%d/site-packages" % sys.version_info[0:2]
+_site_packs = "python%d.%d/dist-packages" % sys.version_info[0:2]
 _base_dir = os.getenv("DNG_ROOT")
 sys.path.insert(0, os.path.join(_base_dir, "@LIBDIR@", _site_packs))
 
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,7 +201,7 @@
 # Python needed before Boost
 find_package(Python 3.6 REQUIRED COMPONENTS Interpreter Development)
 # where Python modules live
-set(PYTHON_MODULE_PATH "python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/")
+set(PYTHON_MODULE_PATH "python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/")
 
 set(_BOOST_MIN_VERSION 1.70)
 
