wiki:pkg-python/Python27

Version 4 (modified by maphew, 12 years ago) ( diff )

note re: adding batch files

Making a Python 2.7 package for OSGeo4W

Some rough notes for how I built a python 2.7 package.

Open a command shell and

set osgeo4w_root=c:\o4w_py27
apt.exe setup

:: to share cache with existing install 
:: and avoid needless downloads
copy c:\osgeo4w\etc\setup\last-cache %osgeo4w_root%\etc\setup\

:: install py25, then examine folder structure
apt install python

:: install py27 from standard msi installer (outside o4w)
start d:\dee\Downloads\Programming\python-2.7.1.msi

:: Manually compare c:\python27 to c:\o4w_py27\
:: then reflect the structure

xcopy /s c:\python27 C:\o4w_py27\apps\Python27
pushd %osgeo4w_root%
move apps\Python27\*.exe bin\

if exist %windir%\SysWOW64\python27.dll copy %windir%\SysWOW64\python27.dll bin\
if exist %windir%\System32\python27.dll copy %windir%\System32\python27.dll bin\

Manually add batch files for etc\ini, etc\postinstall, & bin

Now create the package archive

set ver=2.7.1-1
7z a -ttar python-%ver%.tar apps\Python27 bin\python*.exe bin\w9xpopen.exe bin\python27.dll etc\ini\python.bat
7z a -tbzip2 -mx9 -mmt=on python-%ver%.tar.bz2 python-%ver%.tar

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.