rpms/poker-network/FC-6 poker-bot-README.Fedora, NONE, 1.1 poker-bot-selinux, NONE, 1.1 poker-bot.init, NONE, 1.1 poker-network-1.0.33-bot.patch, NONE, 1.1 poker-network-1.0.33-db.patch, NONE, 1.1 poker-network.spec, NONE, 1.1 poker-server-README.Fedora, NONE, 1.1 poker-server-selinux, NONE, 1.1 poker-server.fc, NONE, 1.1 poker-server.if, NONE, 1.1 poker-server.init, NONE, 1.1 poker-server.te, NONE, 1.1 poker-web-README.Fedora, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Christopher Stone (xulchris) fedora-extras-commits at redhat.com
Tue Feb 20 02:17:25 UTC 2007


Author: xulchris

Update of /cvs/extras/rpms/poker-network/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28940/FC-6

Modified Files:
	.cvsignore sources 
Added Files:
	poker-bot-README.Fedora poker-bot-selinux poker-bot.init 
	poker-network-1.0.33-bot.patch poker-network-1.0.33-db.patch 
	poker-network.spec poker-server-README.Fedora 
	poker-server-selinux poker-server.fc poker-server.if 
	poker-server.init poker-server.te poker-web-README.Fedora 
Log Message:
auto-import poker-network-1.0.35-2 on branch FC-6 from poker-network-1.0.35-2.src.rpm


--- NEW FILE poker-bot-README.Fedora ---
The bots are configured to cash-in using a URL containing localhost by default.
If this is not your default cash-in URL, you must edit the <currency> entry
in the /etc/poker-network/poker.bot.xml file.

See the README.Fedora file in the poker-web package for more information on
currencies and cash-in URLs.



--- NEW FILE poker-bot-selinux ---
#!/bin/sh
# Wrapper for init file which enables SElinux usage.
/usr/bin/python /usr/bin/twistd \
    --python "PYTHON_SITELIB/pokernetwork/pokerbot.py" \
    ${0+$@}


--- NEW FILE poker-bot.init ---
#!/bin/sh
#
# poker-bot    poker-network bots
#
# chkconfig:   - 66 34
# description: Multi player online poker server with \
#              bots running according to /etc/poker-network
# processname: poker-bot
# config:      /etc/poker-network/poker.bot.xml
# pidfile:     /var/run/poker-bot.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

selinuxwrapper=/usr/bin/poker-bot-selinux

python=/usr/bin/python
twistd=/usr/bin/twistd
reactor=poll

opt_args=--no_save

exec="PYTHON_SITELIB/pokernetwork/pokerbot.py"
prog=poker-bot

pidfile=/var/run/poker-network/$prog.pid
logfile=/var/log/poker-network/$prog.log

serverpidfile=/var/run/poker-network/poker-server.pid

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

lockfile=/var/lock/subsys/$prog

# Possible return values:
# 0 = service is running
# 1 = pid file exists, but process is dead
# 2 = pid file gone, process is gone, but lockfile exists
# 3 = service not running
isrunning() {
    local base=pokerbot
    local pid

    if [ -f ${pidfile} ] ; then
        read pid < ${pidfile}
        ps $pid | grep $base 2>&1 > /dev/null
        running=$?
        if [ "$running" = 0 ] ; then
            return 0
        fi

        if [ -n "$pid" ]; then
            return 1
        fi
    fi
    if [ -f ${lockfile} ]; then
            return 2
    fi

    return 3
}

poker_status() {
    isrunning
    retval=$?
    case $retval in
        0)  echo "$prog is running."
            ;;
        1)  echo "$prog stopped but pid file exists..."
            ;;
        2)  echo "$prog stopped but subsys locked..."
            ;;
        3)  echo "$prog is stopped."
            ;;
    esac
}

start() {
    echo -n $"Starting $prog: "
    isrunning
    retval=$?
    case $retval in
        0)  echo -n $"$prog already running"
            failure
            echo
            return 1
            ;;
        1)  echo -n $"$prog stopped but pid file exists..."
            ;;
        2)  echo -n $"$prog stopped but subsys locked..."
            ;;
    esac

    if [ ! -f ${serverpidfile} ]; then
        echo -n $"poker-server must be running"
        failure
        echo
        return 1
    fi

    daemon --user=POKER_USER ${selinuxwrapper} \
            --pidfile=${pidfile} --logfile=${logfile} \
            --quiet ${opt_args} --reactor=${reactor}

    retval=$?
    if [ $retval -eq 0 ]; then
        success
        touch $lockfile
    else
        failure
    fi
    echo

    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc -p ${pidfile} $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

fdr_status() {
    status $prog
}

case "$1" in
    start|stop|restart|reload)
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        poker_status
        ;;
    condrestart|try-restart)
        [ ! -f $lockfile ] || restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac

poker-network-1.0.33-bot.patch:

--- NEW FILE poker-network-1.0.33-bot.patch ---
--- conf/poker.bot.xml.in~	2007-01-14 23:04:42.000000000 -0800
+++ conf/poker.bot.xml.in	2007-01-14 23:04:59.000000000 -0800
@@ -9,44 +9,7 @@
   <currency>@WGET@ wget --quiet -O - 'http://@POKER_WWW_HOST@/poker-web/currency_one.php?command=get_note&value=5000000&count=100&autocommit=yes'</currency>
   <path>@POKER_ENGINE_PKGSYSCONFDIR@</path> 
 
-  <table name="One" count="4"/>
-  <table name="Two" count="4"/>
-  <table name="Three" count="4"/>
-  <table name="Four" count="4"/>
-  <table name="Antigua" count="4"/>
-  <table name="Cairo" count="4"/>
-  <table name="Mont" count="4"/>
-  <table name="Nancy" count="4"/>
-  <table name="Corail" count="4"/>
-  <table name="Legend" count="4"/>
-  <table name="Chip" count="4"/>
-  <table name="Relax" count="4"/>
-  <table name="Speed" count="4"/>
-  <table name="Un" count="1"/>
-  <table name="Deux" count="2"/>
-  <table name="Trois" count="9"/>
-  <table name="Quatre" count="10"/>
-
-  <table name="Five" count="4"/>
-  <table name="Six" count="4"/>
-  <table name="Seven" count="4"/>
-  <table name="Eight" count="4"/>
-
-  <table name="Nine" count="4"/>
-  <table name="Ten" count="4"/>
-  <table name="Eleven" count="4"/>
-  <table name="Twelve" count="4"/>
-
-  <table name="Thirty" count="4"/>
-  <table name="Fourty" count="4"/>
-
-  <tournament name="sitngo4" count="3"/>
-  <tournament name="sitngo8" count="7"/>
-  <tournament name="sitngo20" count="19"/>
-  <tournament name="sitngo50" count="49"/>
-  <tournament name="Ositngo4" count="3"/>
-  <tournament name="Ositngo8" count="7"/>
-  <tournament name="Ositngo20" count="19"/>
-  <tournament name="Ositngo50" count="49"/>
+  <table name="One" count="2"/>
+  <tournament name="sitngo2" count="1"/>
 
 </settings>

poker-network-1.0.33-db.patch:

--- NEW FILE poker-network-1.0.33-db.patch ---
--- pokernetwork/pokerdatabase.py~	2007-01-21 06:23:21.000000000 -0800
+++ pokernetwork/pokerdatabase.py	2007-01-21 06:24:01.000000000 -0800
@@ -84,6 +84,9 @@
                     sql = "CREATE USER '" + self.parameters['user'] + "'@'%' IDENTIFIED BY '" + self.parameters['password'] + "'"
                     if self.verbose > 2: print sql
                     db.query(sql)
+                    sql = "CREATE USER '" + self.parameters['user'] + "'@'localhost' IDENTIFIED BY '" + self.parameters['password'] + "'"
+                    if self.verbose > 2: print sql
+                    db.query(sql)
                     db.query("FLUSH PRIVILEGES")
                     if self.verbose: print "created database user " + self.parameters["user"]
                 except:


--- NEW FILE poker-network.spec ---
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define poker_user poker
%define selinux_variants mls strict targeted
%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
%define policy_name poker-server


Name:             poker-network
Version:          1.0.35
Release:          2%{?dist}
Summary:          Base package for poker client and server

Group:            Applications/Internet
License:          GPL
URL:              http://pokersource.org/poker-network
Source0:          http://download.gna.org/pokersource/sources/%{name}-%{version}.tar.gz

Source10:         poker-server.init
Source11:         poker-bot.init

Source20:         poker-server-README.Fedora
Source21:         poker-web-README.Fedora
Source22:         poker-bot-README.Fedora

Source30:         poker-server-selinux
Source31:         poker-bot-selinux

Source40:         poker-server.te
Source41:         poker-server.fc
Source42:         poker-server.if

Patch0:           %{name}-1.0.33-bot.patch
Patch1:           %{name}-1.0.33-db.patch

BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:        noarch
BuildRequires:    checkpolicy selinux-policy-devel hardlink
BuildRequires:    python-devel gettext-devel libtool
BuildRequires:    python-twisted-web pyOpenSSL poker-engine-devel >= 1.0.21
Requires:         python-twisted-web pyOpenSSL poker-engine >= 1.0.21

%if "%{selinux_policyver}" != ""
Requires:         selinux-policy >= %{selinux_policyver}
%endif


%description
%{summary}.

%package devel
Summary:          Client library development files
Group:            Development/Libraries
Requires:         %{name} = %{version}-%{release}
Requires:         poker-eval-devel

%description devel
This package contains files required to build applications that use
%{name}.

%package -n poker-client-lib
Summary:          Poker network client library
Group:            Development/Libraries
Requires:         %{name} = %{version}-%{release}

%description -n poker-client-lib
The client library can be used to implement simple clients such as
robots (<1000 LOC example robot provided) or a graphical user
interface.

%package -n poker-server
Summary:          Server for %{name}
Group:            Applications/Internet
BuildRequires:    MySQL-python SOAPpy
Requires:         MySQL-python SOAPpy
Requires:         %{name} = %{version}-%{release}
Requires(post):   /sbin/chkconfig
Requires(preun):  /sbin/chkconfig
Requires(preun):  /sbin/service

%description -n poker-server
The server deals the cards and checks the user actions using a poker
game engine (poker-engine). It can handle all the poker variants
implemented by the poker game engine (holdem, omaha, omaha high/low,
stud 7 ...) in ring games, sit and go or multitables tournaments.

%package -n poker-web
Summary:          Web interface to a %{name} server
Group:            Applications/Internet
Requires:         httpd php php-mysql php-gd php-bcmath

%description -n poker-web
%{summary}.

%package -n poker-bot
Summary:          Poker playing robots for poker-server
Group:            Applications/Internet
Requires:         apg poker-client-lib = %{version}-%{release}
Requires(post):   /sbin/chkconfig
Requires(preun):  /sbin/chkconfig
Requires(preun):  /sbin/service

%description -n poker-bot
%{summary}.

%package selinux
Summary:          SELinux policy files for the poker game server
Group:            Amusements/Games
Requires:         %{name} = %{version}-%{release}
Requires(post):   /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
Requires(preun):  /sbin/service /usr/sbin/semodule /usr/sbin/semanage
Requires(preun):  /sbin/fixfiles /usr/sbin/setsebool
Requires(postun): /usr/sbin/semodule

%description selinux
%{summary}.


%prep
%setup -q
%patch0 -p0 -b .bot~
%patch1 -p0 -b .db~

# prep selinux source files for build
install -d selinux
install -pm 644 %{SOURCE40} %{SOURCE41} %{SOURCE42} selinux


%build
%configure --disable-static --disable-poker2d
make %{?_smp_mflags}

# build selinux policy file
pushd selinux
for variant in %{selinux_variants} ; do
    make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile
    mv %{policy_name}.pp %{policy_name}.pp.${variant}
    make NAME=${variant} -f %{_datadir}/selinux/devel/Makefile clean
done
popd


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# install init scripts
install -d $RPM_BUILD_ROOT%{_initrddir}
install -d $RPM_BUILD_ROOT%{_bindir}
install -pm 755 %{SOURCE10} $RPM_BUILD_ROOT%{_initrddir}/poker-server
install -pm 755 %{SOURCE11} $RPM_BUILD_ROOT%{_initrddir}/poker-bot
install -pm 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/poker-server-selinux
install -pm 755 %{SOURCE31} $RPM_BUILD_ROOT%{_bindir}/poker-bot-selinux

# fill in substitions for init files
sed -i 's at PYTHON_SITELIB@%{python_sitelib}@' $RPM_BUILD_ROOT%{_bindir}/*-selinux
sed -i 's at PYTHON_SITELIB@%{python_sitelib}@' $RPM_BUILD_ROOT%{_initrddir}/*
sed -i 's at POKER_USER@%{poker_user}@' $RPM_BUILD_ROOT%{_initrddir}/*

# install Fedora README files
install -d poker-server poker-web poker-bot
install -pm 644 %{SOURCE20} ./poker-server/README.Fedora
install -pm 644 %{SOURCE21} ./poker-web/README.Fedora
install -pm 644 %{SOURCE22} ./poker-bot/README.Fedora

# install constants file manually
mv $RPM_BUILD_ROOT%{_datadir}/poker-web/constants.php.ref \
    $RPM_BUILD_ROOT%{_sysconfdir}/poker-web/constants.php
pushd $RPM_BUILD_ROOT%{_datadir}/poker-web
ln -sf ../../..%{_sysconfdir}/poker-web/constants.php
popd

# install .htaccess in etc
install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/poker-web.conf << EOF
Alias /poker-web %{_datadir}/poker-web

<Directory %{_datadir}/poker-web/>
EOF
cat $RPM_BUILD_ROOT%{_sysconfdir}/poker-web/htaccess >> \
    $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/poker-web.conf
echo "</Directory>" >> \
    $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/poker-web.conf
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/poker-web/htaccess
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/poker-web/apache.conf
rm -f $RPM_BUILD_ROOT%{_datadir}/poker-web/.htaccess

# locales installed in poker2d-common
rm -fr $RPM_BUILD_ROOT%{_datadir}/locale

# create log and run directories for poker user id
# log files are auto-rotated, no need for logrotate
install -d $RPM_BUILD_ROOT%{_var}/log/%{name}
install -d $RPM_BUILD_ROOT%{_var}/run/%{name}

# install selinux policies
pushd selinux
for variant in %{selinux_variants} ; do
    install -d $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}
    install -pm 644 %{policy_name}.pp.${variant} \
           $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}/%{policy_name}.pp
done
popd

# hardlink identical policy module packages together
/usr/sbin/hardlink -cv $RPM_BUILD_ROOT%{_datadir}/selinux


%check
# make check is currently non-functional in mock
# upstream is investigating an in-memory db solution for this
#make check

 
%clean
rm -rf $RPM_BUILD_ROOT


%pre -n poker-server
user_uid=`id -u %{poker_user} 2>/dev/null`
if [ x"$user_uid" = x ] ; then
    useradd -r -s /sbin/nologin -d %{_datadir}/%{name} -M \
            -c 'Poker Server' %{poker_user} >/dev/null || :
fi

%post -n poker-server
/sbin/chkconfig --add poker-server

%preun -n poker-server
if [ $1 = 0 ]; then
    /sbin/service poker-server stop >/dev/null 2>&1 || :
    /sbin/chkconfig --del poker-server
fi

%postun -n poker-server
if [ "$1" -ge "1" ]; then
    /sbin/service poker-server condrestart >/dev/null 2>&1 || :
fi

%post -n poker-bot
/sbin/chkconfig --add poker-bot

%preun -n poker-bot
if [ $1 = 0 ]; then
    /sbin/service poker-bot stop >/dev/null 2>&1 || :
    /sbin/chkconfig --del poker-bot
fi

%postun -n poker-bot
if [ "$1" -ge "1" ]; then
    /sbin/service poker-bot condrestart >/dev/null 2>&1 || :
fi

%post selinux
# install selinux policy modules
for selinuxvariant in %{selinux_variants} ; do
  /usr/sbin/semodule -s ${selinuxvariant} -i \
    %{_datadir}/selinux/${selinuxvariant}/%{policy_name}.pp &> /dev/null || :
done
/usr/sbin/semanage port -a -t pokerd_port_t -p tcp 19380-19383 &> /dev/null || :
/sbin/fixfiles -R poker-server,poker-bot restore || :
/usr/sbin/setsebool pokerd_disable_trans 0 &> /dev/null || :
/sbin/service poker-server condrestart > /dev/null 2>&1 || :

%preun selinux
if [ "$1" -lt "1" ] ; then
    # disable the policy and restart the daemon
    /usr/sbin/setsebool pokerd_disable_trans 1 &> /dev/null || :
    /sbin/service poker-server condrestart > /dev/null 2>&1 || :
    # unload the module
    /usr/sbin/semanage port -d -t pokerd_port_t -p tcp 19380-19383 &> /dev/null || :
    for variant in %{selinux_variants} ; do
        /usr/sbin/semodule -s ${variant} -r %{policy_name} &> /dev/null || :
    done
    # set the context back
    /sbin/fixfiles -R poker-server,poker-bot restore || :
fi

%postun selinux
if [ "$1" -ge "1" ] ; then
    # replace the module if it is already loaded. semodule -u also
    # checks the module version
    for variant in %{selinux_variants} ; do
        /usr/sbin/semodule -u %{_datadir}/selinux/${variant}/%{policy_name}.pp || :
    done
fi


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING HACKING NEWS README
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/conf
%dir %{_datadir}/%{name}/upgrades
%dir %{_sysconfdir}/%{name}
%dir %{python_sitelib}/pokernetwork
%{python_sitelib}/pokernetwork/__init__*
%{python_sitelib}/pokernetwork/dispatch*
%{python_sitelib}/pokernetwork/packets*
%{python_sitelib}/pokernetwork/pokernetworkconfig*
%{python_sitelib}/pokernetwork/pokerpackets*
%{python_sitelib}/pokernetwork/protocol*
%{python_sitelib}/pokernetwork/proxy*
%{python_sitelib}/pokernetwork/upgrade*
%{python_sitelib}/pokernetwork/user*
%{python_sitelib}/pokernetwork/version*

%files devel
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/pkgconfig/%{name}.pc

%files -n poker-client-lib
%defattr(-,root,root,-)
%doc COPYING
%config(noreplace) %{_sysconfdir}/%{name}/poker.client.xml
%{_datadir}/%{name}/conf/poker.client.xml
%{_datadir}/%{name}/upgrades/poker.client
%{python_sitelib}/pokerui
%{python_sitelib}/pokernetwork/client*
%{python_sitelib}/pokernetwork/pokerchildren*
%{python_sitelib}/pokernetwork/pokerclient*

%files -n poker-server
%defattr(-,root,root,-)
%doc COPYING README poker-server/README.Fedora
%attr(-,%{poker_user},root) %config(noreplace) %{_sysconfdir}/%{name}/poker.server.xml
%config(noreplace) %{_sysconfdir}/%{name}/poker.pem
%{_initrddir}/poker-server
%dir %attr(-,%{poker_user},root) %{_var}/run/%{name}
%dir %attr(-,%{poker_user},root) %{_var}/log/%{name}
%{_bindir}/poker-server-selinux
%{_sbindir}/pokerserver
%{_sbindir}/pokerdatabaseupgrade
%{_mandir}/man8/pokerserver*
%{_mandir}/man8/pokerdatabaseupgrade*
%{_datadir}/%{name}/*.sql
%{_datadir}/%{name}/conf/poker.server.xml
%{_datadir}/%{name}/conf/poker.pem
%{_datadir}/%{name}/upgrades/poker.server
%{_datadir}/%{name}/upgrades/upgrade
%{python_sitelib}/pokernetwork/currencyclient*
%{python_sitelib}/pokernetwork/pokeravatar*
%{python_sitelib}/pokernetwork/pokercashier*
%{python_sitelib}/pokernetwork/pokerdatabase*
%{python_sitelib}/pokernetwork/pokerlock*
%{python_sitelib}/pokernetwork/pokerserver*
%{python_sitelib}/pokernetwork/pokerservice*
%{python_sitelib}/pokernetwork/pokertable*
%{python_sitelib}/pokernetwork/server*

%files -n poker-web
%defattr(-,root,root,-)
%doc COPYING poker-web/README.Fedora
%config(noreplace) %{_sysconfdir}/poker-web
%config(noreplace) %{_sysconfdir}/httpd/conf.d/poker-web.conf
%{_datadir}/poker-web

%files -n poker-bot
%defattr(-,root,root,-)
%doc COPYING poker-bot/README.Fedora
%config(noreplace) %{_sysconfdir}/%{name}/poker.bot.xml
%{_initrddir}/poker-bot
%{_bindir}/poker-bot-selinux
%{_sbindir}/pokerbot
%{_mandir}/man8/pokerbot*
%{_datadir}/%{name}/conf/poker.bot.xml
%{_datadir}/%{name}/upgrades/poker.bot
%{python_sitelib}/pokernetwork/pokerbot*

%files selinux
%defattr(-,root,root,-)
%doc COPYING selinux/*.??
%{_datadir}/selinux/*/%{policy_name}.pp


%changelog
* Sun Feb 18 2007 Christopher Stone <chris.stone at gmail.com> 1.0.35-2
- Update policy file [attachment (id=148298)]

* Tue Feb 13 2007 Christopher Stone <chris.stone at gmail.com> 1.0.35-1
- Upstream sync
- Add selinux changes from wart
- Remove patches applied upstream

* Fri Jan 26 2007 Christopher Stone <chris.stone at gmail.com> 1.0.34-3
- Use %%{name} where poker-network is found in spec
- Keep poker.server.xml 0600 and update Fedora.README accordingly
- Remove poker-network-init selinux wrapper script
- Create poker-server-selinux and poker-bot-selinux wrapper scripts
- Create poker-server-selinux and poker-bot-selinux sub-packages
- Add sed substitutions to selinux wrapper scripts
- Modify init scripts to check for selinux wrapper script
- Change "mkdir -p" instances to "install -d"

* Wed Jan 24 2007 Christopher Stone <chris.stone at gmail.com> 1.0.34-2
- Write own status function using isrunning to poker-server/bot init
- Fix some errors in init files
- Change %%{poker_user} from games to poker
- Add useradd call in %%pre for poker-server
- Add note in poker-server README about x509 certificate
- Add quotes around sed expression

* Wed Jan 24 2007 Christopher Stone <chris.stone at gmail.com> 1.0.34-1
- Upstream sync
- Add a wrapper script for init files to help SElinux
- invoke wrapper script using daemon --user=POKER_USER
- add sed command to fill in POKER_USER in init files
- remove old config patch which is fixed in this release
- add new config patch to configure as noarch package
- comment out make check in spec
- Remove adduser call in %%pre and use userid of games instead

* Mon Jan 22 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-11
- Remove poker-server and poker-web Requires from poker-bot
- Remove NIHPHOBIA from %%doc
- Remove %%{version} from patch names
- Replace %%{_sysconfdir}/init.d with %%{_initrddir}
- Document relation between currency and URL in poker-web/README.Fedora
- Add a poker-bot/README.Fedora file for explaining cash-in URLs
- Change permissions on poker.server.xml to readable
- Add permission changing to instructions in poker-server/README.Fedora
- Add creation of %%{poker_user} user id to run poker-server
- Create a directory for poker-server log files
- Add poker-server run and log directories to poker-server %%files
- Change ownership of poker-server run/log directories to %%{poker_user}

* Sun Jan 21 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-10
- Add better pid file checking in init scripts
- Add FLUSH PRIVILEGES to poker-web README.Fedora
- Add another CREATE USER statement to README.Fedora for localhost
- Add patch to properly create users in pokerdatabase.py

* Sat Jan 20 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-9
- Fix init scripts, PYTHON_SITELIB substituion macro got lost
- Re-word poker-web README.Fedora file reflecting new changes

* Sat Jan 20 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-8
- Readd poker-client-lib package to this spec file
- Readd %%{release} to packages that require poker-client-lib
- Remove manual removal of files since they are all in poker-client-lib
- Update comments on rpmlint errors

* Sat Jan 20 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-7
- Create a httpd poker-web.conf file from the .htaccess file
- Remove existing htaccess and apache.conf files
- Add new apache conf to %%files in poker-web
- Make symlink to constants.php relative

* Fri Jan 19 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-6
- Add php to poker-web Requires (php-mysql does not pull it in)
- Add patch to fix --disable-poker2d config option
- Use --disable-poker2d option to reduce manually removing some files
- Remove no longer needed BuildRequires for poker2d package

* Fri Jan 19 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-5
- Remove webclient from poker-web Requires
- Remove %%{release} from poker-client-lib Requires for poker-bot
- Fix init scripts to work for different python releases
- Remove redundant python-twisted-core from BuildRequires

* Tue Jan 16 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-4
- Add php-mysql and php-gd to Requires for poker-web

* Tue Jan 16 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-3
- Do not glob removal of files under %%{python_sitearch}
- Change Requires from php to php-bcmath for poker-web

* Sun Jan 14 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-2
- Split out poker-client-lib/poker2d files into another spec file
- Add Requires apg and poker-web to poker-bot
- No longer remove symlinks for constants.php and htaccess
- Create a README.Fedora for poker-web package
- Reduce initial number of bots to four due to a bug

* Thu Jan 11 2007 Christopher Stone <chris.stone at gmail.com> 1.0.33-1
- Upstream sync
- Add %%find_lang for new locales

* Wed Jan 10 2007 Christopher Stone <chris.stone at gmail.com> 1.0.32-8
- Move poker-interface to %%{_libexecdir}
- Package poker-interface with poker-client-lib
- Remove no longer needed shared lib patch

* Wed Jan 10 2007 Christohper Stone <chris.stone at gmail.com> 1.0.32-7
- Keep permssions 600 for poker.server.xml file

* Fri Jan 05 2007 Christopher Stone <chris.stone at gmail.com> 1.0.32-6
- Replace pkgconfig with poker-eval-devel

* Tue Jan 02 2007 Christopher Stone <chris.stone at gmail.com> 1.0.32-5
- Move poker-interface to %%{python_sitearch}/pokerclient2d
- Fix configure options
- Remove TODO comments

* Sun Dec 31 2006 Christopher Stone <chris.stone at gmail.com> 1.0.32-4
- Add full path to exec in desktop file
- Add pkgconfig to devel subpackage
- Convert icons to png format and store in icons directory
- Update TODO comments

* Fri Dec 29 2006 Christopher Stone <chris.stone at gmail.com> 1.0.32-3
- Update BR/R to new python-twisted stack

* Mon Dec 18 2006 Christopher Stone <chris.stone at gmail.com> 1.0.32-2
- Remove semanage call in init file until an selinux policy is written
- Add comment to %%check section indicating that it is not functional
- Update TODO comments

* Sun Dec 17 2006 Christopher Stone <chris.stone at gmail.com> 1.0.32-1
- Initial RPM release


--- NEW FILE poker-server-README.Fedora ---
poker-server will automatically set up your MySQL database for you when you
start the server for the first time, however, in order for it to do so you
must give the server your MySQL root password.

NOTE: If your password contains an HTML entity character such as <, >, or & you
must HTML encode your password within the xml file, such as & for &.

bash# pushd /etc/poker-network
bash# vi poker.server.xml ; # Add MySQL root password to <database> tag
bash# /sbin/service poker-server start
bash# vi poker.server.xml ; # Remove MySQL root password from <database> tag
bash# popd

NOTE: You are only required to do this one time.  Once your database is set
up the MySQL root password is no longer needed and can safely be removed from
the configuration file.

If you already have a previous version installed, you must upgrade your
database using the pokerdatabaseupgrade command.

bash# /usr/sbin/pokerdatabaseupgrade --upgrades=database conf/poker.server.xml

poker-server uses the following IP ports:

19380 default
19381 is for SSL
19382 is for XMLRPC
18383 is for XMLRPC over SSL

NOTE: The x509 certificate, poker.pem, is only a place holder that must be
replaced if you're serious about security.  The default cert provides no
security at all, since everyone has access to the certificate's private key. 


--- NEW FILE poker-server-selinux ---
#!/bin/sh
# Wrapper for init file which enables SElinux usage.
/usr/bin/python /usr/bin/twistd \
    --python "PYTHON_SITELIB/pokernetwork/pokerserver.py" \
    ${0+$@}


--- NEW FILE poker-server.fc ---
# label: system_u:object_r:pokerd_exec_t
# MLS sensitivity: s0
# MCS categories: <none>

/usr/bin/poker-server-selinux	--	gen_context(system_u:object_r:pokerd_exec_t,s0)
/usr/bin/poker-bot-selinux	--	gen_context(system_u:object_r:pokerd_exec_t,s0)
/etc/poker-network(/.*)?                gen_context(system_u:object_r:pokerd_private_data_t)


--- NEW FILE poker-server.if ---
## <summary>policy for poker-server</summary>

########################################
## <summary>
##	Execute a domain transition to run poker-server.
## </summary>
## <param name="domain">
## <summary>
##	Domain allowed to transition.
## </summary>
## </param>
#
interface(`pokerd_domtrans',`
	gen_require(`
		type pokerd_t, pokerd_exec_t;
	')

	domain_auto_trans($1,pokerd_exec_t,pokerd_t)

	allow $1 pokerd_t:fd use;
	allow pokerd_t $1:fd use;
	allow pokerd_t $1:fifo_file rw_file_perms;
	allow pokerd_t $1:process sigchld;
')


--- NEW FILE poker-server.init ---
#!/bin/sh
#
# poker-server poker-network server
#
# chkconfig:   - 65 35
# description: Multi player online poker server with \
#              bots running according to /etc/poker-network
# processname: pokerserver
# config:      /etc/poker-network/poker.server.xml
# pidfile:     /var/run/poker-server.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

selinuxwrapper=/usr/bin/poker-server-selinux

python=/usr/bin/python
twistd=/usr/bin/twistd
reactor=poll

opt_args=--no_save

exec="PYTHON_SITELIB/pokernetwork/pokerserver.py"
prog=poker-server

pidfile=/var/run/poker-network/$prog.pid
logfile=/var/log/poker-network/$prog.log

botpidfile=/var/run/poker-network/poker-bot.pid

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

lockfile=/var/lock/subsys/$prog

# Possible return values:
# 0 = service is running
# 1 = pid file exists, but process is dead
# 2 = pid file gone, process is gone, but lockfile exists
# 3 = service not running
isrunning() {
    local base=pokerserver
    local pid

    if [ -f ${pidfile} ] ; then
        read pid < ${pidfile}
        ps $pid | grep $base 2>&1 > /dev/null
        running=$?
        if [ "$running" = 0 ] ; then
            return 0
        fi

        if [ -n "$pid" ]; then
            return 1
        fi
    fi
    if [ -f ${lockfile} ]; then
        return 2
    fi

    return 3
}

poker_status() {
    isrunning
    retval=$?
    case $retval in
        0)  echo "$prog is running."
            ;;
        1)  echo "$prog stopped but pid file exists..."
            ;;
        2)  echo "$prog stopped but subsys locked..."
            ;;
        3)  echo "$prog is stopped."
            ;;
    esac
}

start() {
    echo -n $"Starting $prog: "
    isrunning
    retval=$?
    case $retval in
        0)  echo -n $"$prog already running"
            failure
            echo
            return 1
            ;;
        1)  echo -n $"$prog stopped but pid file exists..."
            ;;
        2)  echo -n $"$prog stopped but subsys locked..."
            ;;
    esac

    if selinuxenabled ; then
        /usr/sbin/semanage port -a -t pokerd_port_t -p tcp 19380-19383 &>/dev/null || :
    fi

    daemon --user=POKER_USER ${selinuxwrapper} \
            --pidfile=${pidfile} --logfile=${logfile} \
            --quiet ${opt_args} --reactor=${reactor}

    retval=$?
    if [ $retval -eq 0 ]; then
        success
        touch $lockfile
    else
        failure
    fi
    echo

    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    if [ -f ${botpidfile} ]; then
        echo -n $"Shut down poker-bot first!"
        failure
        echo
        return 1
    fi
    killproc -p ${pidfile} $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

fdr_status() {
    status $prog
}

case "$1" in
    start|stop|restart|reload)
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        poker_status
        ;;
    condrestart|try-restart)
        [ ! -f $lockfile ] || restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac


--- NEW FILE poker-server.te ---
policy_module(pokerd,1.0.0)

########################################
#
# Declarations
#

gen_require(`
    type port_t;
    type httpd_t;
    type http_port_t;
    attribute port_type;
    type var_log_t;
    type var_run_t;
    type mysqld_t;
    type mysqld_var_run_t;
    type mysqld_etc_t;
    type inaddr_any_node_t;
    type urandom_device_t;
    type random_device_t;
    type shell_exec_t;
')

type pokerd_port_t, port_type;

type pokerd_t;
type pokerd_exec_t;
domain_type(pokerd_t)
init_daemon_domain(pokerd_t, pokerd_exec_t)

# pid files
type pokerd_var_run_t;
files_pid_file(pokerd_var_run_t)

# Game data files
type pokerd_private_data_t;
files_type(pokerd_private_data_t);

########################################
#
# poker-server local policy
#
# Check in /etc/selinux/refpolicy/include for macros to use instead of allow rules.
# Note: /usr/share/selinux/devel/include/support/obj_perm_sets.spt contains
# the definitions of many permissions, such as 'rw_dir_perms'

# Some common macros (you might be able to remove some)
files_read_usr_files(pokerd_t)
#files_read_etc_files(pokerd_t)
libs_use_ld_so(pokerd_t)
libs_use_shared_libs(pokerd_t)
miscfiles_read_localization(pokerd_t)
## internal communication is often done using fifo and unix sockets.
allow pokerd_t self:fifo_file { read write };
allow pokerd_t self:unix_stream_socket create_stream_socket_perms;

corecmd_dontaudit_search_sbin(pokerd_t)
corecmd_exec_bin(pokerd_t)

# log and pid files
allow pokerd_t var_log_t:dir { getattr search add_name write};
allow pokerd_t var_log_t:file { rw_file_perms create setattr};
allow pokerd_t var_run_t:dir { add_name write remove_name};
allow pokerd_t var_run_t:file { create getattr write unlink};

## Networking basics (adjust to your needs!)
sysnet_dns_name_resolve(pokerd_t)
corenet_udp_bind_all_nodes(pokerd_t)
corenet_non_ipsec_sendrecv(pokerd_t)
allow pokerd_t pokerd_port_t:tcp_socket { name_bind name_connect recv_msg send_msg};
allow pokerd_t inaddr_any_node_t:tcp_socket node_bind;
allow pokerd_t self:tcp_socket { accept listen };
allow pokerd_t port_t:tcp_socket { recv_msg send_msg };

# Allow the webapp component to connect to the backend poker server
allow httpd_t pokerd_port_t:tcp_socket name_connect;

# Allow the poker bot to connect to a poker server and cash-in
allow pokerd_t http_port_t:tcp_socket { name_connect recv_msg send_msg };

#corenet_udp_sendrecv_all_ports(pokerd_t)

# Database accesses
allow pokerd_t mysqld_t:unix_stream_socket connectto;
allow pokerd_t mysqld_var_run_t:sock_file write;
mysql_search_db(pokerd_t)

# The poker server invokes 'mysql' directly, outside of the python api,
# to set up the initial database tables.  This may be fixed in a later
# release.
allow pokerd_t mysqld_etc_t:file { getattr read };


# Init script handling
init_use_fds(pokerd_t)
init_use_script_ptys(pokerd_t)
domain_use_interactive_fds(pokerd_t)
# The init script uses 'runcon' to transition into the correct
# domain.
domain_entry_file(pokerd_t, bin_t)

# Game private data
allow pokerd_t pokerd_private_data_t:file { r_file_perms };
allow pokerd_t pokerd_private_data_t:dir search;
allow pokerd_t etc_t:file { getattr read };

# Misc rules that are needed.  I don't understand the meaning of some
# of these, and for others I don't yet understand why the game needs
# them
#kernel_read_system_state(pokerd_t)
allow pokerd_t self:process signal;
allow pokerd_t self:netlink_route_socket { bind create getattr nlmsg_read read write };
allow pokerd_t urandom_device_t:chr_file { getattr read };
allow pokerd_t random_device_t:chr_file { getattr ioctl read };
allow pokerd_t shell_exec_t:file { execute execute_no_trans getattr read };


--- NEW FILE poker-web-README.Fedora ---
To get the web interface running you must create a "currency_one" database and
a "currency" user that has full access to it.  The default password for the
currency user is "currency".

mysql> CREATE DATABASE currency_one;
mysql> CREATE USER 'currency'@'%' IDENTIFIED BY 'currency';
mysql> CREATE USER 'currency'@'localhost' IDENTIFIED BY 'currency';
mysql> GRANT ALL ON currency_one.* TO currency;
mysql> FLUSH PRIVILEGES;

You must also restart apache to read in the poker-web.conf httpd configuration
file.

bash# /sbin/service httpd restart

NOTE: currency types are directly related to the URL used to cash-in.  In order
for two people to have the same currency type to play each other, they must use
the same URL for cashing in.

For example, Joe sets up his server and cashes in using the web URL
http://localhost/poker-web.  Joe then invites his friend Sarah to play along
and gives Sarah his IP address. Sarah cashes in using http://1.3.4.5/poker-web.
Joe and Sarah will not be able to play againt each other in this case because
they are using two different currencies.


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/poker-network/FC-6/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	20 Feb 2007 01:23:58 -0000	1.1
+++ .cvsignore	20 Feb 2007 02:16:53 -0000	1.2
@@ -0,0 +1 @@
+poker-network-1.0.35.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/poker-network/FC-6/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	20 Feb 2007 01:23:58 -0000	1.1
+++ sources	20 Feb 2007 02:16:53 -0000	1.2
@@ -0,0 +1 @@
+db5dd531d4d7113c1777ba66a41fe803  poker-network-1.0.35.tar.gz




More information about the fedora-extras-commits mailing list