/[smecontribs]/rpms/smeserver-teamspeak-server/contribs7/smeserver-teamspeak-server.spec
ViewVC logotype

Contents of /rpms/smeserver-teamspeak-server/contribs7/smeserver-teamspeak-server.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Wed Apr 2 15:03:59 2008 UTC (16 years, 2 months ago) by slords
Branch: MAIN
Changes since 1.1: +4 -0 lines
Add Id, Authority, Name

1 # $Id$
2 # Authority: cool34000
3 # Name: Sylvain Gomez
4
5 %define name smeserver-teamspeak-server
6 %define version 2.0.24.1
7 %define release 1
8 %define rpmver 4.0.4
9
10
11 Summary: Teamspeak is a VOIP server for on-line gaming
12 Name: %{name}
13 Version: %{version}
14 Release: %{release}%{?dist}
15 License: Freeware
16 Group: VOIP
17 Source: %{name}-%{version}.tar.gz
18 URL: http://www.goteamspeak.com/
19 BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
20 BuildArchitectures: noarch
21 BuildRequires: e-smith-devtools
22 Requires: e-smith-base, e-smith-release >= 7
23
24
25 %description
26 This RPM is an unofficial addon for the SME Server 7.x.
27 TeamSpeak is a software for quality voice communication via the Internet.
28 After installation open your webbrowser at
29 http://your_e-smith-server_name:14534
30
31
32
33 %changelog
34 * Sun Nov 11 2007 Sylvain Gomez <sylvaingomez@free.fr>
35 [2.0.24.1-1] New version
36 - Based on latest version + updated server_linux
37 - RPM structure fix
38 - Uninstall sections fixed
39
40 * Sun Jun 17 2007 Sylvain Gomez <sylvaingomez@free.fr>
41 [2.0.20.1-2] Fixing bugs
42 - Added teamspeak UserPassword
43 - Removed useless lines
44 - Few fix to teamspeak service file
45 - Now deleting temporary files
46
47 * Wed Jun 6 2007 Sylvain Gomez <sylvaingomez@free.fr>
48 [2.0.20.1-1] Original version
49
50
51 %prep
52
53
54 %setup
55
56
57 %build
58 # Default DB parameters
59 DEFAULTS1=root/etc/e-smith/db/configuration/defaults/teamspeak
60 DEFAULTS2=root/etc/e-smith/db/accounts/defaults/teamspeak
61 mkdir -p $DEFAULTS1
62 mkdir -p $DEFAULTS2
63 echo "public" > $DEFAULTS1/access
64 echo "enabled" > $DEFAULTS1/status
65 echo "service" > $DEFAULTS1/type
66 echo "8767" > $DEFAULTS1/UDPPort
67 echo "reserved" > $DEFAULTS2/type
68
69
70 %install
71 rm -rf $RPM_BUILD_ROOT
72 (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
73 rm -f %{name}-%{version}-filelist
74 /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
75
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80
81 %pre
82
83
84 %post
85 # Adding teamspeak to SME's db
86 /etc/e-smith/events/actions/initialize-default-databases
87 echo " "
88
89 # Variables
90 SRVNAME=$(/sbin/e-smith/db configuration get SystemName)
91 TSPASS=$(/sbin/e-smith/db configuration getprop teamspeak UserPassword)
92
93 echo "Decompressing files..."
94 tar -xjf /usr/share/doc/teamspeak-server-2.0.24.1/Sources/ts2_server_rc2_202319.tar.bz2 -C /opt
95 mv -f /opt/tss2_rc2 /opt/teamspeak
96 cp -f /usr/share/doc/teamspeak-server-2.0.24.1/Sources/server_linux /opt/teamspeak/
97 rm -f /opt/teamspeak/teamspeak2-server_startscript
98
99 echo "Creating user teamspeak..."
100 useradd -M -c 'TeamSpeak Server' -d /opt/teamspeak teamspeak -s /bin/bash -p '$TSPASS'
101 chown -R root:teamspeak /opt/teamspeak
102 chmod 770 /opt/teamspeak
103 chmod 750 /opt/teamspeak/server_linux
104 chmod 750 /opt/teamspeak/sqlite_sql
105
106 echo "Creating service..."
107 ln -f -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S98teamspeak
108 ln -f -s /etc/rc.d/init.d/e-smith-service /etc/rc6.d/K98teamspeak
109 /sbin/e-smith/signal-event remoteaccess-update
110
111 echo "Starting the daemon..."
112 /etc/rc7.d/S98teamspeak start
113
114 echo " "
115 echo "-------------------------------------------------------------------------------"
116 echo "TeamSpeak Server installation finished."
117 echo "You can access to the configuration page at: http://$SRVNAME:14534"
118 /etc/rc7.d/S98teamspeak passwords
119 echo " "
120 /sbin/e-smith/config show teamspeak
121 echo "-------------------------------------------------------------------------------"
122
123 %preun
124 if [ $1 = 0 ] ; then
125 DIR=/opt/teamspeak
126 # Stopping TS service if needed...
127 if [ -e $DIR/tsserver2.pid ]; then
128 echo -n "Stopping the TeamSpeak Voice server..."
129 if ( kill -TERM `cat $DIR/tsserver2.pid` ); then
130 for c in $(seq 1 300); do
131 if [ -e $DIR/tsserver2.pid ]; then
132 echo -n "."
133 sleep 1
134 fi
135 done
136 fi
137 if [ -e $DIR/tsserver2.pid ]; then
138 echo "server does not shutdown cleanly - killing"
139 kill -KILL `cat $DIR/tsserver2.pid`
140 rm $DIR/tsserver2.pid
141 sleep 5
142 else
143 echo "done"
144 fi
145 fi
146 fi
147
148
149 %postun
150 if [ $1 = 0 ] ; then
151 echo "Unregistering and deleting service..."
152 rm -f /etc/rc.d/rc7.d/S98teamspeak
153 rm -f /etc/rc.d/rc6.d/K98teamspeak
154 /sbin/e-smith/config delete teamspeak
155 /sbin/e-smith/signal-event remoteaccess-update
156
157 echo "Deleting user teamspeak..."
158 userdel teamspeak
159
160 echo "Deleting install directory..."
161 rm -rf /opt/teamspeak
162 fi
163
164
165 %files -f %{name}-%{version}-filelist
166
167
168 %defattr(-,root,root)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed