File: private_pythondir

package info (click to toggle)
omniorb-dfsg 4.2.2-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 14,628 kB
  • sloc: cpp: 109,677; python: 24,939; ansic: 14,136; sh: 2,743; makefile: 96
file content (101 lines) | stat: -rw-r--r-- 3,624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Description: Place omniidl python modules in a private directory
 The omniidl code is not meant as importable code but just to make the
 tool work.  Therefore it should live in /usr/lib/omniidl in Debian.
 This also helps dh_python2 do the right thing.
Forwarded: no
Author: Floris Bruynooghe <flub@devork.be>
Last-Update: 2011-07-21

Index: b/mk/beforeauto.mk.in
===================================================================
--- a/mk/beforeauto.mk.in
+++ b/mk/beforeauto.mk.in
@@ -40,8 +40,8 @@ INSTALLTARGET 	 := 1
 INSTALLINCDIR 	 := $(DESTDIR)@includedir@
 INSTALLBINDIR 	 := $(DESTDIR)@bindir@
 INSTALLLIBDIR 	 := $(DESTDIR)@libdir@
-INSTALLPYTHONDIR := $(DESTDIR)@pythondir@
-INSTALLPYEXECDIR := $(DESTDIR)@pyexecdir@
+INSTALLPYTHONDIR := $(DESTDIR)/usr/lib/omniidl
+INSTALLPYEXECDIR := $(DESTDIR)/usr/lib/omniidl
 INSTALLIDLDIR    := $(DESTDIR)@datadir@/idl
 
 
Index: b/src/tool/omniidl/python/scripts/omniidl.in
===================================================================
--- a/src/tool/omniidl/python/scripts/omniidl.in
+++ b/src/tool/omniidl/python/scripts/omniidl.in
@@ -43,8 +43,8 @@ import os, os.path
 pylibdir   = archlibdir = None
 binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
 
-# Try a path based on the installation prefix
-sppath = "@prefix@/lib/python" + sys.version[:3] + "/site-packages"
+# Try a path based on the installation prefix, customised for Debian
+sppath = "@prefix@/lib/omniidl"
 
 if os.path.isdir(sppath):
     sys.path.append(sppath)
@@ -92,20 +92,6 @@ if binarchdir != "":
         if os.path.isdir(archlibdir):
             sys.path.insert(0, archlibdir)
 
-# Last chance, try a path based on the installation prefixes
-sys.path.append("@prefix@/lib/python" + sys.version[:3] + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + sys.version[:3] + "/site-packages",
-          "@pythondir@",
-          "@pyexecdir@" ]
-
-
-# Autoconf insists on making our life difficult...
-for path in paths:
-    path = path.replace("${exec_prefix}", "@exec_prefix@")
-    path = path.replace("${prefix}", "@prefix@")
-    sys.path.append(path)
-
 try:
     import _omniidl
 except ImportError, msg:
Index: b/src/tool/omniidl/python3/scripts/omniidl.in
===================================================================
--- a/src/tool/omniidl/python3/scripts/omniidl.in
+++ b/src/tool/omniidl/python3/scripts/omniidl.in
@@ -43,11 +43,11 @@ import os, os.path
 pylibdir   = archlibdir = None
 binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
 
-# Try a path based on the installation prefix
-sppath = "@prefix@/lib/python" + sys.version[:3] + "/site-packages"
-
-if os.path.isdir(sppath):
-    sys.path.append(sppath)
+omniidldir = "/does-not-exist"
+if binarchdir == "/usr/bin":
+    omniidldir = os.path.join(os.path.dirname(binarchdir), "lib", "omniidl")
+if os.path.isdir(omniidldir):
+    sys.path.insert(0, omniidldir)
 
 # Paths in a traditional omni tree
 if binarchdir != "":
@@ -92,20 +92,6 @@ if binarchdir != "":
         if os.path.isdir(archlibdir):
             sys.path.insert(0, archlibdir)
 
-# Last chance, try a path based on the installation prefixes
-sys.path.append("@prefix@/lib/python" + sys.version[:3] + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + sys.version[:3] + "/site-packages",
-          "@pythondir@",
-          "@pyexecdir@" ]
-
-
-# Autoconf insists on making our life difficult...
-for path in paths:
-    path = path.replace("${exec_prefix}", "@exec_prefix@")
-    path = path.replace("${prefix}", "@prefix@")
-    sys.path.append(path)
-
 try:
     import _omniidl
 except ImportError as msg: