Changeset 3257

Show
Ignore:
Timestamp:
11/23/07 22:39:58 (17 years ago)
Author:
jerome
Message:

Now detects the TCP port PostgreSQL is listening to : Debian makes
PostgreSQL 7.x listen to port 5432 (PostgreSQL's default) by default
and PostgreSQL 8.x listen to port 5433, to allow both versions to
coexist on the same machine. Unfortunately when only 8.x is
installed, as it should be, port 5433 is still used and PyKota
installations done through pksetup would fail at database connection
time.
Fixed pkpgcounter's version number to use the latest available at
this time (i.e. 3.30). A better method should be used to detect this
release number automatically.
Fixed paths to the latest release of GhostPCL, which is now part of
GhostPDL, itself licensed under the terms of the GNU GPL v2 (and NOT
later). I believe MegaPacks? could now include GhostPCL if we ever
want to.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pksetup

    r3236 r3257  
    197197         
    198198    otherpackages = [ { "name" : "pkpgcounter", 
    199                         "version" : "2.17", 
     199                        "version" : "3.30", 
    200200                        "url" : "http://www.pykota.com/software/%(name)s/download/tarballs/%(name)s-%(version)s.tar.gz", 
    201201                        "commands" : [ "tar -zxf %(name)s-%(version)s.tar.gz", 
     
    212212                                     ], 
    213213                      }, 
    214                       { "name" : "ghostpcl", 
    215                         "version" : "1.41p1", 
    216                         "url" : "ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/GhostPCL/%(name)s_%(version)s.tar.bz2",  
     214                      { "name" : "ghostpdl", 
     215                        "version" : "1.51", 
     216                        "url" : "http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/%(name)s/%(name)s-%(version)s.tar.bz2", 
    217217                        "commands" : [ "bunzip2 <%(name)s_%(version)s.tar.bz2 | tar -xf -", 
    218218                                       "cd %(name)s_%(version)s", 
    219                                        "make fonts", 
    220                                        "make product", 
    221                                        "make install", 
     219                                       "make pcl", 
     220                                       "make pcl_install", 
    222221                                     ], 
    223222                      }, 
     
    282281                download = 'svn export "%(url)s" %(name)s' % locals() 
    283282            else :     
    284                 download = 'wget "%(url)s"' % locals() 
     283                download = 'wget --user-agent=pksetup "%(url)s"' % locals() 
    285284            if self.confirmCommand("to download %(name)s" % locals(), download) : 
    286285                self.confirmCommand("to install %(name)s" % locals(), commands) 
     
    321320                        conflines.insert(1, "local\tpykota\tpykotaadmin,pykotauser\t\tmd5") 
    322321                    conf = "\n".join(conflines) 
     322                    port = 5432 
     323                    if tcpip : 
     324                        answer = self.confirmPipe("to see on which TCP port PostgreSQL accepts connections", "grep ^port %(pgconffile)s" % locals()) 
     325                        if answer is not False : 
     326                            try : 
     327                                port = int([p.strip() for p in answer.strip().split("=")][1]) 
     328                            except (ValueError, IndexError, TypeError) : 
     329                                pass 
    323330                    self.confirmCommand("to configure PostgreSQL correctly for PyKota", 'echo "%(conf)s" >%(pgconfdir)s/pg_hba.conf' % locals()) 
    324331                    self.confirmCommand("to make PostgreSQL take the changes into account", self.pgrestart) 
    325                     return tcpip 
    326         return None     
    327          
    328     def genConfig(self, adminname, adminemail, dnsdomain, smtpserver, home, tcpip) :         
     332                    return (tcpip, port) 
     333        return (None, None) 
     334         
     335    def genConfig(self, adminname, adminemail, dnsdomain, smtpserver, home, tcpip, port) : 
    329336        """Generates minimal configuration files for PyKota.""" 
    330337        if tcpip : 
    331             storageserver = "localhost" 
     338            storageserver = "localhost:%i" % port 
    332339        else :     
    333340            storageserver = "" 
     
    407414            self.setupPackages() 
    408415            self.downloadOtherPackages() 
    409             tcpip = self.configurePostgreSQL() 
    410             self.genConfig(adminname, adminemail, dnsdomain, smtpserver, homedirectory, tcpip) 
     416            (tcpip, port) = self.configurePostgreSQL() 
     417            self.genConfig(adminname, adminemail, dnsdomain, smtpserver, homedirectory, tcpip, port) 
    411418            self.setupDatabase() 
    412419            self.setupBackend()