And another one for tpclient-pywx
Another try at fixing the executable symlink: there need to be two
directories - temporary and final location. Usually (in autotools, at least)
the latter is specified by --prefix parameter, which in setup.py is used to
specify temporary location. I changed meaning of --prefix to match that of
autotools and added --temp parameter, which points to temporary directory.

Is setup.py a standard thing, or is it tp-specific and replicated between
Python packages?...
-KS


----------------------------------------------------------------------
Zmien konto na takie o nieograniczonej pojemnosci.
Za darmo w INTERIA.PL

>>>http://link.interia.pl/f1b0a
From cd94e1d1da688868a7810433da106b6ef1148b94 Mon Sep 17 00:00:00 2001
From: Krzysztof Sobolewski <[EMAIL PROTECTED]>
Date: Fri, 17 Aug 2007 23:09:49 +0200
Subject: [PATCH] Debian package: fix the /usr/bin/tpclient-pywx symlink by changing the meaning of --prefix and adding --temp options to setup.py

---
 debian/rules |    2 +-
 setup.py     |   21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/debian/rules b/debian/rules
index 935fa71..205a33a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,7 +34,7 @@ install:
 	dh_testdir
 	dh_installdirs
 	#$(MAKE) DESTDIR=$(CURDIR)/debian/tpclient-pywx install
-	python setup.py install --prefix=$(CURDIR)/debian/tpclient-pywx/usr
+	python setup.py install --temp=$(CURDIR)/debian/tpclient-pywx/usr --prefix=/usr
 
 #install: build $(PYVERS:%=install-python%)
 
diff --git a/setup.py b/setup.py
index fc78868..7e7232a 100755
--- a/setup.py
+++ b/setup.py
@@ -51,16 +51,22 @@ if sys.platform.startswith('linux') and "install" in sys.argv:
 		return
 
 	prefix = "/usr/local"
+	temp = "debian/tpclient-pywx/usr"
 	if "--prefix" in sys.argv:
 		prefix = sys.argv[sys.argv.index('--prefix')+1]
+	if "--temp" in sys.argv:
+		temp = sys.argv[sys.argv.index('--temp')+1]
 	for arg in sys.argv:
 		if arg.startswith('--prefix='):
 			trash, prefix = arg.split('=')
+		elif arg.startswith('--temp='):
+			trash, temp = arg.split('=')
 
-	print "Installing too...", prefix
+	print "Installing to...", temp
+	print "Target is...", prefix
 
 	# Documentation goes to
-	docpath  = os.path.join(prefix, "share/doc/tpclient-pywx")
+	docpath  = os.path.join(temp, "share/doc/tpclient-pywx")
 	print 'docpath', docpath
 	makedirs(docpath)
 
@@ -69,7 +75,7 @@ if sys.platform.startswith('linux') and "install" in sys.argv:
 		shutil.copy2(file, docpath)
 
 	# Locale files
-	localepath = os.path.join(prefix, "share/locale/%s/LC_MESSAGES/")
+	localepath = os.path.join(temp, "share/locale/%s/LC_MESSAGES/")
 	print 'localepath', localepath
 	for dir in os.listdir('locale'):
 		if os.path.isfile(os.path.join('locale', dir)):
@@ -81,12 +87,13 @@ if sys.platform.startswith('linux') and "install" in sys.argv:
 		shutil.copy2(os.path.join('locale', dir, 'tpclient-pywx.mo'), llocalepath)
 
 	# Graphics files
-	graphicspath = os.path.join(prefix, "share/tpclient-pywx")
+	graphicspath = os.path.join(temp, "share/tpclient-pywx")
 	print 'graphicspath', graphicspath
 	shutil.copytree('graphics', graphicspath)
 
 	# Private python file
-	privatepath = os.path.join(prefix, "lib/tpclient-pywx/")
+	libpath = 'lib/tpclient-pywx/';
+	privatepath = os.path.join(temp, libpath)
 	print 'librarypath', privatepath
 	makedirs(privatepath)
 
@@ -108,10 +115,10 @@ if sys.platform.startswith('linux') and "install" in sys.argv:
 	shutil.copy2(os.path.join('doc', 'tp-pywx-installed'), os.path.join(privatepath, 'tp-pywx-installed'))
 
 	# Executables
-	binpath     = os.path.join(prefix, "bin")
+	binpath     = os.path.join(temp, "bin")
 	print 'binpath', binpath
 	makedirs(binpath)
-	os.symlink(os.path.join(privatepath, 'tp-pywx-installed'), os.path.join(binpath, 'tpclient-pywx'))
+	os.symlink(os.path.join(prefix, libpath, 'tp-pywx-installed'), os.path.join(binpath, 'tpclient-pywx'))
 
 	sys.exit()
 
-- 
1.5.2.4

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to