Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO off
- REM This should generate the following:
- REM - The MSI installer.
- REM - The "published binaries".
- REM - The HTML documentation zip archive.
- REM If RELEASE is NO, then it will choke on all but the building.
- REM In order to get the published binaries to work correctly at the end:
- REM - Open up visual studio.
- REM - Do a debug build.
- REM - Add GOTO MAKEPUBLISHEDBINARIES after the if .. () statement below
- REM TODO: Add another step to do this automatically before the publish binary step?
- SET RELEASE=YES
- SET PY_VERSION=3.2.2
- SET PY_VERSIONX=322
- SET PYTHON=c:\python27\python.exe
- SET HTMLHELP=C:\Program Files (x86)\HTML Help Workshop\hhc.exe
- SET SEVENZIP=C:\Program Files\7-Zip\7z.exe
- REM This needs to be here because the ssl compilation is broken without it.
- SET PERL=c:\Perl\bin\perl.exe
- SET OLDDIR=%CD%
- SET PYDIR=%1
- IF %PYDIR%X==X GOTO NOPYDIR
- IF NOT EXIST %PYDIR% GOTO NOPYDIR
- SET SCRIPTDIR=Tools\buildbot
- SET MSIDIR=Tools\msi
- SET SCRIPT_BUILDX86=%SCRIPTDIR%\build.bat
- SET SCRIPT_EXTERNALX86=%SCRIPTDIR%\external.bat
- SET SCRIPT_BUILDAMD64=%SCRIPTDIR%\build-amd64.bat
- SET SCRIPT_EXTERNALAMD64=%SCRIPTDIR%\external-amd64.bat
- CD %PYDIR%
- IF NOT EXIST %SCRIPT_BUILDX86% GOTO NOBUILDSCRIPT
- hg revert --no-backup %SCRIPTDIR%
- FOR /F "tokens=2* delims=_=" %%A IN ('SET SCRIPT_') DO (
- ECHO Processing: %%B
- REM CONVERT DEFAULT BUILD TO RELEASE
- IF %RELEASE%X==YESX (
- %PYTHON% -c "f=open(r'%%B', 'r');s=f.read();s=s.replace('DEBUG=1','');s=s.replace('Debug|','Release|');f.close();f=open(r'%%B', 'w');f.write(s);f.close()"
- )
- )
- REM DEBUGGING SHORTCUTS:
- REM GOTO MAKEPUBLISHEDBINARIES
- echo **** Building.
- cmd /c %SCRIPT_BUILDX86%
- :BUILDINSTALLER
- echo **** Generating documentation.
- set DOCDIR=Doc
- cd %DOCDIR%
- cmd /c make.bat checkout
- cmd /c make.bat html
- rem Generate zip HTML documentation.
- set BASEFILENAME=%OLDDIR%\stackless-python-%PY_VERSION%-docs-html
- del %BASEFILENAME%.zip
- "%SEVENZIP%" a -r %BASEFILENAME%.zip html
- %PYTHON% %OLDDIR%\gensum.py %BASEFILENAME%.zip
- rem Generate tbz HTML documentation.
- del %BASEFILENAME%.tar
- "%SEVENZIP%" a -r %BASEFILENAME%.tar html
- "%SEVENZIP%" a %BASEFILENAME%.tar.bz2 %BASEFILENAME%.tar
- del %BASEFILENAME%.tar
- %PYTHON% %OLDDIR%\gensum.py %BASEFILENAME%.tar.bz2
- cmd /c make.bat htmlhelp
- copy build\htmlhelp\python%PY_VERSIONX%.chm %OLDDIR%\python%PY_VERSIONX%sl.chm
- %PYTHON% %OLDDIR%\gensum.py %OLDDIR%\python%PY_VERSIONX%sl.chm
- cd ..
- echo **** Generating installer.
- SET PCDIR=PC
- cd %PCDIR%
- nmake -f icons.mak
- cd ..
- echo Making dummy tix folder: %OLDDIR%\tix-nothere
- IF EXIST %OLDDIR%\tix-nothere GOTO MAKEINSTALLER
- mkdir %OLDDIR%\tix-nothere7
- echo > %OLDDIR%\tix-nothere\license.terms
- :MAKEINSTALLER
- hg revert --no-backup %MSIDIR%
- cd %MSIDIR%
- %PYTHON% -c "f=open(r'msi.py', 'r');s=f.read();s=s.replace('snapshot = 1','snapshot = 0');s=s.replace('tcl8*','tcl-8*');s=s.replace('tk8*','tk-8*');fcv=\"%PY_VERSION%\".strip();s=s.replace('full_current_version = None','full_current_version = \"'+fcv+'\"');s=s.replace('.msi'+chr(34), '-stackless.msi'+chr(34));f.close();f=open(r'msi.py', 'w');f.write(s);f.close()"
- nmake -f msisupport.mak
- %PYTHON% msi.py
- copy python-%PY_VERSION%-stackless.msi %OLDDIR%\
- %PYTHON% %OLDDIR%\gensum.py %OLDDIR%\python-%PY_VERSION%-stackless.msi
- copy python-%PY_VERSION%-pdb.zip %OLDDIR%\python-%PY_VERSION%-pdb-stackless.zip
- %PYTHON% %OLDDIR%\gensum.py %OLDDIR%\python-%PY_VERSION%-pdb-stackless.zip
- cd ..\..
- REM GOTO DONE
- :MAKEPUBLISHEDBINARIES
- set PCBUILDDIR=PCbuild
- cd %PCBUILDDIR%
- hg revert --no-backup publish_binaries.py
- %PYTHON% -c "f=open(r'publish_binaries.py', 'r');s=f.read();f.close();Mmv=\"%PY_VERSIONX%\".strip();s=s.replace('python30','python'+Mmv[:2]);s=s.replace('stackless-python-30','stackless-python-'+Mmv);f=open(r'publish_binaries.py', 'w');f.write(s);f.close()"
- python.exe publish_binaries.py
- copy stackless-python-%PY_VERSIONX%.zip %OLDDIR%\
- %PYTHON% %OLDDIR%\gensum.py %OLDDIR%\stackless-python-%PY_VERSIONX%.zip
- cd ..
- echo "%SEVENZIP%" a Python.tar *.zip *.py *.bz2 *.msi *.chm
- echo pscp Python.tar root@stackless.com:/var/www/stackless/binaries/incoming/
- :CLEANUP
- cd %OLDDIR%
- hg revert --no-backup %PYDIR%\%SCRIPTDIR%
- hg revert --no-backup %PYDIR%\%MSIDIR%
- GOTO DONE
- :NOBUILDSCRIPT
- ECHO Python directory not recognised: "%1"
- GOTO CLEANUP
- :NOPYDIR
- ECHO No such Python directory: "%1"
- :DONE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement