diff --git a/README.md b/README.md new file mode 100644 index 0000000..756ab6a --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Requirements # + +[QuickFIX] uses [Automake] to compile. Standard requirements for different platforms: + +#### Linux #### + +TODO + +#### macOS #### + +Use [HomeBrew] to install the necessary utilities: +* Install [HomeBrew]: `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` +* Install brew packages: `brew install automake libtool` + +#### Windows #### + +TODO + +# Compilation # + +* Build [QuickFIX]: `bash package.sh [quick_fix_version]` +* Build Python wrappers: `bash package-python.sh [-d]` +* Build Ruby wrappers: `bash package-ruby.sh` + +[Autotools]: http://www.gnu.org/software/automake/manual/html_node/index.html +[HomeBrew]: http://brew.sh/ +[QuickFIX]: http://www.quickfixengine.org/ +[QuickFIX package index]: https://pypi.python.org/pypi/quickfix + diff --git a/package-python.sh b/package-python.sh index dc93302..d95a7a5 100755 --- a/package-python.sh +++ b/package-python.sh @@ -1,3 +1,25 @@ +#!/usr/bin/env bash +# +# Compile and install Python QuickFIX package. Default behavior uploads to PyPI. +# Use -d optional argument for local installation only +# +# Usage: +# bash package-python.sh [-d] + +PRODUCTION=0 + +while getopts "d" opt; do + case $opt in + d) + PRODUCTION=1 + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + rm -rf quickfix-python/C++ rm -rf quickfix-python/spec rm -rf quickfix-python/quickfix*.py @@ -24,4 +46,8 @@ rm -f quickfix-python/C++/stdafx.* pushd quickfix-python -python setup.py sdist upload -r pypi +if [ "$PRODUCTION" -eq "0" ]; then + python setup.py sdist upload -r pypi +else + python setup.py install +fi diff --git a/quickfix-python/setup.py b/quickfix-python/setup.py index 853da37..9820cae 100644 --- a/quickfix-python/setup.py +++ b/quickfix-python/setup.py @@ -1,41 +1,51 @@ +from __future__ import print_function + from distutils.core import setup from distutils.core import Extension -from distutils.command.install import install -from distutils.command.build import build from distutils.command.build_ext import build_ext -import subprocess -import shutil import glob -import os + class build_ext_subclass( build_ext ): def build_extensions(self): - print "Testing for std::tr1::shared_ptr..." + print("Testing for std::tr1::shared_ptr...") try: self.compiler.compile(['test_std_tr1_shared_ptr.cpp']) self.compiler.define_macro("HAVE_STD_TR1_SHARED_PTR") - print "...found" + print("...found") except: - print " ...not found" + print(" ...not found") - print "Testing for std::shared_ptr..." + print("Testing for std::shared_ptr...") try: - self.compiler.compile(['test_std_shared_ptr.cpp'], extra_preargs=['-std=c++0x']), + self.compiler.compile(['test_std_shared_ptr.cpp'], + extra_preargs=['-std=c++0x']), self.compiler.define_macro("HAVE_STD_SHARED_PTR") - print "...found" + print("...found") except: - print "...not found" + print("...not found") build_ext.build_extensions(self) -long_description='' -with open('LICENSE') as file: - license = file.read(); +long_description = '' +with open('LICENSE') as fp: + quickfix_license = fp.read() setup(name='quickfix', version='1.14.3', - py_modules=['quickfix', 'quickfixt11', 'quickfix40', 'quickfix41', 'quickfix42', 'quickfix43', 'quickfix44', 'quickfix50', 'quickfix50sp1', 'quickfix50sp2'], + py_modules=[ + 'quickfix', + 'quickfixt11', + 'quickfix40', + 'quickfix41', + 'quickfix42', + 'quickfix43', + 'quickfix44', + 'quickfix50', + 'quickfix50sp1', + 'quickfix50sp2' + ], data_files=[('share/quickfix', glob.glob('spec/FIX*.xml'))], author='Oren Miller', author_email='oren@quickfixengine.org', @@ -44,8 +54,12 @@ def build_extensions(self): description="FIX (Financial Information eXchange) protocol implementation", url='http://www.quickfixengine.org', download_url='http://www.quickfixengine.org', - license=license, + license=quickfix_license, include_dirs=['C++'], - cmdclass = {'build_ext': build_ext_subclass }, - ext_modules=[Extension('_quickfix', glob.glob('C++/*.cpp'), extra_compile_args=['-std=c++0x'])], -) + cmdclass={'build_ext': build_ext_subclass}, + ext_modules=[ + Extension('_quickfix', + glob.glob('C++/*.cpp'), + extra_compile_args=['-std=c++0x']) + ], + )