#NEWLINE# def main( ) : #NEWLINE# #INDENT# setuptools . setup ( version = VERSION , author = 'Anton Gavrik' , name = 'polaris-gslb' , description = 'A versatile Global Server Load Balancing(GSLB) solution, DNS-based traffic manager.' , packages = setuptools . find_packages ( '.' ) , install_requires = [ 'pyyaml' , 'python-memcached' , 'python-daemon-3K' ] , license = 'BSD 3-Clause' , url = 'https://github.com/polaris-gslb/polaris-gslb' , download_url = 'https://github.com/polaris-gslb/polaris-gslb/tarball/v{}' . format ( VERSION ) , classifiers = [ 'Programming Language :: Python :: 3' ] ) #NEWLINE# try : #NEWLINE# #INDENT# install_prefix = os . environ [ 'POLARIS_INSTALL_PREFIX' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# install_prefix = os . path . join ( os . sep , 'opt' , 'polaris' ) #NEWLINE# #UNINDENT# pwd = os . path . abspath ( os . path . split ( inspect . getfile ( inspect . currentframe ( ) ) ) [ 0 ] ) #NEWLINE# print ( 'Creating directory topology...' ) #NEWLINE# for path in [ os . path . join ( install_prefix , 'etc' ) , os . path . join ( install_prefix , 'bin' ) , os . path . join ( install_prefix , 'run' ) ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# os . makedirs ( path ) #NEWLINE# #UNINDENT# except FileExistsError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# print ( 'Copying dist configuration and executables...' ) #NEWLINE# for dirname in [ 'etc' , 'bin' ] : #NEWLINE# #INDENT# copy_files ( os . path . join ( pwd , dirname ) , os . path . join ( install_prefix , dirname ) ) #NEWLINE# #UNINDENT# print ( 'Creating /etc/default/polaris...' ) #NEWLINE# py3_bin = which ( 'python3' ) #NEWLINE# py3_path = '' #NEWLINE# if ( py3_bin is None ) : #NEWLINE# #INDENT# print ( 'Unable to find Python3 executable in the $PATH, add the path manually to /etc/default/polaris' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# py3_path = os . path . split ( py3_bin ) [ 0 ] #NEWLINE# #UNINDENT# with open ( os . path . join ( os . sep , 'etc' , 'default' , 'polaris' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( 'export PATH=$PATH:{}\n' . format ( py3_path ) ) #NEWLINE# f . write ( 'export POLARIS_INSTALL_PREFIX={}\n' . format ( install_prefix ) )