| 1 |
@echo off |
| 2 |
|
| 3 |
REM Make sure __version__.py is current |
| 4 |
python setup.py |
| 5 |
|
| 6 |
for /F usebackq %%a in (`python -c "import sys;print sys.version[:3]"`) do ( |
| 7 |
set python_version=%%a |
| 8 |
) |
| 9 |
|
| 10 |
for /F usebackq %%a in (`python -c "from DisplayCAL import meta;print meta.version"`) do ( |
| 11 |
set version=%%a |
| 12 |
) |
| 13 |
|
| 14 |
for /F usebackq %%a in (`python -c "from meta import version_tuple;print '.'.join(str(n) for n in version_tuple[:2] + (str(version_tuple[2]) + str(version_tuple[3]), ))"`) do ( |
| 15 |
set msi_version=%%a |
| 16 |
) |
| 17 |
|
| 18 |
REM Source tarball |
| 19 |
if not exist dist\DisplayCAL-%version%.tar.gz if not exist dist\%version%\DisplayCAL-%version%.tar.gz ( |
| 20 |
python setup.py sdist --format=gztar --use-distutils 2>&1 | tee DisplayCAL-%version%.sdist.log |
| 21 |
) |
| 22 |
|
| 23 |
REM Create openSUSE build service control files and update 0install feeds |
| 24 |
REM python setup.py buildservice 0install --stability=stable |
| 25 |
python setup.py buildservice --stability=stable |
| 26 |
|
| 27 |
REM Standalone executable |
| 28 |
if not exist dist\py2exe.win32-py%python_version%\DisplayCAL-%version% ( |
| 29 |
python setup.py bdist_standalone inno 2>&1 | tee DisplayCAL-%version%.bdist_standalone-py%python_version%.log |
| 30 |
if exist codesigning\sign.cmd ( |
| 31 |
call codesigning\sign.cmd dist\py2exe.win32-py%python_version%\DisplayCAL-%version%\*.exe |
| 32 |
) |
| 33 |
) |
| 34 |
|
| 35 |
REM Standalone executable - Setup |
| 36 |
if not exist dist\DisplayCAL-%version%-Setup.exe if not exist dist\%version%\DisplayCAL-%version%-Setup.exe ( |
| 37 |
"C:\Program Files (x86)\Inno Setup 5\Compil32.exe" /cc dist/DisplayCAL-Setup-py2exe.win32-py%python_version%.iss |
| 38 |
) |
| 39 |
|
| 40 |
REM Standalone executable - ZIP |
| 41 |
if not exist dist\DisplayCAL-%version%-win32.zip if not exist dist\%version%\DisplayCAL-%version%-win32.zip ( |
| 42 |
pushd dist\py2exe.win32-py%python_version% |
| 43 |
zip -9 -r ..\DisplayCAL-%version%-win32.zip DisplayCAL-%version% |
| 44 |
popd |
| 45 |
) |
| 46 |
|
| 47 |
if "%~1"=="bdist_msi" ( |
| 48 |
REM Python 2.6 MSI |
| 49 |
if not exist dist\DisplayCAL-%msi_version%.win32-py2.6.msi if not exist dist\%version%\DisplayCAL-%msi_version%.win32-py2.6.msi ( |
| 50 |
C:\Python26\python.exe setup.py bdist_msi --use-distutils 2>&1 | tee DisplayCAL-%msi_version%.msi-py2.6.log |
| 51 |
C:\Python26\python.exe setup.py finalize_msi 2>&1 | tee -a DisplayCAL-%msi_version%.msi-py2.6.log |
| 52 |
) |
| 53 |
|
| 54 |
REM Python 2.7 MSI |
| 55 |
if not exist dist\DisplayCAL-%msi_version%.win32-py2.7.msi if not exist dist\%version%\DisplayCAL-%msi_version%.win32-py2.7.msi ( |
| 56 |
C:\Python27\python.exe setup.py bdist_msi --use-distutils 2>&1 | tee DisplayCAL-%msi_version%.msi-py2.7.log |
| 57 |
C:\Python27\python.exe setup.py finalize_msi 2>&1 | tee -a DisplayCAL-%msi_version%.msi-py2.7.log |
| 58 |
) |
| 59 |
) |
| 60 |
|
| 61 |
if "%~1"=="bdist_wininst" ( |
| 62 |
REM Python 2.6 Installer |
| 63 |
if not exist dist\DisplayCAL-%version%.win32-py2.6.exe if not exist dist\%version%\DisplayCAL-%version%.win32-py2.6.exe ( |
| 64 |
C:\Python26\python.exe setup.py bdist_wininst --user-access-control=auto --use-distutils 2>&1 | tee DisplayCAL-%version%.wininst-py2.6.log |
| 65 |
) |
| 66 |
|
| 67 |
REM Python 2.7 Installer |
| 68 |
if not exist dist\DisplayCAL-%version%.win32-py2.7.exe if not exist dist\%version%\DisplayCAL-%version%.win32-py2.7.exe ( |
| 69 |
C:\Python27\python.exe setup.py bdist_wininst --user-access-control=auto --use-distutils 2>&1 | tee DisplayCAL-%version%.wininst-py2.7.log |
| 70 |
) |
| 71 |
) |
| 72 |
|
| 73 |
REM Cleanup |
| 74 |
python util\tidy_dist.py |