#
# As of Mon Apr 21 00:31:03 CEST 2008 : probably needs fixing but
# still is a good outline of the process.
#

Steps to compile/install poker3d and friends: (all as root)

Download packages to ~/local/poker/packages (wget) 

  http://download.gna.org/pokersource/sources/poker-eval-*.tar.gz
  http://download.gna.org/pokersource/sources/pypoker-eval-*.tar.gz
  http://download.gna.org/pokersource/sources/poker-engine-*.tar.gz
  
  http://garr.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-*.tar.gz
  http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz
  http://tmrc.mit.edu/mirror/twisted/Twisted/8.0/Twisted-8.0.1.tar.bz2
  
  http://cheeseshop.python.org/packages/source/f/fpconst/fpconst-0.7.2.tar.gz
  http://garr.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.4.tar.gz
  http://mesh.dl.sourceforge.net/sourceforge/pywebsvcs/SOAPpy-0.12.0.tar.gz
  http://heanet.dl.sourceforge.net/sourceforge/pyopenssl/pyOpenSSL-0.7.tar.gz
 
  http://download.gna.org/pokersource/sources/poker-network-1.5.0.tar.gz

Patches:

  http://www.mail-archive.com/pokersource-users@gna.org/msg00643/fpconst.dpatch
  http://www.mail-archive.com/pokersource-users@gna.org/msg00643/future_compat.dpatch
  http://www.mail-archive.com/pokersource-users@gna.org/msg00643/rm_bogus_shebang.dpatch
  
In ~/local/poker
  
  (I've put these in root's .profile, hmmm and .bashrc)
  
  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/poker/lib/pkgconfig:/usr/local/poker/share/pkgconfig
  export PATH=$PATH:/usr/local/poker/sbin:/usr/local/poker/bin
  export PYTHONPATH=/usr/local/poker/lib/python2.5/site-packages
  
  tar zxvf packages/*.tar.gz
or
  tar jxvf packages/*.bz2
  
In ~/local/poker/poker-eval

  ./configure --prefix=/usr/local/poker
  make
  make check
  make install

In ~/local/poker/pypoker-eval

  ./configure --prefix=/usr/local/poker
  make
  make check
  make install

In ~/local/poker/poker-engine

  ./configure --prefix=/usr/local/poker
  make
  make check
  make install
  
In ~/local/poker/MySQL-python

  edit/create file: /usr/lib/python2.5/site-packages/altinstall.pth to contain
  
  import os, site; site.addsitedir(os.path.expanduser('/usr/local/poker/lib/python2.5'))

  This one is NO good  for poker network:

  python setup.py build
  python setup.py install --prefix=/usr/local/poker

  This one works:

  easy_install --prefix=/usr/local/poker \
  	--record=files.txt \
  	--always-unzip \
  	~/local/poker/packages-dependencies/MySQL-python-1.2.2.tar.gz
  	
In ~/local/poker/zope.interface
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In ~/local/poker/Twisted
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In ~/local/poker/fpconst
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In ~/local/poker/PyXML
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In ~/local/poker/pyOpenSSL
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In ~/local/poker/SOAPpy

  patch -p1 fpconst.dpatch
  patch -p1 future_compat.dpatch
  patch -p1 rm_bogus_shebang.dpatch
  
  python setup.py build
  python setup.py install --prefix=/usr/local/poker

In CPAN

  # install JSON
  
In ~/local/poker/poker-network

        autoreconf -fi

	./configure --prefix=/usr/local/poker \
		--with-poker-database=pokernetwork \
		--with-poker-dbuser=<user> \
		--with-poker-dbuser-password=<userpassword> \
		--with-poker-dbroot=<rootuser> \
		--with-poker-dbroot-password=<rootpassword>

	Edit Makefile, Line 1190 and 1202
	
	Change from:
	
		export PYTHONPATH=${srcdir} ; \
	
	Change to:
	
		export PYTHONPATH=${srcdir}:${PYTHONPATH} ; \
	
	Address problem with X11 misc font location:
	
	To fix location, in /usr/share/fonts
	# ln -s . X11

	make
	make check
	make install
	
In /usr/local/poker/share/poker-network

	Edit schema.sql, line 396, change REPLACE with a suitable password.
	
	INSERT INTO users (serial, name, password, privilege) VALUES (2, 'admin', 'REPLACE', 2);                                 
	INSERT INTO users_private (serial) VALUES (2);                                                                           
	                                                                                                                         
	INSERT INTO users (serial, name, password, privilege) VALUES (3, 'admin_web', 'REPLACE', 1);                             
	INSERT INTO users_private (serial) VALUES (3);                                                                           
	
	# mysql pokernetwork < schema.sql
	
	Changed /usr/local/poker/share/poker-web/currency_one.php
	
	$GLOBALS['currency_db_base'] = 'currency_one';
	$GLOBALS['currency_db_user'] = 'currency';
	$GLOBALS['currency_db_password'] = 'currency';
	
	to match credentials on poker-network database.
	
Thats it. Start the server. 
# pokerserver 2>&1 >> /var/log/poker-network.log

Create some users in poker-web (create account),
and put some playmoney in your new account (cash in).
  http://localhost/poker-web

Start poker2d
# /usr/local/poker/games/poker2d
