File: distutils-debian.dpatch

package info (click to toggle)
python2.4 2.4.6-1%2Blenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 44,888 kB
  • ctags: 86,995
  • sloc: ansic: 306,391; python: 271,931; sh: 10,210; makefile: 4,248; perl: 3,736; lisp: 3,678; xml: 894; objc: 756; cpp: 7; sed: 2
file content (91 lines) | stat: -rw-r--r-- 3,308 bytes parent folder | download | duplicates (5)
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
#! /bin/sh -e

# DP: Add a --debian option for the distutils install command to install
# DP: into /usr/lib/pythonX.Y/dist-packages.

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
	echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
        exit 1
esac
exit 0

--- Lib/distutils/command/install.py~	2006-01-12 02:22:53.473809760 +0100
+++ Lib/distutils/command/install.py	2006-01-24 11:53:15.565459512 +0100
@@ -44,6 +44,13 @@
         'scripts': '$base/bin',
         'data'   : '$base',
         },
+    'debian_prefix': {
+        'purelib': '$base/lib/python$py_version_short/dist-packages',
+        'platlib': '$platbase/lib/python$py_version_short/dist-packages',
+        'headers': '$base/include/python$py_version_short/$dist_name',
+        'scripts': '$base/bin',
+        'data'   : '$base',
+        },
     'unix_home': {
         'purelib': '$base/lib/python',
         'platlib': '$base/lib/python',
@@ -86,6 +93,8 @@
          "(Unix only) prefix for platform-specific files"),
         ('home=', None,
          "(Unix only) home directory to install under"),
+        ('debian', None,
+         "install into distribution specific locations for deb based distributions"),
 
         # Or, just set the base director(y|ies)
         ('install-base=', None,
@@ -148,6 +157,7 @@
         self.prefix = None
         self.exec_prefix = None
         self.home = None
+        self.debian = None
 
         # These select only the installation base; it's up to the user to
         # specify the installation scheme (currently, that means supplying
@@ -231,15 +241,15 @@
         # Check for errors/inconsistencies in the options; first, stuff
         # that's wrong on any platform.
 
-        if ((self.prefix or self.exec_prefix or self.home) and
+        if ((self.prefix or self.exec_prefix or self.home or self.debian) and
             (self.install_base or self.install_platbase)):
             raise DistutilsOptionError, \
-                  ("must supply either prefix/exec-prefix/home or " +
+                  ("must supply either prefix/exec-prefix/home/debian or " +
                    "install-base/install-platbase -- not both")
 
-        if self.home and (self.prefix or self.exec_prefix):
+        if (self.home or self.debian) and (self.prefix or self.exec_prefix):
             raise DistutilsOptionError, \
-                  "must supply either home or prefix/exec-prefix -- not both"
+                  "must supply either home/debian or prefix/exec-prefix -- not both"
 
         # Next, stuff that's wrong (or dubious) only on certain platforms.
         if os.name != "posix":
@@ -394,7 +404,10 @@
 
             self.install_base = self.prefix
             self.install_platbase = self.exec_prefix
-            self.select_scheme("unix_prefix")
+            if self.debian is not None:
+                self.select_scheme("debian_prefix")
+            else:
+                self.select_scheme("unix_prefix")
 
     # finalize_unix ()