Browse code

- opensuse/suse packaging stuff

Jan Janak authored on 20/07/2006 15:12:50
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,136 @@
1
+#! /bin/sh
2
+# Copyright (c) 2002 Frauenhofer Gesellschaft FOKUS, Germany.
3
+# All rights reserved.
4
+#
5
+# Author: Nils Ohlmeier <ohlmeier@fokus.fhg.de>
6
+#
7
+# /etc/init.d/ser
8
+#
9
+### BEGIN INIT INFO
10
+# Provides:          sip
11
+# Required-Start:    $network
12
+# X-UnitedLinux-Should-Start: $network
13
+# Required-Stop:     $network
14
+# X-UnitedLinux-Should-Stop: $network
15
+# Default-Start:     3 5
16
+# Default-Stop:      0 1 2 6
17
+# Short-Description: SIP Express Router
18
+# Description:       Start SER and provide the routing of SIP requests.
19
+### END INIT INFO
20
+
21
+
22
+# Check for missing binaries (stale symlinks should not happen)
23
+SER_BIN=/usr/sbin/ser
24
+test -x $SER_BIN || exit 5
25
+
26
+# Check for existence of needed config file and read it
27
+SER_CONFIG=/etc/ser/ser.cfg
28
+test -r $SER_CONFIG || exit 6
29
+#. $SER_CONFIG
30
+
31
+# Shell functions sourced from /etc/rc.status:
32
+#      rc_check         check and set local and overall rc status
33
+#      rc_status        check and set local and overall rc status
34
+#      rc_status -v     ditto but be verbose in local rc status
35
+#      rc_status -v -r  ditto and clear the local rc status
36
+#      rc_status -s     display "skipped" and exit with status 3
37
+#      rc_status -u     display "unused" and exit with status 3
38
+#      rc_failed        set local and overall rc status to failed
39
+#      rc_failed <num>  set local and overall rc status to <num>
40
+#      rc_reset         clear local rc status (overall remains)
41
+#      rc_exit          exit appropriate to overall rc status
42
+#      rc_active	checks whether a service is activated by symlinks
43
+#      rc_splash arg    sets the boot splash screen to arg (if active)
44
+. /etc/rc.status
45
+
46
+# Reset status of this service
47
+rc_reset
48
+
49
+# Return values acc. to LSB for all commands but status:
50
+# 0	  - success
51
+# 1       - generic or unspecified error
52
+# 2       - invalid or excess argument(s)
53
+# 3       - unimplemented feature (e.g. "reload")
54
+# 4       - user had insufficient privileges
55
+# 5       - program is not installed
56
+# 6       - program is not configured
57
+# 7       - program is not running
58
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
59
+# 
60
+# Note that starting an already running service, stopping
61
+# or restarting a not-running service as well as the restart
62
+# with force-reload (in case signaling is not supported) are
63
+# considered a success.
64
+
65
+case "$1" in
66
+    start)
67
+	echo -n "Starting SIP Express Router "
68
+	## Start daemon with startproc(8). If this fails
69
+	## the return value is set appropriately by startproc.
70
+	startproc $SER_BIN -f $SER_CONFIG
71
+
72
+	# Remember status and be verbose
73
+	rc_status -v
74
+	;;
75
+    stop)
76
+	echo -n "Shutting down SIP Express Router "
77
+	## Stop daemon with killproc(8) and if this fails
78
+	## killproc sets the return value according to LSB.
79
+
80
+	killproc -TERM $SER_BIN
81
+
82
+	# Remember status and be verbose
83
+	rc_status -v
84
+	;;
85
+    restart)
86
+	## Stop the service and regardless of whether it was
87
+	## running or not, start it again.
88
+	$0 stop
89
+	$0 start
90
+
91
+	# Remember status and be quiet
92
+	rc_status
93
+	;;
94
+    force-reload)
95
+	## Signal the daemon to reload its config. Most daemons
96
+	## do this on signal 1 (SIGHUP).
97
+	## If it does not support it, restart.
98
+
99
+	echo -n "Reload service SIP Express Router "
100
+	## Otherwise:
101
+	$0 stop  &&  $0 start
102
+	rc_status
103
+	;;
104
+    reload)
105
+	## Like force-reload, but if daemon does not support
106
+	## signaling, do nothing (!)
107
+
108
+	## Otherwise if it does not support reload:
109
+	rc_failed 3
110
+	rc_status -v
111
+	;;
112
+    status)
113
+	echo -n "Checking for service SIP Express Router "
114
+	## Check status with checkproc(8), if process is running
115
+	## checkproc will return with exit status 0.
116
+
117
+	# Return value is slightly different for the status command:
118
+	# 0 - service up and running
119
+	# 1 - service dead, but /var/run/  pid  file exists
120
+	# 2 - service dead, but /var/lock/ lock file exists
121
+	# 3 - service not running (unused)
122
+	# 4 - service status unknown :-(
123
+	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
124
+	
125
+	# NOTE: checkproc returns LSB compliant status values.
126
+	checkproc $SER_BIN
127
+	# NOTE: rc_status knows that we called this init script with
128
+	# "status" option and adapts its messages accordingly.
129
+	rc_status -v
130
+	;;
131
+    *)
132
+	echo "Usage: $0 {start|stop|status|restart}"
133
+	exit 1
134
+	;;
135
+esac
136
+rc_exit
0 137
new file mode 100644
... ...
@@ -0,0 +1,334 @@
1
+%define EXCLUDED_MODULES	mysql jabber auth_radius group_radius uri_radius postgres snmp cpl cpl-c extcmd 
2
+%define MYSQL_MODULES		mysql
3
+%define JABBER_MODULES		jabber
4
+%define RADIUS_MODULES		auth_radius group_radius uri_radius
5
+%define RADIUS_MOD_PATH		modules/auth_radius modules/group_radius modules/uri_radius
6
+
7
+
8
+Summary:      SIP Express Router, very fast and flexible SIP Proxy
9
+Name:         ser
10
+Version:      0.9.6
11
+Release:      22.1
12
+Packager:     Peter Nixon <peter+rpmspam@suntel.com.tr>
13
+License:      GPL
14
+Group:        Productivity/Telephony/SIP/Servers
15
+Source:       http://iptel.org/ser/stable/%{name}-%{version}_src.tar.bz2
16
+Source2:      ser.init.SuSE
17
+%ifarch x86_64
18
+Patch:        Makefile.defs.patch
19
+%endif
20
+URL:          http://www.iptel.org/ser
21
+Vendor:       FhG Fokus
22
+BuildRoot:    /var/tmp/%{name}-%{version}-root
23
+Conflicts:    ser < %{version}, ser-mysql < %{version}, ser-jabber < %{version}, ser-radius < %{version}
24
+BuildPrereq:  make flex bison 
25
+BuildRequires: mysql-devel, radiusclient, expat
26
+
27
+%description
28
+SIP Express Router (SER) is a very fast and flexible SIP (RFC3621)
29
+proxy server. Written entirely in C, SER can handle thousands calls
30
+per second even on low-budget hardware. A C Shell like scripting language
31
+provides full control over the server's behaviour. It's modular
32
+architecture allows only required functionality to be loaded.
33
+Currently the following modules are available: digest authentication,
34
+CPL scripts, instant messaging, MySQL support, a presence agent, radius
35
+authentication, record routing, an SMS Gateway, a jabber gateway, a 
36
+transaction module, registrar and user location.
37
+
38
+%package  mysql
39
+Summary:  MySQL connectivity for the SIP Express Router.
40
+Group:    Productivity/Telephony/SIP/Servers
41
+Requires: ser = %{version}
42
+BuildPrereq: mysql-devel zlib-devel
43
+
44
+%description mysql
45
+The ser-mysql package contains MySQL database connectivity that you
46
+need to use digest authentication module or persistent user location
47
+entries.
48
+
49
+%package  jabber
50
+Summary:  sip jabber message translation support for the SIP Express Router.
51
+Group:    Productivity/Telephony/SIP/Servers
52
+Requires: ser = %{version}
53
+BuildPrereq: expat
54
+
55
+%description jabber
56
+The ser-jabber package contains a sip to jabber message translator.
57
+
58
+%package  radius
59
+Summary:  ser radius authentication, group and uri check modules.
60
+Group:    Productivity/Telephony/SIP/Servers
61
+Requires: ser = %{version}
62
+BuildPrereq:  radiusclient
63
+
64
+%description radius
65
+The ser-radius package contains modules for radius authentication, group
66
+ membership and uri checking.
67
+
68
+%prep
69
+%setup
70
+%ifarch x86_64
71
+%patch
72
+%endif
73
+
74
+%build
75
+make all skip_modules="%EXCLUDED_MODULES" \
76
+%ifarch x86_64
77
+		modules-dir=/lib64/ser/modules/ \
78
+%endif
79
+		cfg-target=/%{_sysconfdir}/ser/
80
+make modules modules="modules/%MYSQL_MODULES" \
81
+%ifarch x86_64
82
+		modules-dir=/lib64/ser/modules/ \
83
+%endif
84
+		cfg-target=/%{_sysconfdir}/ser/
85
+make modules modules="modules/%JABBER_MODULES" \
86
+%ifarch x86_64
87
+		modules-dir=/lib64/ser/modules/ \
88
+%endif
89
+		cfg-target=/%{_sysconfdir}/ser/
90
+make modules modules="%RADIUS_MOD_PATH" \
91
+%ifarch x86_64
92
+		modules-dir=/lib64/ser/modules/ \
93
+%endif
94
+		cfg-target=/%{_sysconfdir}/ser/
95
+
96
+%install
97
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
98
+
99
+make install skip_modules="%EXCLUDED_MODULES" \
100
+		basedir=$RPM_BUILD_ROOT \
101
+		prefix=/usr \
102
+%ifarch x86_64
103
+		modules-dir=/lib64/ser/modules/ \
104
+%endif
105
+		cfg-prefix=$RPM_BUILD_ROOT \
106
+		cfg-target=/%{_sysconfdir}/ser/ \
107
+		doc-prefix=$RPM_BUILD_ROOT \
108
+		doc-dir=/%{_docdir}/ser/
109
+make install-modules modules="modules/%MYSQL_MODULES" \
110
+		basedir=$RPM_BUILD_ROOT \
111
+		prefix=/usr \
112
+%ifarch x86_64
113
+		modules-dir=/lib64/ser/modules/ \
114
+%endif
115
+		cfg-prefix=$RPM_BUILD_ROOT \
116
+		cfg-target=/%{_sysconfdir}/ser/ \
117
+		doc-prefix=$RPM_BUILD_ROOT \
118
+		doc-dir=/%{_docdir}/ser/
119
+make install-modules modules="modules/%JABBER_MODULES" \
120
+		basedir=$RPM_BUILD_ROOT \
121
+		prefix=/usr \
122
+%ifarch x86_64
123
+		modules-dir=/lib64/ser/modules/ \
124
+%endif
125
+		cfg-prefix=$RPM_BUILD_ROOT \
126
+		cfg-target=/%{_sysconfdir}/ser/ \
127
+		doc-prefix=$RPM_BUILD_ROOT \
128
+		doc-dir=/%{_docdir}/ser/
129
+make install-modules modules="%RADIUS_MOD_PATH" \
130
+		basedir=$RPM_BUILD_ROOT \
131
+		prefix=/usr \
132
+%ifarch x86_64
133
+		modules-dir=/lib64/ser/modules/ \
134
+%endif
135
+		cfg-prefix=$RPM_BUILD_ROOT \
136
+		cfg-target=/%{_sysconfdir}/ser/ \
137
+		doc-prefix=$RPM_BUILD_ROOT \
138
+		doc-dir=/%{_docdir}/ser/
139
+make install-doc modules="modules/%JABBER_MODULES %RADIUS_MOD_PATH" \
140
+		basedir=$RPM_BUILD_ROOT \
141
+		prefix=/usr \
142
+%ifarch x86_64
143
+		modules-dir=/lib64/ser/modules/ \
144
+%endif
145
+		doc-prefix=$RPM_BUILD_ROOT \
146
+		doc-dir=/%{_docdir}/ser/
147
+
148
+
149
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/init.d
150
+install -m755 $RPM_SOURCE_DIR/ser.init.SuSE \
151
+              $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/ser
152
+ln -sf ../../etc/init.d/ser $RPM_BUILD_ROOT/usr/sbin/rcser
153
+
154
+%clean
155
+rm -rf "$RPM_BUILD_ROOT"
156
+
157
+%post
158
+sbin/insserv etc/init.d/ser
159
+
160
+%preun
161
+if [ $1 = 0 ]; then
162
+    etc/init.d/ser stop > /dev/null 2>&1
163
+fi
164
+
165
+%postun
166
+sbin/insserv etc/init.d/
167
+
168
+%files
169
+%defattr(-,root,root)
170
+%dir %{_docdir}/ser
171
+%doc %{_docdir}/ser/*
172
+
173
+%dir %{_sysconfdir}/ser
174
+%config(noreplace) %{_sysconfdir}/ser/*
175
+%config %{_sysconfdir}/init.d/*
176
+
177
+#%ifarch x86_64
178
+#%else
179
+%dir %{_libdir}/ser
180
+%dir %{_libdir}/ser/modules
181
+%{_libdir}/ser/modules/acc.so
182
+%{_libdir}/ser/modules/auth.so
183
+%{_libdir}/ser/modules/auth_db.so
184
+%{_libdir}/ser/modules/auth_diameter.so
185
+%{_libdir}/ser/modules/dbtext.so
186
+%{_libdir}/ser/modules/domain.so
187
+%{_libdir}/ser/modules/enum.so
188
+%{_libdir}/ser/modules/exec.so
189
+%{_libdir}/ser/modules/group.so
190
+%{_libdir}/ser/modules/mangler.so
191
+%{_libdir}/ser/modules/maxfwd.so
192
+%{_libdir}/ser/modules/mediaproxy.so
193
+%{_libdir}/ser/modules/msilo.so
194
+%{_libdir}/ser/modules/nathelper.so
195
+%{_libdir}/ser/modules/pdt.so
196
+%{_libdir}/ser/modules/permissions.so
197
+%{_libdir}/ser/modules/pike.so
198
+%{_libdir}/ser/modules/print.so
199
+%{_libdir}/ser/modules/registrar.so
200
+%{_libdir}/ser/modules/rr.so
201
+%{_libdir}/ser/modules/sl.so
202
+%{_libdir}/ser/modules/sms.so
203
+%{_libdir}/ser/modules/textops.so
204
+%{_libdir}/ser/modules/tm.so
205
+%{_libdir}/ser/modules/uri.so
206
+%{_libdir}/ser/modules/usrloc.so
207
+%{_libdir}/ser/modules/xlog.so
208
+
209
+%{_libdir}/ser/modules/avp.so
210
+%{_libdir}/ser/modules/avp_db.so
211
+%{_libdir}/ser/modules/avpops.so
212
+%{_libdir}/ser/modules/dispatcher.so
213
+%{_libdir}/ser/modules/diversion.so
214
+%{_libdir}/ser/modules/flatstore.so
215
+%{_libdir}/ser/modules/gflags.so
216
+%{_libdir}/ser/modules/options.so
217
+%{_libdir}/ser/modules/speeddial.so
218
+%{_libdir}/ser/modules/uri_db.so
219
+#%endif
220
+%{_sbindir}/ser
221
+%{_sbindir}/serctl
222
+%{_sbindir}/serunix
223
+%{_sbindir}/gen_ha1
224
+/usr/sbin/rcser
225
+
226
+%{_mandir}/man5/*
227
+%{_mandir}/man8/*
228
+
229
+
230
+%files mysql
231
+%defattr(-,root,root)
232
+
233
+#%ifarch x86_64
234
+#%else
235
+%{_libdir}/ser/modules/mysql.so
236
+#%endif
237
+%{_sbindir}/ser_mysql.sh
238
+
239
+%files jabber
240
+%defattr(-,root,root)
241
+#%ifarch x86_64
242
+#%else
243
+%{_libdir}/ser/modules/jabber.so
244
+#%endif
245
+%doc %{_docdir}/ser/README.jabber
246
+
247
+%files radius
248
+%defattr(-,root,root)
249
+#%{_libdir}/ser/modules/auth_radius.so
250
+#%{_libdir}/ser/modules/group_radius.so
251
+#%{_libdir}/ser/modules/uri_radius.so
252
+%doc %{_docdir}/ser/README.auth_radius
253
+%doc %{_docdir}/ser/README.group_radius
254
+%doc %{_docdir}/ser/README.uri_radius
255
+
256
+
257
+
258
+
259
+%changelog
260
+
261
+* Tue Jul 26 2005 Peter Nixon - Suntel Communications <peter+rpmspam@suntel.com.tr>
262
+- include SUSE version in the rpm filename(s)
263
+- changed version to 0.9.3 (new upstream release)
264
+- update rpm package group to match SUSE 9.3
265
+- removed files no longer in tarball
266
+- enabled radius modules
267
+- add symlink for rcser
268
+
269
+* Tue Jul 27 2004 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.fraunhofer.de>
270
+- changed vesion to 0.8.14 (new upstream release)
271
+- added ext to the modules list, removed the radius modules (they depend on radiusclient-ng now)
272
+
273
+* Fri Nov 14 2003 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.fraunhofer.de>
274
+- changed vesion to 0.8.12 (new upstream release)
275
+- added auth_diameter, pdt & mangler to the modules list
276
+
277
+* Wed Aug 28 2003 Nils Ohlmeier <nils@iptel.org>
278
+- replaced modules Conflicts with required Ser version
279
+- fixed doc installation for SuSE pathes
280
+- added doc for jabber and radius
281
+
282
+* Wed Aug 28 2003 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.fraunhofer.de>
283
+- added doc (READMEs, NEWS, AUTHORS a.s.o)
284
+- added xlog to the modules list
285
+
286
+* Wed Aug 27 2003 Nils Ohlmeier <nils@iptel.org>
287
+- fixed module dependencys
288
+- added Conflicts for modules
289
+
290
+* Wed Aug 27 2003 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.fraunhofer.de>
291
+- changed vesion to 0.8.11
292
+- gen_ha1 is now left in _sbindir
293
+- removed harv_ser.sh
294
+- added Conflicts
295
+
296
+* Mon Jun 2 2003 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.fraunhofer.de>
297
+- added a separate rpm for the radius modules
298
+- updated to the new makefile variables (removed lots of unnecessary stuff)
299
+
300
+* Tue Nov 12 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
301
+- replaced expat-devel with expat
302
+- removed leading + from a few lines
303
+
304
+* Tue Nov 12 2002 Andrei Pelinescu - Onciul <pelinescu-onciul@fokus.gmd.de>
305
+- added a separate rpm for the jabber modules
306
+- moved all the binaries to sbin
307
+- removed obsolete installs (make install installs everything now)
308
+
309
+* Mon Oct 28 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
310
+- Added mysql and mysql-devel to the Req for the ser-mysql rpm.
311
+
312
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
313
+- Added library path to mysql/Makefile to build on SuSE 8.0
314
+
315
+* Thu Sep 26 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
316
+- Added 'make [modules|modules-install]' to adapted Makefile changes
317
+
318
+* Wed Sep 25 2002 Andrei Pelinescu - Onciul  <pelinescu-onciul@fokus.gmd.de>
319
+- modified make install & make: added cfg-target & modules-target
320
+
321
+* Wed Sep 25 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
322
+- Copyed mysql connectivity subpackage from orig rpm.spec.
323
+
324
+* Fri Sep 06 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
325
+- Adaptation to SuSE.
326
+
327
+* Mon Sep 02 2002 Jan Janak <J.Janak@sh.cvut.cz>
328
+- gen_ha1 utility added, scripts added.
329
+
330
+* Tue Aug 28 2002 Jan Janak <J.Janak@sh.cvut.cz>
331
+- Finished the first version of the spec file.
332
+
333
+* Sun Aug 12 2002 Jan Janak <J.Janak@sh.cvut.cz>
334
+- First version of the spec file.
0 335
similarity index 100%
1 336
rename from pkg/rpm/ser.init.SuSE
2 337
rename to pkg/suse/ser.init
3 338
similarity index 100%
4 339
rename from pkg/rpm/ser.spec.SuSE
5 340
rename to pkg/suse/ser.spec