rpms/crossfire/devel crossfire-1.9.0-plugin-io.patch, NONE, 1.1 crossfire.init, NONE, 1.1 crossfire.logrotate, NONE, 1.1 crossfire.spec, NONE, 1.1 crossfire.sysconfig, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Michael Thomas (wart) fedora-extras-commits at redhat.com
Wed May 17 03:30:31 UTC 2006


Author: wart

Update of /cvs/extras/rpms/crossfire/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28796/devel

Modified Files:
	.cvsignore sources 
Added Files:
	crossfire-1.9.0-plugin-io.patch crossfire.init 
	crossfire.logrotate crossfire.spec crossfire.sysconfig 
Log Message:
auto-import crossfire-1.9.0-4 on branch devel from crossfire-1.9.0-4.src.rpm

crossfire-1.9.0-plugin-io.patch:

--- NEW FILE crossfire-1.9.0-plugin-io.patch ---
--- plugins/cfpython/cfpython.c	2006-01-30 21:44:56.000000000 -0800
+++ plugins/cfpython/cfpython.c.new	2006-05-16 15:59:29.000000000 -0700
@@ -673,7 +673,7 @@
     scriptfile = fopen(context->script, "r");
     if (scriptfile == NULL) {
         if (!silent)
-            printf( "cfpython - The Script file %s can't be opened\n", context->script);
+            LOG(llevError, "cfpython - The Script file %s can't be opened\n", context->script);
         return 0;
     }
     pushContext(context);
@@ -705,7 +705,7 @@
     PyObject *m, *d;
     int i;
     gethook = gethooksptr;
-    printf("CFPython 2.0a init\n");
+    LOG(llevDebug, "CFPython 2.0a init\n");
 
     Py_Initialize();
     Crossfire_ObjectType.tp_new = PyType_GenericNew;
@@ -795,7 +795,7 @@
     rv = 0;
 
     if (current_command < 0) {
-        printf("Illegal call of runPluginCommand, call find_plugin_command first.\n");
+        LOG(llevError, "Illegal call of runPluginCommand, call find_plugin_command first.\n");
         return 1;
     }
     snprintf(buf, sizeof(buf), "%s.py", cf_get_maps_directory(CustomCommand[current_command].script));
@@ -831,7 +831,7 @@
     int rtype = 0;
     FILE*   scriptfile;
 
-    printf("CFPython 2.0a post init\n");
+    LOG(llevDebug, "CFPython 2.0a post init\n");
     registerGlobalEvent =   gethook(&rtype, hooktype, "cfapi_system_register_global_event");
     unregisterGlobalEvent = gethook(&rtype, hooktype, "cfapi_system_unregister_global_event");
     systemDirectory       = gethook(&rtype, hooktype, "cfapi_system_directory");
@@ -890,7 +890,7 @@
     strcpy(context->options, "");
     switch(context->event_code) {
         case EVENT_CRASH:
-            printf( "Unimplemented for now\n");
+            LOG(llevDebug, "Unimplemented for now\n");
             break;
         case EVENT_BORN:
             op = va_arg(args, object*);
@@ -1044,7 +1044,7 @@
 
 CF_PLUGIN int   closePlugin()
 {
-    printf("CFPython 2.0a closing\n");
+    LOG(llevDebug, "CFPython 2.0a closing\n");
     Py_Finalize();
     return 0;
 }
--- plugins/cfpython/cfpython_map.c	2006-02-14 23:24:11.000000000 -0800
+++ plugins/cfpython/cfpython_map.c.new	2006-05-16 15:59:40.000000000 -0700
@@ -176,7 +176,7 @@
     /* make sure the map is swapped in */
     if (map->map->in_memory != MAP_IN_MEMORY)
     {
-        printf("MAP AIN'T READY !\n");
+        LOG(llevError, "MAP AIN'T READY !\n");
     }
 
     mflags = cf_map_get_flags(map->map, &(map->map), (sint16)x, (sint16)y, &nx, &ny);


--- NEW FILE crossfire.init ---
#!/bin/sh
#
# crossfire    This shell script takes care of starting and stopping
#              the crossfire game server.
#
# chkconfig:   - 15 85
# description: The crossfire server supports playing networked \
#              multi-player games.
# processname: crossfire
# config:      /etc/sysconfig/crossfire
# pidfile:     /var/run/crossfire.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

exec="/usr/bin/crossfire"
prog=$(basename $exec)
pidfile=/var/run/$prog.pid

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

lockfile=/var/lock/subsys/$prog

start() {
    echo -n $"Starting Crossfire game server: "
    if [ -n "`/sbin/pidof $prog`" ]; then
        echo -n $"$prog already running"
        failure
        echo
        return 1
    fi
    daemon --user crossfire $exec $CROSSFIRE_OPTIONS -detach -log /var/log/crossfire/crossfire.log
    retval=$?
    if [ $retval -eq 0 ]; then
        success
        touch $lockfile
        pidofproc $prog > $pidfile
    else
        failure
    fi
    echo
    return $retval
}

stop() {
    echo -n $"Stopping Crossfire game server: "
    killproc $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)
        fdr_status
        ;;
    condrestart|try-restart)
        [ ! -f $lockfile ] || restart
    ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac


--- NEW FILE crossfire.logrotate ---
/var/log/crossfire/crossfire.log {
    copytruncate
    notifempty
    missingok
}


--- NEW FILE crossfire.spec ---
Name: crossfire
Version: 1.9.0
Release: 4%{?dist}
Summary: Server for hosting crossfire games
Group: Amusements/Games
License: GPL
URL: http://crossfire.real-time.com
Source0: http://dl.sourceforge.net/crossfire/%{name}-%{version}.tar.gz
Source1: http://dl.sourceforge.net/crossfire/%{name}-%{version}.arch.tar.gz
Source2: crossfire.init
Source3: crossfire.sysconfig
Source4: crossfire.logrotate
Patch0:  crossfire-1.9.0-plugin-io.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:       crossfire-maps
# BuildRequires necessary for the map editor
BuildRequires:  python-devel
%if "%fedora" <= "4"
BuildRequires:  xorg-x11-devel
%else
BuildRequires:  libXt-devel
BuildRequires:  libXext-devel
BuildRequires:  libXaw-devel
%endif

Requires(post): /sbin/chkconfig
Requires(post): /sbin/service
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service
Requires(pre):   fedora-usermgmt
Requires(postun): fedora-usermgmt

%description
Crossfire is a highly graphical role-playing adventure game with
characteristics reminiscent of rogue, nethack, omega, and gauntlet. 
It has multiplayer capability and presently runs under X11.

This package contains the server for hosting crossfire games over a
public or private network.

%package doc
Summary: Documentation files for Crossfire
Group: Documentation
# Don't require the base package.  The docs can be used without the
# base package, and in fact include docs for both the client and
# server packages.
%description doc
Documentation files for the crossfire game.

%package devel
Summary: Development files for writing crossfire plugins
Group: Development/Libraries
Requires: %{name} = %{version}
%description devel
Development files for writing crossfire plugins.

%package plugins
Summary: Plugin modules for the crossfire game server
Group: Amusements/Games
Requires: %{name} = %{version}
%description plugins
Plugin modules for the crossfire game server.

%package client-images
Summary: Image cache for crossfire clients
Group: Amusements/Games
# crossfire-client provides a directory needed by the images.
# No version dependency for the client since the images are pretty
# ignorant of the client version.
Requires: crossfire-client
%description client-images
Image files that can be used with the crossfire clients so that they
don't have to be downloaded from the server.

%prep
%setup -q
%setup -q -a 1
%patch0
mv arch/ lib/

%{__sed} -i 's#\r##' utils/player_dl.pl.in
# Don't use a hardcoded /tmp directory for building the image archive
%{__sed} -i "s#^\$TMPDIR=.*#\$TMPDIR=\"`pwd`\";#" lib/adm/collect_images.pl
# Don't map stdio streams to /
%{__sed} -i 's#    (void) open ("/", O_RDONLY);#    (void) open ("/var/log/crossfire/crossfire.log", O_RDONLY);#' server/daemon.c

%build
# Change the localstatedir so that the variable data files are
# put in /var/games/crossfire instead of /var/crossfire.  This is
# in agreement with the FHS.
%configure --localstatedir=%{_var}/games --disable-static
make %{?_smp_mflags}

# This will create a tarball of the images for the client.
cd lib && adm/collect_images.pl -archive

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

# Install the client images
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client
tar xf %{name}-images.tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client
# Nuke the installation instructions for the image archive.
rm $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client/README

install -pD -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/crossfire

# Move some rarely-used binaries out of /usr/bin and into a
# tools directory.
mkdir $RPM_BUILD_ROOT%{_datadir}/%{name}/tools

# This utility restarts crossfire at periodic intervals.
mv $RPM_BUILD_ROOT%{_bindir}/crossloop.pl $RPM_BUILD_ROOT%{_datadir}/%{name}/tools

# This submits core files to the developers.
mv $RPM_BUILD_ROOT%{_bindir}/crossloop.web $RPM_BUILD_ROOT%{_datadir}/%{name}/tools

# Allows players to download their player files from a web
# server. This feature relies on a properly configured web server
# which is not handled by this rpm release.
mv $RPM_BUILD_ROOT%{_bindir}/player_dl.pl $RPM_BUILD_ROOT%{_datadir}/%{name}/tools

# Binary for running a crossfire metaserver.  Requires interaction with
# a web server, so we disable this for now.
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/metaserver.pl

# I have no idea what this is for.
mv $RPM_BUILD_ROOT%{_libdir}/%{name}/mktable.script $RPM_BUILD_ROOT%{_datadir}/%{name}/tools

# This is not needed anymore based on comments at the top of
# the file itself.
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/add_throw.perl

# /usr/bin is a better place for the standalone random map generator
mv $RPM_BUILD_ROOT%{_libdir}/%{name}/random_map $RPM_BUILD_ROOT%{_bindir}/cross_random_map

rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la

# Create the log directory
mkdir -p $RPM_BUILD_ROOT%{_var}/log/%{name}

install -p -D -m 644 %{SOURCE3} \
    $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name}

install -p -D -m 644 %{SOURCE4} \
    $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/%{name}

%pre
user_uid=`id -u crossfire 2>/dev/null`
if [ x"$user_uid" = x ] ; then
    %{_sbindir}/fedora-useradd  27 -r -s /sbin/nologin \
            -d %{_datadir}/%{name} -M -c 'Crossfire Server' \
            crossfire >/dev/null || :
fi

%post
/sbin/chkconfig --add crossfire

%preun
if [ "$1" = "0" ]; then
    /sbin/service crossfire stop > /dev/null 2>&1
    /sbin/chkconfig --del crossfire
fi

%postun
if [ "$1" -ge "1" ]; then
    /sbin/service crossfire restart >/dev/null 2>&1
fi


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_bindir}/crossedit
%{_bindir}/crossfire
%{_bindir}/crossloop
%{_bindir}/cross_random_map
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/%{name}-client
%dir %{_libdir}/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/ban_file
%config(noreplace) %{_sysconfdir}/%{name}/dm_file
%config(noreplace) %{_sysconfdir}/%{name}/exp_table
%config(noreplace) %{_sysconfdir}/%{name}/forbid
%config(noreplace) %{_sysconfdir}/%{name}/motd
%config(noreplace) %{_sysconfdir}/%{name}/news
%config(noreplace) %{_sysconfdir}/%{name}/rules
%config(noreplace) %{_sysconfdir}/%{name}/settings
%attr(-,crossfire,root) %{_var}/games/%{name}
%attr(-,crossfire,root) %{_var}/log/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_mandir}/man6/*
%{_initrddir}/%{name}
%doc README NEWS DEVELOPERS AUTHORS COPYING

%files doc
%defattr(-,root,root,-)
%doc doc/*.doc doc/*.ps doc/SurvivalGuide
%doc doc/PlayerStats doc/RunTimeCommands doc/spellcasters_guide_to_runes

%files devel
%defattr(-,root,root,-)
%{_bindir}/crossfire-config
%doc doc/plugins

%files plugins
%defattr(-,root,root,-)
%{_libdir}/%{name}/plugins

%files client-images
%defattr(-,root,root,-)
%{_datadir}/%{name}/%{name}-client


%changelog
* Tue May 16 2006 Wart <wart at kobold.org> 1.9.0-4
- Added -doc subpackage
- Own /etc/crossfire
- Add crossfire-client dependency for crossfire-client-images

* Tue May 16 2006 Wart <wart at kobold.org> 1.9.0-3
- Added patch to fix missing stdout problem with python plugin.

* Mon May 15 2006 Wart <wart at kobold.org> 1.9.0-2
- Generate the -client-images subpackage here instead of relying
  on upstream's missing -client-images tarball.

* Thu Mar 9 2006 Wart <wart at kobold.org> 1.9.0-1
- Initial spec file following Fedora Extras conventions


--- NEW FILE crossfire.sysconfig ---
#
# crossfire(6) options. Pick a custom port here if needed, for example.
#

# The default options for crossfire are usually just fine.  Read
# the crossfire(6) manpage to see what you can set here.
CROSSFIRE_OPTIONS=""


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/crossfire/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	17 May 2006 03:26:46 -0000	1.1
+++ .cvsignore	17 May 2006 03:30:31 -0000	1.2
@@ -0,0 +1,2 @@
+crossfire-1.9.0.arch.tar.gz
+crossfire-1.9.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/crossfire/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	17 May 2006 03:26:46 -0000	1.1
+++ sources	17 May 2006 03:30:31 -0000	1.2
@@ -0,0 +1,2 @@
+7685cc806a02a3f14336095de6066128  crossfire-1.9.0.arch.tar.gz
+43240af83a4414d2dcc19fff3af31a63  crossfire-1.9.0.tar.gz




More information about the fedora-extras-commits mailing list