Split init files into redhat ne and suse one (both need a bit of more care)

SPlit packages into language dependant ones


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6458 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michal Bielicki 2007-12-01 17:24:45 +00:00
parent d3423ffbda
commit c6e5d6f84e
3 changed files with 195 additions and 26 deletions

View File

@ -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

View File

@ -107,6 +107,37 @@ Requires: %{name} = %{version}-%{release}
%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 @@ mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
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 @@ rm -rf $RPM_BUILD_ROOT
%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 @@ rm -rf $RPM_BUILD_ROOT
%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 @@ rm -rf $RPM_BUILD_ROOT
/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 @@ rm -rf $RPM_BUILD_ROOT
/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@voiceworks.pl
- Added ifdefs for susealities
@ -332,6 +404,8 @@ rm -rf $RPM_BUILD_ROOT
- 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@suntel.com.tr
- Added a debug package
- Split the passthrough codecs into separate packages