Requirements
For running:
- Python 2.4 or later
- PyProtocols 0.9.3 or later
- Twisted 2.0 or later [optional]
For building/installing:
- setuptools 0.6c1 or later
- Perforce C++ API 2004.2 or later
- The same compiler used to build both Python and the Perforce C++ API
Downloading PyPerforce
The latest release of PyPerforce can be downloaded from http://pyperforce.sourceforge.net/.
It is recommended to download the binary package for your platform
if one is available.
Otherwise, download the source package and follow the instructions
for building PyPerforce.
Building PyPerforce
Building PyPerforce from source is relatively straight forward for platforms that have builtin support (currently linux, windows and cygwin).
Building manually
Run: python setup.py build
Note: If you don't already have setuptools installed then the setup script will attempt to download it from the web and install it into the Python site-packages directory before continuing with the build.
Building a Windows installer
Run: python setup.py bdist_wininst
This will build a Windows installer .exe that can be later used to install PyPerforce onto Windows machines with Python 2.4 installed.
Building an RPM
Run: python setup.py bdist_rpm
This will build a platform specific .rpm binary install package that can be later used to install PyPerforce.
Building a Python egg
Run: python setup.py bdist_egg
This will build a platform-specific .egg file in the that can be
distributed and later installed using the setuptools
ez_setup.py
or
easy_install
scripts.
Porting to other platforms
If your platform doesn't have builtin support yet then you will need to do a bit more work. The code is written in cross-platform standard C++ and so should be easily portable to any platform that supports both Python 2.4 and Perforce C++ API.
Download the latest Perforce C++ API for your platform and unpack it into a
sub-directory of the third-party/p4api
directory
with the same name as the Perforce platform name.
eg third-party/p4api/linux24ppc
Modify the setup.py
file to detect the
platform and provide the correct configuration parameters.
If you do port PyPerforce to another platform then please consider contributing a patch to the PyPerforce project at http://sourceforge.net/projects/pyperforce/.
Installing PyPerforce
Installing from Source
Run: python setup.py install
This will install a .egg file in your Python distribution's site-packages directory and add it to Python's path.
Installing a Python egg
Run: easy_install path/to/PyPerforce-x.y-py2.4-arch.egg
The easy_install
script should have been
installed with setuptools in the Python scripts directory. You need to
make sure the scripts directory is on your PATH.
Installing from an RPM
Run: rpm -i path/to/PyPerforce-x.y-arch.rpm