ó
Þ™xTc           @   s}   d  d l  m Z d  d l Z e d „ Z e d k ry e e j ƒ d k sO t ‚ e j	 j
 e e j d e j d ƒ ƒ n  d S(   iÿÿÿÿ(   t   divisionNc         C   sA   t  j d  \ } } d } | r, | d 7} n  | d 7} | t ƒ  S(   Ni   s¢   @echo off

set PYTHONHOME=
set PYTHONSTARTUP=
set PYTHONDEBUG=
set PYTHONINSPECT=
set PYTHONSUPPRESS=
set PYTHONUNBUFFERED=
set PYTHONVERBOSE=
set PYTHONCASEOK=1
s   
cd %(bundle)s
s  
if not exist %(bundle)s_sources\TAG goto find_python
echo.
echo Build tag:
type %(bundle)s_sources\TAG

:find_python
echo.
echo Trying to find Python:
cd %(bundle)s_build
if not exist base\python\python.exe goto try_plain_python
set python=base\python\python
call "%%python%%" -V
if %%errorlevel%% == 0 goto have_python
:try_plain_python
set python=python
call "%%python%%" -V
if %%errorlevel%% == 0 goto have_python
set python=C:\python%(py_major)d%(py_minor)d\python
call "%%python%%" -V
if %%errorlevel%% == 0 goto have_python
cd ..
echo.
echo Cannot find a Python interpreter.
echo.
echo Please download an installer with Python included
echo or add a matching Python to the PATH environment variable.
echo.
echo Installation aborted.
echo.
goto end

:have_python
echo.
echo Configuring %(bundle)s build directory
call "%%python%%" ..\%(bundle)s_sources\libtbx\configure.py %(top_modules)s
set el=%%errorlevel%%
cd ..
if not %%el%% == 0 goto end
call %(bundle)s_build\setpaths_all.bat

if not exist %(bundle)s_install_finalize.bat goto run_tests
echo Running final setup script %(bundle)s_install_finalize.bat
call %(bundle)s_install_finalize.bat

:run_tests
if not exist "%%BOOST_ADAPTBX_DIST%%\tst_rational.py" goto skip_test
echo.
echo Running a selected test
echo libtbx.python "%%BOOST_ADAPTBX_DIST%%\tst_rational.py"
call libtbx.python "%%BOOST_ADAPTBX_DIST%%\tst_rational.py"
if not %%errorlevel%% == 0 goto end
:skip_test

echo.
echo ***
echo *** To use this installation in a new shell or process run the command:
echo ***
echo ***     %%LIBTBX_BUILD%%\setpaths.bat
echo ***
echo *** You may want to add this line to some startup file.
echo ***

:end
if not defined LIBTBX_BATCH_INSTALL goto end_prompt
if not %%LIBTBX_BATCH_INSTALL%% == 0 goto final_exit
:end_prompt
pause
:final_exit
(   t   syst   version_infot   vars(   t   bundlet   top_modulest
   single_dirt   py_majort   py_minort   script(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/bundle/install_bat.pyt   create_script   s    
Et   __main__i   i   i   (   t
   __future__R    R   t   FalseR
   t   __name__t   lent   argvt   AssertionErrort   stdoutt   write(    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/bundle/install_bat.pyt   <module>   s
   Y