From: Stas Z. <sta...@us...> - 2005-08-11 13:22:41
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21992 Modified Files: Qgcm.e3p filelist Added Files: setup.py Removed Files: INSTALL.sh Log Message: Changed the install to the gailagent kind of install --- NEW FILE: setup.py --- #!/usr/bin/env python # # This is the distutils setup script for GmailAgent. # Based on the pygame setup scripts. # Change this to the location where the help files, manpage and docs should be located. # A special file will be created and placed inside the GmailAgent directory # pointing to this location. basepath = '/usr/local/share' execpath = '/usr/local/bin/gcm-qt' import version DESCRIPTION = """gcm-qt is a frontend to the libgmail contacts support using the QT widget set. It's part of the GmailAgent project.""" METADATA = { "name": "gcm-qt", "version": version.VERSION, "license": "GPL", "url": "http://gmailagent.sf.net", "author": "Stas Zytkiewicz", "author_email": "gma...@us...", "description": "QT GUI frontend to the libgmail contacts support.", "long_description": DESCRIPTION, } try: import distutils except ImportError: raise SystemExit, "gcm-qt requires distutils (Python-dev) to build and install." #get us to the correct directory import os, sys path = os.path.split(os.path.abspath(sys.argv[0]))[0] os.chdir(path) import os.path, glob import distutils.sysconfig from distutils.core import setup from distutils.command.install_data import install_data #extra files to install data_files = [] sys.argv.append('install') #add non .py files in directory for f in glob.glob('*'): if not f[-3:] =='.py' and os.path.isfile(f): data_files.append(f) #data installer with improved intelligence over distutils #data files are copied into the project directory instead #of willy-nilly class smart_install_data(install_data): def run(self): #need to change self.install_dir to the actual library dir install_cmd = self.get_finalized_command('install') self.install_dir = getattr(install_cmd, 'install_lib') return install_data.run(self) #finally, #call distutils with all needed info PACKAGEDATA = { "cmdclass": {'install_data': smart_install_data}, "packages": ['GCM-qt'], "package_dir": {'GCM-qt':''}, "data_files": [['GCM-qt', data_files]], } PACKAGEDATA.update(METADATA) apply(setup, [], PACKAGEDATA) destdir = os.path.join(distutils.sysconfig.get_python_lib(),'GCM-qt') print "destdir",destdir try: f = open(execpath,'w') f.write("#!/bin/sh\n") f.write("exec python %s $*\n" % os.path.join(destdir,'Qgcm.py')) f.close() cmd = 'chmod +x %s' % execpath os.system(cmd) except Exception,info: print info print "Failed to install the executable" print "Please contact gma...@us..." sys.exit(1) ## From here gcm is installed and there's a shell starter installed. ## Now we going to install the help files and some docs. docbasepath = os.path.join(basepath,'doc','GCM-qt') helppath = os.path.join(docbasepath,'help') docpath = os.path.join(docbasepath,'doc') manpath = os.path.join(basepath,'man','man1') ##try: ## os.makedirs(helppath) ##except: ## pass try: os.makedirs(docpath) except: pass ##try: ## os.makedirs(manpath) ##except: ## pass print "copying the docs to %s" % docbasepath try: os.system('cp -rf docs/* %s' % docpath) ##print "copying the manpage to %s" % manpath ##os.system('mv %s %s' % (os.path.join(docpath,'gmailagent.1.gz'),manpath)) print "Moving README to %s" % docpath os.system('mv %s %s' % (os.path.join(destdir,'README'),docpath)) ##os.system('mv %s %s' % (os.path.join(destdir,'INSTALL'),docpath)) except Exception,info: print info print "Failed to install the docs" print "=========== Installation Ok ================" print "\nThe gcm-qt executable is installed in\n %s" % os.path.dirname(execpath) print "You should read the README file that came with this package\nfor possible usage" print "Enjoy" --- INSTALL.sh DELETED --- Index: Qgcm.e3p =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/Qgcm.e3p,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Qgcm.e3p 7 Aug 2005 19:08:46 -0000 1.1.1.1 --- Qgcm.e3p 11 Aug 2005 13:22:33 -0000 1.2 *************** *** 2,6 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project Qgcm --> ! <!-- Saved: 2005-08-06, 21:21:26 --> <!-- Copyright (C) 2005 , --> <Project version="3.5"> --- 2,6 ---- <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project Qgcm --> ! <!-- Saved: 2005-08-10, 16:44:28 --> <!-- Copyright (C) 2005 , --> <Project version="3.5"> *************** *** 26,32 **** </Source> <Source> - <Name>testContrgcm.py</Name> - </Source> - <Source> <Name>QgcmDialogs.py</Name> </Source> --- 26,29 ---- Index: filelist =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/filelist,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filelist 10 Aug 2005 14:42:47 -0000 1.1 --- filelist 11 Aug 2005 13:22:33 -0000 1.2 *************** *** 10,12 **** version.py README ! INSTALL.sh --- 10,12 ---- version.py README ! setup.py |