[Freeswitch-svn] [commit] r6458 - in freeswitch/trunk: . build

Freeswitch SVN cypromis at freeswitch.org
Sat Dec 1 12:24:46 EST 2007


Author: cypromis
Date: Sat Dec  1 12:24:45 2007
New Revision: 6458

Added:
   freeswitch/trunk/build/freeswitch.init.redhat
   freeswitch/trunk/build/freeswitch.init.suse
      - copied unchanged from r6449, /freeswitch/trunk/build/freeswitch.init
Removed:
   freeswitch/trunk/build/freeswitch.init
Modified:
   freeswitch/trunk/freeswitch.spec

Log:
Split init files into redhat ne and suse one (both need a bit of more care)
SPlit packages into language dependant ones


Added: freeswitch/trunk/build/freeswitch.init.redhat
==============================================================================
--- (empty file)
+++ freeswitch/trunk/build/freeswitch.init.redhat	Sat Dec  1 12:24:45 2007
@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+#       /etc/rc.d/init.d/freeswitch
+#
+#       The FreeSwitch Open Source Voice Platform
+#
+#  chkconfig: - 89 14
+#  processname: freeswitch
+#  config: /opt/freeswitch/conf/freeswitch.conf
+#  pidfile: /opt/freeswitch/log/freeswitch/pid
+#
+
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source options file
+if [ -f /etc/sysconfig/freeswitch ]; then
+	. /etc/sysconfig/freeswitch
+fi
+
+prog=freeswitch
+pidfile=/opt/freeswitch/log/freeswitch.pid
+FS_USER=freeswitch
+lockfile=/var/lock/subsys/freeswitch
+RETVAL=0
+
+# <define any local shell functions used by the code that follows>
+
+start() {
+        echo -n "Starting $prog: "
+        if [ -e $lockfile ]; then
+            if [ -e $pidfile && [ -e /proc/`$pidfile` ]; then
+                echo -n $"cannot start freeswitch: freeswitch is already running.";
+                failure $"cannot start freeswitch: freeswitch already running.";
+                echo
+                return 1
+            fi
+        fi
+
+        daemon --user $FS_USER --pidfile $pidfile $prog $FREESWITCH_ARGS
+	RETVAL=$?
+        [ $RETVAL -eq 0 ] && touch $lockfile;
+        return $RETVAL
+}
+
+stop() {
+        echo -n "Shutting down $prog: "
+        if [ ! -e $lockfile ]; then
+            echo -n $"cannot stop $prog: $prog is not running."
+            failure $"cannot stop $prog: $prog is not running."
+            echo
+            return 1;
+        fi
+	/opt/freeswitch/bin/freeswitch -stop
+        killproc freeswitch
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] &&  rm -f $lockfile;
+        return $RETVAL
+}
+
+rhstatus() {
+	status $prog;
+}
+
+case "$1" in
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    status)
+        status $prog
+	RETVAL=$?
+        ;;
+    restart)
+        stop
+        start
+        ;;
+    reload)
+#        <cause the service configuration to be reread, either with
+#        kill -HUP or by restarting the daemons, in a manner similar
+#        to restart above>
+        ;;
+    condrestart)
+        [ -f $pidfile ] && restart || :
+	;;
+    *)
+        echo "Usage: $prog {start|stop|status|reload|restart"
+        exit 1
+        ;;
+esac
+exit $RETVAL

Modified: freeswitch/trunk/freeswitch.spec
==============================================================================
--- freeswitch/trunk/freeswitch.spec	(original)
+++ freeswitch/trunk/freeswitch.spec	Sat Dec  1 12:24:45 2007
@@ -107,6 +107,37 @@
 
 %description spidermonkey
 
+%package lang-en
+Summary:	Provides english language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+%package lang-it
+Summary:        Provides italian language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+%package lang-es
+Summary:        Provides spanish language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+%package lang-de
+Summary:        Provides german language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+%package lang-nl
+Summary:        Provides dutch language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+%package lang-fr
+Summary:        Provides french language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Group:          System/Libraries
+Requires:        %{name} = %{version}-%{release}
+
+
 %prep
 %setup -q
 
@@ -173,11 +204,19 @@
 cp build/freeswitch.ld.so.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d/
 
 # Install init files
-install -D -m 744 build/freeswitch.init $RPM_BUILD_ROOT/etc/init.d/freeswitch
+# On SuSE:
+%if 0%{suse_version} > 100
+install -D -m 744 build/freeswitch.init.suse $RPM_BUILD_ROOT/etc/init.d/freeswitch
+%else
+# On RedHat like
+install -D -m 744 build/freeswitch.init.redhat $RPM_BUILD_ROOT/etc/init.d/freeswitch
+%endif
 
-# Make /usr/sbin/rcfreeswitch a link to /etc/init,d/freeswitch
+# On SuSE make /usr/sbin/rcfreeswitch a link to /etc/init.d/freeswitch
+%if 0%{suse_version} > 100
 mkdir -p $RPM_BUILD_ROOT/usr/sbin
 ln -sf /etc/init.d/freeswitch $RPM_BUILD_ROOT/usr/sbin/rcfreeswitch
+%endif
 
 # Add the sysconfiguration file
 install -D -m 744 build/freeswitch.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/freeswitch
@@ -208,15 +247,6 @@
 %dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/dialplan
 %dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/directory
 %dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo
-%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm
 %dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/sip_profiles
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/mime.types
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/*.tpl
@@ -225,22 +255,15 @@
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/autoload_configs/*.xml
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/dialplan/*.xml
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/directory/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo/*.xml
-%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm/*.xml
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/sip_profiles/*.xml
 %config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/htdocs/*
 /etc/ld.so.conf.d/*
 /opt/freeswitch/bin/freeswitch
 /etc/init.d/freeswitch
 /etc/sysconfig/freeswitch
+%if 0%{suse_version} > 100
 /usr/sbin/rcfreeswitch
+%endif
 /opt/freeswitch/lib/libfreeswitch*.so*
 /opt/freeswitch/mod/mod_console.so*
 /opt/freeswitch/mod/mod_logfile.so*
@@ -282,12 +305,6 @@
 /opt/freeswitch/mod/mod_xml_rpc.so* 
 /opt/freeswitch/mod/mod_xml_curl.so* 
 /opt/freeswitch/mod/mod_xml_cdr.so* 
-/opt/freeswitch/mod/mod_say_en.so*
-/opt/freeswitch/mod/mod_say_fr.so*
-/opt/freeswitch/mod/mod_say_de.so*
-/opt/freeswitch/mod/mod_say_es.so*
-/opt/freeswitch/mod/mod_say_it.so*
-/opt/freeswitch/mod/mod_say_nl.so*
 
 %files codec-passthru-amr
 %defattr(-,freeswitch,daemon)
@@ -317,6 +334,61 @@
 /opt/freeswitch/mod/*.la
 /opt/freeswitch/include/*.h
 
+%files lang-en
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/en/vm/*.xml
+/opt/freeswitch/mod/mod_say_en.so*
+
+%files lang-it
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/it
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/it/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/it/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/it/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/it/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/it/vm/*.xml
+/opt/freeswitch/mod/mod_say_it.so*
+
+%files lang-es
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/es
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/es/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/es/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/es/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/es/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/es/vm/*.xml
+/opt/freeswitch/mod/mod_say_es.so*
+
+
+%files lang-de
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/de/vm/*.xml
+/opt/freeswitch/mod/mod_say_de.so*
+
+%files lang-nl
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/nl
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/nl/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/nl/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/nl/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/nl/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/nl/vm/*.xml
+/opt/freeswitch/mod/mod_say_nl.so*
+
+%files lang-fr
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo
+%dir %attr(750,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/demo/*.xml
+%config(noreplace) %attr(640,freeswitch,daemon) /opt/freeswitch/conf/lang/fr/vm/*.xml
+/opt/freeswitch/mod/mod_say_fr.so*
+
 %changelog
 * Thu Nov 29 2007 - michal.bielicki+rpmspam at voiceworks.pl
 - Added ifdefs for susealities
@@ -332,6 +404,8 @@
 - fixed locationof nspr and js libs
 - fixed odbc requirements
 - added all buildable modules
+- added redhat style init file
+- splitted off language dependant stuff into separate language files
 * Tue Apr 24 2007 - peter+rpmspam at suntel.com.tr
 - Added a debug package
 - Split the passthrough codecs into separate packages



More information about the Freeswitch-svn mailing list