Browse code

*** empty log message ***

Jan Janak authored on 28/08/2002 14:05:44
Showing 2 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,70 @@
1
+#!/bin/bash
2
+#
3
+# Startup script for SER
4
+#
5
+# chkconfig: 345 85 15
6
+# description: Ser is a fast SIP Proxy.
7
+#
8
+# processname: ser
9
+# pidfile: /var/run/ser.pid
10
+# config: /etc/ser/ser.cfg
11
+
12
+# Source function library.
13
+. /etc/rc.d/init.d/functions
14
+
15
+ser=/usr/sbin/ser
16
+prog=ser
17
+RETVAL=0
18
+
19
+start() {
20
+        echo -n $"Starting $prog: "
21
+        daemon $ser $OPTIONS
22
+        RETVAL=$?
23
+        echo
24
+        [ $RETVAL = 0 ] && touch /var/lock/subsys/ser
25
+        return $RETVAL
26
+}
27
+
28
+stop() {
29
+	echo -n $"Stopping $prog: "
30
+	killproc $ser
31
+	RETVAL=$?
32
+	echo
33
+	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/ser /var/run/ser.pid
34
+}
35
+
36
+reload() {
37
+	echo -n $"Reloading $prog: "
38
+	killproc $ser -HUP
39
+	RETVAL=$?
40
+	echo
41
+}
42
+
43
+# See how we were called.
44
+case "$1" in
45
+  start)
46
+	start
47
+	;;
48
+  stop)
49
+	stop
50
+	;;
51
+  status)
52
+        status $ser
53
+	RETVAL=$?
54
+	;;
55
+  restart)
56
+	stop
57
+	start
58
+	;;
59
+  condrestart)
60
+	if [ -f /var/run/ser.pid ] ; then
61
+		stop
62
+		start
63
+	fi
64
+	;;
65
+  *)
66
+	echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
67
+	exit 1
68
+esac
69
+
70
+exit $RETVAL
... ...
@@ -8,12 +8,13 @@ Version:      %ver
8 8
 Release:      %rel
9 9
 Packager:     Jan Janak <J.Janak@sh.cvut.cz>
10 10
 Copyright:    GPL
11
-Group:        Applications/Internet
11
+Group:        System Environment/Daemons
12 12
 Source:       ftp://ser.iptel.org/stable/%{name}-%{ver}.tar.gz
13
+Source2:      ser.init
13 14
 URL:          http://ser.iptel.org
14 15
 Vendor:       Fhg Fokus
15 16
 BuildRoot:    /var/tmp/%{name}-%{ver}-root
16
-BuildPrereq:  make flex bison rpm-devel >= 4 
17
+BuildPrereq:  make flex bison 
17 18
 
18 19
 
19 20
 %description
... ...
@@ -27,9 +28,6 @@ CPL scripts, Instant Messaging, MySQL support, Presence Agent, Radius
27 28
 Authentication, Record Routing, SMS Gateway, Jabber Gateway, Transaction 
28 29
 Module, Registrar and User Location.
29 30
 
30
-%changelog
31
-* Sun Aug 12 2002 Jan Janak <J.Janak@sh.cvut.cz>
32
-- First version of the spec file.
33 31
 
34 32
 %prep
35 33
 %setup
... ...
@@ -37,12 +35,58 @@ Module, Registrar and User Location.
37 35
 %build
38 36
 make all
39 37
 
40
-%configure
41
-
42 38
 %install
39
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
40
+
41
+make install cfg-prefix=$RPM_BUILD_ROOT/%{_sysconfdir} \
42
+             cfg-dir=ser/ \
43
+	     bin-prefix=$RPM_BUILD_ROOT/%{_sbindir} \
44
+	     bin-dir="" \
45
+	     modules-prefix=$RPM_BUILD_ROOT/%{_libdir}/ser \
46
+	     modules-dir=modules/ \
47
+	     doc-prefix=$RPM_BUILD_ROOT/%{_docdir} \
48
+	     doc-dir=ser/ \
49
+	     man-prefix=$RPM_BUILD_ROOT/%{_mandir} \
50
+	     man-dir=""
43 51
 
52
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
53
+install -m755 $RPM_SOURCE_DIR/ser.init \
54
+              $RPM_BUILD_ROOT/etc/rc.d/init.d/ser
44 55
 
45 56
 %clean
46
-rm -rf $RPM_BUILD_ROOT
57
+rm -rf "$RPM_BUILD_ROOT"
58
+
59
+%post
60
+/sbin/chkconfig --add ser
61
+
62
+%preun
63
+if [ $1 = 0 ]; then
64
+    /sbin/service ser stop > /dev/null 2>&1
65
+    /sbin/chkconfig --del ser
66
+fi
67
+
47 68
 
48 69
 %files
70
+%defattr(-,root,root)
71
+%doc README
72
+
73
+%dir %{_sysconfdir}/ser
74
+%config(noreplace) %{_sysconfdir}/ser/*
75
+%config %{_sysconfdir}/rc.d/init.d/*
76
+
77
+%dir %{_libdir}/ser
78
+%dir %{_libdir}/ser/modules
79
+%{_libdir}/ser/modules/*
80
+
81
+%{_sbindir}/*
82
+
83
+%{_mandir}/man5/*
84
+%{_mandir}/man8/*
85
+
86
+
87
+%changelog
88
+* Tue Aug 28 2002 Jan Janak <J.Janak@sh.cvut.cz>
89
+- Finished the first version of the spec file.
90
+
91
+* Sun Aug 12 2002 Jan Janak <J.Janak@sh.cvut.cz>
92
+- First version of the spec file.