# Path: pyparticles/utils/pypart_global.py
# def py_particle_version( r='s' ):
#     global v_major
#     global v_minor
#     global v_revision
#     
#     if r == 's' :
#         return "%d.%d.%d" % ( v_major , v_minor , v_revision )
#     else :
#         return ( v_major , v_minor , v_revision )


import os
import shutil
import subprocess
import sys
import re
import sys
from distutils.core import setup
from pyparticles.utils.pypart_global import py_particle_version
from distutils.command.install import install

is_winows = sys.platform.startswith('linux')



class particles_install(install):
    user_options = install.user_options
 
    def run(self):
        
        install.run(self)
    
        # man ... Linux only    
        if sys.platform.startswith('linux'):
            
            man_dir = os.path.abspath("./man/")
    
            prefix = re.sub( r'^/' , '' , self.prefix )
    
            output = subprocess.Popen([os.path.join(man_dir, "install.sh")],
                    stdout=subprocess.PIPE,
                    cwd=man_dir,
                    env=dict({"PREFIX": os.path.join( self.root , prefix ) }, **dict(os.environ))).communicate()[0]
            
            print( output )




setup(name = "pyparticles",

# Path: pyparticles/utils/pypart_global.py
# def py_particle_version( r='s' ):
#     global v_major
#     global v_minor
#     global v_revision
#     
#     if r == 's' :
#         return "%d.%d.%d" % ( v_major , v_minor , v_revision )
#     else :
#         return ( v_major , v_minor , v_revision )


# Path: setup.py
import os
import shutil
import subprocess
import sys
import re
import sys
from distutils.core import setup
from pyparticles.utils.pypart_global import py_particle_version
from distutils.command.install import install


is_winows = sys.platform.startswith('linux')



class particles_install(install):
    user_options = install.user_options
 
    def run(self):
        
        install.run(self)
    
        # man ... Linux only    
        if sys.platform.startswith('linux'):
            
            man_dir = os.path.abspath("./man/")
    
            prefix = re.sub( r'^/' , '' , self.prefix )
    
            output = subprocess.Popen([os.path.join(man_dir, "install.sh")],
                    stdout=subprocess.PIPE,
                    cwd=man_dir,
                    env=dict({"PREFIX": os.path.join( self.root , prefix ) }, **dict(os.environ))).communicate()[0]
            
            print( output )




setup(name = "pyparticles",

    version = "%s" % py_particle_version() ,