Changeset 1592 for pykota/trunk/setup.py

Show
Ignore:
Timestamp:
07/06/04 11:37:11 (20 years ago)
Author:
jalet
Message:

Integrated most of the Debian packaging work made by Sergio Gonz�lez Gonz�lez

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/setup.py

    r1522 r1592  
    2424# 
    2525# $Log$ 
     26# Revision 1.45  2004/07/06 09:37:01  jalet 
     27# Integrated most of the Debian packaging work made by Sergio Gonz�z Gonz�z 
     28# 
    2629# Revision 1.44  2004/06/05 22:03:49  jalet 
    2730# Payments history is now stored in database 
     
    195198ACTION_CONTINUE = 0 
    196199ACTION_ABORT = 1 
     200 
     201#ETC_DIR = "./debian/tmp/etc/pykota/" 
     202ETC_DIR = "/etc/pykota/" 
    197203 
    198204def checkOldModule(path) : 
     
    256262         
    257263    # checks if a configuration file is present in the new location 
    258     if not os.path.isfile("/etc/pykota/pykota.conf") : 
    259         if not os.path.isdir("/etc/pykota") : 
     264    if not os.path.isfile(os.path.join(ETC_DIR,"pykota.conf")) : 
     265        if not os.path.isdir(ETC_DIR) : 
    260266            try : 
    261                 os.mkdir("/etc/pykota") 
     267                os.mkdir(ETC_DIR) 
    262268            except OSError, msg :     
    263                 sys.stderr.write("An error occured while creating the /etc/pykota directory.\n%s\n" % msg) 
     269                sys.stderr.write("An error occured while creating the etc/pykota directory.\n%s\n" % msg) 
    264270                sys.exit(-1) 
    265271                 
     
    271277            if answer[0:1].upper() == 'Y' : 
    272278                try : 
    273                     os.rename("/etc/pykota.conf", "/etc/pykota/pykota.conf") 
     279                    os.rename("/etc/pykota.conf", os.path.join(ETC_DIR,"pykota.conf")) 
    274280                except OSError :     
    275281                    sys.stderr.write("ERROR : An error occured while moving /etc/pykota.conf to /etc/pykota/pykota.conf\nAborted !\n") 
     
    287293                if answer[0:1].upper() == 'Y' : 
    288294                    try : 
    289                         shutil.copy("conf/pykota.conf.sample", "/etc/pykota/pykota.conf")         
    290                         shutil.copy("conf/pykotadmin.conf.sample", "/etc/pykota/pykotadmin.conf")         
     295                        shutil.copy("conf/pykota.conf.sample", os.path.join(ETC_DIR,"pykota.conf"))         
     296                        shutil.copy("conf/pykotadmin.conf.sample", os.path.join(ETC_DIR,"pykotadmin.conf"))         
    291297                    except IOError, msg :     
    292298                        sys.stderr.write("WARNING : Problem while installing sample configuration files in /etc/pykota/, please do it manually.\n%s\n" % msg) 
     
    317323    from pykota.config import PyKotaConfig,PyKotaConfigError 
    318324    try : 
    319         conf = PyKotaConfig("/etc/pykota/") 
     325        conf = PyKotaConfig(ETC_DIR) 
    320326    except PyKotaConfigError, msg :     
    321327        sys.stedrr.write("%s\nINSTALLATION ABORTED !\nPlease restart installation.\n" % msg) 
     
    375381             
    376382    # change files permissions     
    377     os.chmod("/etc/pykota/pykota.conf", 0644) 
    378     os.chmod("/etc/pykota/pykotadmin.conf", 0640) 
     383    os.chmod(os.path.join(ETC_DIR,"pykota.conf"), 0644) 
     384    os.chmod(os.path.join(ETC_DIR,"pykotadmin.conf"), 0640) 
    379385     
    380386    # WARNING MESSAGE     
     
    420426    data_files.append((directory, [ mofile ])) 
    421427     
    422 docdir = "/usr/share/doc/pykota"     
     428docdir = "share/doc/pykota"     
    423429docfiles = ["README", "FAQ", "SECURITY", "COPYING", "LICENSE", "CREDITS", "TODO", "NEWS"] 
    424430data_files.append((docdir, docfiles))