summaryrefslogtreecommitdiff
blob: 566fb4ef425cc20c53a78f8d5e7ed69e32b8675c (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
diff -ruaN PyX-0.8.1/pyx/siteconfig.py PyX-0.8.1.new/pyx/siteconfig.py
--- PyX-0.8.1/pyx/siteconfig.py	2005-07-14 00:02:12.000000000 +1000
+++ PyX-0.8.1.new/pyx/siteconfig.py	2005-08-19 16:53:35.000000000 +1000
@@ -1,36 +1,4 @@
-#!/usr/bin/env python
-# -*- coding: ISO-8859-1 -*-
-#
-#
-# Copyright (C) 2004-2005 Andr� Wobst <wobsta@users.sourceforge.net>
-#
-# This file is part of PyX (http://pyx.sourceforge.net/).
-#
-# PyX is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# PyX is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with PyX; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# This file configures PyX search paths relative to the current
-# position, e.g. for local usage. When installing PyX via distutils
-# the contents of this file is not copied to the PyX installation.
-# Instead the correct information about the paths from the installation
-# process are used.
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-import os
-
-lfsdir = os.path.join(os.path.dirname(__file__), "lfs")
-sharedir = os.path.join(os.path.dirname(__file__), "..", "contrib")
-pyxrcdir = os.path.join(os.path.dirname(__file__), "..")
+lfsdir = "/usr/share/pyx"
+sharedir = "/usr/share/pyx"
+pyxrcdir = "/etc/pyxrc"
 
diff -ruaN PyX-0.8.1/pyx/siteconfig.py.orig PyX-0.8.1.new/pyx/siteconfig.py.orig
--- PyX-0.8.1/pyx/siteconfig.py.orig	1970-01-01 10:00:00.000000000 +1000
+++ PyX-0.8.1.new/pyx/siteconfig.py.orig	2005-08-19 16:49:15.000000000 +1000
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# -*- coding: ISO-8859-1 -*-
+#
+#
+# Copyright (C) 2004-2005 Andr� Wobst <wobsta@users.sourceforge.net>
+#
+# This file is part of PyX (http://pyx.sourceforge.net/).
+#
+# PyX is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PyX is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with PyX; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# This file configures PyX search paths relative to the current
+# position, e.g. for local usage. When installing PyX via distutils
+# the contents of this file is not copied to the PyX installation.
+# Instead the correct information about the paths from the installation
+# process are used.
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+import os
+
+lfsdir = os.path.join(os.path.dirname(__file__), "lfs")
+sharedir = os.path.join(os.path.dirname(__file__), "..", "contrib")
+pyxrcdir = os.path.join(os.path.dirname(__file__), "..")
+
diff -ruaN PyX-0.8.1/setup.py PyX-0.8.1.new/setup.py
--- PyX-0.8.1/setup.py	2005-08-13 22:32:46.000000000 +1000
+++ PyX-0.8.1.new/setup.py	2005-08-19 16:49:02.000000000 +1000
@@ -77,84 +77,6 @@
 # we put the global pyxrc into the share directory as well.
 adddatafiles("pyxrcdir", os.name != "nt" and "/etc" or "share/pyx", ["pyxrc"])
 
-################################################################################
-# extend install commands to overwrite siteconfig.py during build and install
-#
-
-
-class pyx_build_py(build_py):
-
-    def build_module(self, module, module_file, package):
-        if package == "pyx" and module == "siteconfig":
-            # generate path information as the original build_module does it
-            outfile = self.get_module_outfile(self.build_lib, [package], module)
-            outdir = os.path.dirname(outfile)
-            self.mkpath(outdir)
-
-            if log:
-                log.info("creating proper %s" % outfile)
-
-            # create the additional relative path parts to be inserted into the
-            # os.path.join methods in the original siteconfig.py
-            indir = os.path.dirname(module_file)
-            addjoinstring = ", ".join(["'..'" for d in outdir.split(os.path.sep)] +
-                                      ["'%s'" % d for d in indir.split(os.path.sep)])
-
-            # write a modifed version of siteconfig.py
-            fin = open(module_file, "r")
-            fout = open(outfile, "w")
-            for line in fin.readlines():
-                fout.write(line.replace("os.path.join(os.path.dirname(__file__), ",
-                                        "os.path.join(os.path.dirname(__file__), %s, " % addjoinstring))
-            fin.close()
-            fout.close()
-        else:
-            return build_py.build_module(self, module, module_file, package)
-
-
-class pyx_install_data(install_data):
-
-    def run(self):
-        self.siteconfiglines = []
-        for dir, files in self.data_files:
-            # append siteconfiglines by "<siteconfigname> = <dir>"
-
-            # get the install directory
-            # (the following four lines are copied from within the install_data.run loop)
-            dir = convert_path(dir)
-            if not os.path.isabs(dir):
-                dir = os.path.join(self.install_dir, dir)
-            elif self.root:
-                dir = change_root(self.root, dir)
-
-            self.siteconfiglines.append("%s = '%s'\n" % (siteconfignames[files], dir))
-
-        install_data.run(self)
-
-
-class pyx_install_lib(install_lib):
-
-    def run(self):
-        # siteconfig.py depends on install_data:
-        self.run_command('install_data')
-        install_lib.run(self)
-
-    def install(self):
-        # first we perform the tree_copy
-        result = install_lib.install(self)
-
-        # siteconfiglines have been created by install_data
-        siteconfiglines = self.distribution.command_obj["install_data"].siteconfiglines
-
-        # such that we can easily overwrite siteconfig.py
-        outfile = os.path.join(self.install_dir, "pyx", "siteconfig.py")
-        if log:
-            log.info("creating proper %s" % outfile)
-        f = open(outfile, "w")
-        f.writelines(siteconfiglines)
-        f.close()
-
-        return result
 
 ################################################################################
 # additional package metadata (only available in Python 2.3 and above)
@@ -193,7 +115,4 @@
       packages=["pyx", "pyx/graph", "pyx/graph/axis", "pyx/t1strip", "pyx/pykpathsea"],
       ext_modules=ext_modules,
       data_files=data_files,
-      cmdclass = {"build_py": pyx_build_py,
-                  "install_data": pyx_install_data,
-                  "install_lib": pyx_install_lib},
       **addargs)