rpms/tetrinetx/FC-5 tetrinetx.init, NONE, 1.1 tetrinetx.logrotate, NONE, 1.1 tetrinetx.spec, NONE, 1.1 sources, 1.1, 1.2
Francois Aucamp (faucamp)
fedora-extras-commits at redhat.com
Fri Mar 16 10:23:41 UTC 2007
Author: faucamp
Update of /cvs/extras/rpms/tetrinetx/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10404
Modified Files:
sources
Added Files:
tetrinetx.init tetrinetx.logrotate tetrinetx.spec
Log Message:
Initial import
--- NEW FILE tetrinetx.init ---
#!/bin/bash
#
# tetrinetx Starts, Stops and Restarts the GNU TetriNET server
#
# chkconfig: - 98 01
# description: The GNU TetriNET server daemon
# processname: tetrinetx
# config: /etc/tetrinetx/game.conf
# pidfile: /var/run/tetrinetx.pid
SERVICE_DISPLAYNAME="TetriNET server"
SERVICE_NAME=tetrinetx
SERVICE_USER=tetrinetx
SERVICE_BIN=/usr/bin/tetrinetx
# Source function library.
. /etc/init.d/functions
start() {
echo -n "Starting $SERVICE_DISPLAYNAME: "
daemon --user $SERVICE_USER "$SERVICE_BIN > /dev/null"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE_NAME
echo
return $RETVAL
}
stop() {
echo -n "Shutting down $SERVICE_DISPLAYNAME: "
killproc $SERVICE_BIN
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE_NAME
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $SERVICE_BIN
;;
restart|reload)
stop
start
;;
condrestart)
[ -f /var/lock/subsys/$SERVICE_NAME ] && stop && start || :
;;
*)
echo "Usage: $SERVICE_NAME {start|stop|status|reload|restart|condrestart}"
exit 1
;;
esac
exit $?
--- NEW FILE tetrinetx.logrotate ---
/var/log/tetrinetx/game.log {
missingok
notifempty
size 30k
create 0644 tetrinetx tetrinetx
}
--- NEW FILE tetrinetx.spec ---
Name: tetrinetx
Version: 1.13.16
Release: 2%{?dist}
Summary: The GNU TetriNET server
Group: Amusements/Games
License: GPL
URL: http://tetrinetx.sourceforge.net/
Source0: http://switch.dl.sourceforge.net/sourceforge/tetrinetx/%{name}-%{version}+qirc-1.40c.tar.gz
Source1: tetrinetx.init
Source2: tetrinetx.logrotate
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: adns-devel
Requires: logrotate
Requires(pre): /sbin/chkconfig /usr/sbin/useradd
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
%description
Tetrinetx is the GNU TetriNET server written in C. It includes IRC and
Spectator supports. As many other tetrinet servers, it uses IP independent
decryption which allows the server to run behind a router.
TetriNET is a network-based, multiplayer falling bricks game. This package
contains a server for hosting TetriNET games over a public or private network.
%prep
%setup -q -n %{name}-%{version}+qirc-1.40c
# Modify the compile script to use correct directories and use "tetrinetx" as
# the program name
sed -i "s:/usr/local:%{_prefix}:g; s/tetrix\\.linux/tetrinetx/g" -i src/compile.linux
# Modify the default config file to use the correct pid file location
sed -i "s:game\\.pid:%{_localstatedir}/run/tetrinetx/game.pid:" bin/game.conf
# Modify config.h to use correct directories for config files, etc
sed -i "s:game\\.log:%{_localstatedir}/log/tetrinetx/game\\.log:;
s:game\\.pid:%{_localstatedir}/run/tetrinetx/game\\.pid:;
s:game\\.winlist:%{_localstatedir}/games/tetrinetx/game\\.winlist:g;
s:\"game:\"%{_sysconfdir}/tetrinetx/game:g" src/config.h
%build
cd src
./compile.linux %{optflags} %{?_smp_mflags}
cd ..
%install
rm -rf %{buildroot}
# Install executable
mkdir -p %{buildroot}%{_bindir}
install -m 755 bin/tetrinetx %{buildroot}%{_bindir}/
# Install configuration files
mkdir -p %{buildroot}%{_sysconfdir}/tetrinetx
install -p -m 644 bin/game.conf %{buildroot}%{_sysconfdir}/tetrinetx
install -p -m 644 bin/game.motd %{buildroot}%{_sysconfdir}/tetrinetx
install -p -m 644 bin/game.pmotd %{buildroot}%{_sysconfdir}/tetrinetx
install -p -m 600 bin/game.secure %{buildroot}%{_sysconfdir}/tetrinetx
# Install system init script
mkdir -p %{buildroot}%{_initrddir}
install -p -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/tetrinetx
# Install logrotate.d entry
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/tetrinetx
# Log files are placed under /var/log/tetrinetx
mkdir -p %{buildroot}%{_localstatedir}/log/tetrinetx
# State data (winlists, etc) for the game will be placed in /var/games/tetrinetx
mkdir -p %{buildroot}%{_localstatedir}/games/tetrinetx
# Tetrinetx pid file goes here
mkdir -p %{buildroot}%{_localstatedir}/run/tetrinetx
%clean
rm -rf %{buildroot}
%pre
# Installation
if [ $1 -eq 1 ]; then
/usr/sbin/useradd -c "The GNU TetriNET server" -r -M -s '' \
-d %{_localstatedir}/games/tetrinetx tetrinetx &>/dev/null || :
fi
%post
# Installation
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add tetrinetx
fi
%preun
# Uninstallation
if [ $1 -eq 0 ]; then
/etc/init.d/tetrinetx stop &> /dev/null || :
/sbin/chkconfig --del tetrinetx || :
fi
%postun
# Upgrade
if [ $1 -ge 1 ]; then
/etc/init.d/tetrinetx condrestart &>/dev/null || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README README.qirc.spectators bin/game.allow.example bin/game.ban.compromise.example bin/game.ban.example
%{_bindir}/tetrinetx
%{_initrddir}/tetrinetx
%dir %{_sysconfdir}/tetrinetx
%config(noreplace) %{_sysconfdir}/logrotate.d/tetrinetx
%defattr(-,tetrinetx,tetrinetx)
%{_localstatedir}/log/tetrinetx
%{_localstatedir}/games/tetrinetx
%{_localstatedir}/run/tetrinetx
%config(noreplace) %{_sysconfdir}/tetrinetx/*
%changelog
* Tue Mar 13 2007 Francois Aucamp <faucamp at csir.co.za> - 1.13.16-2
- Cleaned up sed scripts in %%prep
- Replaced config.h patch with sed script in order to support RPM macros
- Removed trademarked names from %%description
* Tue Jan 30 2007 Francois Aucamp <faucamp at csir.co.za> - 1.13.16-1
- Initial RPM build
- Created patch to make config.h refer to correct directories
- Created tetrinetx init script
- Created tetrinetx logrotate.d entry
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/tetrinetx/FC-5/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 14 Mar 2007 19:00:39 -0000 1.1
+++ sources 16 Mar 2007 10:23:08 -0000 1.2
@@ -0,0 +1 @@
+32e5306bc26afc9e5acdca9c093947c0 tetrinetx-1.13.16+qirc-1.40c.tar.gz
More information about the fedora-extras-commits
mailing list