From: Andre W. <wo...@us...> - 2004-11-18 07:50:14
|
Hi Andrea, On 17.11.04, Andrea Riciputi wrote: > First of all I'll summarize how Fink works. Here there are the main > steps (AFA I understood them): > > 1) fink create a new subtree: /sw/src/root-packagename > > 2) and put in there the expanded tarball and compile it > > 3) then it create another new subtree: /sw/src/root-packagename/sw > > 4) and it installs all the files under that subtree > > 5) at the end of this process you have all your files (in the case of > PyX) under: > > /sw/src/root-pyx-wierda-py23-0.7-6/sw/lib/python2.3/site-packages/pyx- > py23 > > /sw/src/root-pyx-wierda-py23-0.7-6/sw/share/pyx-py23 > > /sw/src/root-pyx-wierda-py23-0.7-6/sw/etc > > 5) at this point fink calls dpkg (the debian utily) that create a sort > of debian package. > > 6) eventually dpkg installs the new package in the right location. > > Given the above picture let me start with the first problem. > > ** pyxrc subtree ** > > Without the patch line: > > >--- PyX-0.7/setup.py.orig Mon Nov 15 16:30:04 2004 > > +++ PyX-0.7/setup.py Tue Nov > >16 13:24:08 2004 > >@@ -53,7 +53,7 @@ > > "pyx/lfs/foils30pt.lfs", > > > >"contrib/pyx.def"]), > > # /etc is taken relative to "setup.py install > >--root=..." - > >("/etc", ["pyxrc"])] > > + ("@PREFIX@/etc", ["pyxrc"])] > > self.root is '/sw/src/root-pyx-wierda-py23-0.7-6' and the pyxrc file is > written under /etc (not /sw/etc!!). As a side effect when the user try > to remove pyx (with fink remove pyx) dpkg recognize that the only file > that it has ever installed in /etc is pyxrc and so it removes /etc as > well!! I've been lucky enough that /etc under MacOSX is a sym-link and > not the effective directory!!! Oh my goodness. What I don't understand upto now is, why the pyxrc gets installed to "/etc". In step 4 above everything is fine. With the siteconfig below it should work on this installation position. Couldn't you do this by using the distutils install command with the proper --root and --prefix and without any patch? Then everything is fine, and you could copy it to the final location ... only the siteconfig.py would be needed to be adjusted (since you copy it around). > ** siteconfig.py ** > > Given the way in which Fink perform the installation process > sitecofing.py contains the following lines: > > lfsdir = '/sw/src/root-pyx-wierda-py23-0.7-6/sw/share/pyx' > sharedir = '/sw/src/root-pyx-wierda-py23-0.7-6/sw/share/pyx' > pyxrc = '/sw/src/root-pyx-wierda-py23-0.7-6/etc/pyxrc' > > because self.install_dir is '/sw/src/root-pyx-wierda-py23-0.7-6/sw' so > that PyX fails. The following patch fix the problem: > > >--- PyX-0.7/setup.py.orig Mon Nov 15 16:30:04 2004 > >+++ PyX-0.7/setup.py Tue Nov 16 13:24:08 2004 > > > >@@ -95,8 +98,11 @@ > > > > def run(self): > > install_data.run(self) > >- self.pyx_lfsdir = self.pyx_sharedir = > >os.path.join(self.install_dir, "share", "pyx") > >- self.pyx_pyxrc = os.path.join(self.root or "/", "etc", > >"pyxrc") > >+ self.pyx_lfsdir = self.pyx_sharedir = > >os.path.join("@PREFIX@", "share", "pyx-py@PYTHON_FLAVOR@") > >+ self.pyx_pyxrc = os.path.join("@PREFIX@", "etc", "pyxrc") Since you want to copy the finally installed version around, you're right to patch siteconfig.py. You can do so by a patch to the setup script, right, since you want to write some different data into that file. Alternatively you could also create your own siteconfig.py overwriting whatever was created by distutils and the PyX setup script when copying PyX to its final destination. > Evetually the @PYTHON_FLAVOR@ is mandatory because Fink still has > Python 2.2 and 2.3 flavours and a user may want to have both installed. I see. You want to get the shared data installed twice although it does not depend on the Python version (and the plattform). But thats not what shared data are for. While, ok, you can do it that way, another idea would be to make a python-pyx-common package for the share data (and a python-pyx-doc for the documentation) and some python2.x-pyx packages for the Python scripts. Ok, its a bit overkill, but the debian packages do it that way. André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |