debian package files adapted from ser's

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@685 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent b5fe53201a
commit d011b8571a

6
debian/changelog vendored

@ -0,0 +1,6 @@
sems (1.1.0-1) unstable; urgency=low
* Initial Debian Release.
-- Stefan Sayer <sayer@iptel.org> Thu Feb 7 00:35:27 CET 2008

1
debian/compat vendored

@ -0,0 +1 @@
4

26
debian/control vendored

@ -0,0 +1,26 @@
Source: sems
Section: net
Priority: optional
Maintainer: Stefan Sayer <sayer@iptel.org>
Build-Depends: debhelper (>= 4), libspeex-dev, flite-dev
Standards-Version: 3.5.2
Package: sems
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: sems-python-modules
Conflicts: sems-python-modules (<< ${Source-Version})
Description: SIP Express Media Server, very fast and flexible SIP media server
SEMS, the SIP Express Media Server, is a free, high performance, extensible media
server for SIP (RFC3261) based VoIP services. It features voicemail, conferencing,
announcements, pre-call announcements, prepaid service, calling card service etc.
Package: sems-python-modules
Architecture: any
Depends: ${shlibs:Depends}, sems (= ${Source-Version})
Description: contains the python modules for SEMS
This has been split out of the main SEMS package, so that SEMS will not
depend upon python. This module will enable you to use the applications using the embedded
python interpreter and script new applications in python.

19
debian/copyright vendored

@ -0,0 +1,19 @@
This package was debianized by Stefan Sayer
<sayer@iptel.org> on Wed Feb 6 20:46:22 CET 2008.
All debian stuff was stolen and adapted from SER
(http://iptel.org/ser).
It was downloaded from http://iptel.org/sems.
Upstream Authors: Raphael Coeffic <raphael.coeffic@tekelec.com>,
Stefan Sayer <stefan.sayer@iptego.com>, Juha Heinanen, Maxim
Sobolev, Andreas Granig (see AUTHORS file for details)
This software is copyright (c) 2002-2005 by FhG Fokus
You are free to distribute this software under the terms of
the GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in the file `/usr/share/common-licenses/GPL.

2
debian/files vendored

@ -0,0 +1,2 @@
sems_0.8.7.6-1_i386.deb net optional
sems-python-modules_0.8.7.6-1_i386.deb net optional

175
debian/postinst vendored

@ -0,0 +1,175 @@
#!/bin/sh
set -e
# don't do anything when called with other argument than configure
case "$1" in
configure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument \$1'" >&2
exit 1
;;
esac
. /usr/share/debconf/confmodule
# add sems user
adduser --quiet --system --group --disabled-password --shell /bin/false \
--gecos "SIP Express Media Server" --home /var/run/sems sems || true
if [ -d /usr/doc -a ! -e /usr/doc/sems -a -d /usr/share/doc/sems ]; then
ln -sf ../share/doc/sems /usr/doc/sems
fi
# ser defaults file, which will be modified by this script
DEFAULTFILE=/etc/default/sems
if ! test -e $DEFAULTFILE; then
echo "Warning: sems postinst script can't find config file $DEFAULTFILE. Configuration aborted."
exit 0
fi
# ----------------------------------------------------------------------
function fn_config_replace
{
if test $# -ne 2; then
echo "Error - bad number of input parameters"
echo "usage:"
echo "fn_config_replace config_file CFG_OPTION_something"
exit 1
fi
FILENAME="$1"
ITEM="$2"
echo "Changing config option $ITEM."
OLDFILE="$FILENAME.config_replace_bck"
cp -f $FILENAME $OLDFILE
REPLACEMENT="$FILENAME.repl"
TEMPFILE="$FILENAME.temp"
TAIL="$FILENAME.tail"
rm -f $REPLACEMENT
touch $REPLACEMENT # needed if the input is empty
while read -r LINE
do
echo "$LINE" >> $REPLACEMENT
done
STARTPOS=`nl -b a $FILENAME | grep -w "DEBCONF-$ITEM-START" | sed -e "s/^ *\([0-9]*\).*/\1/g"`
if [ "$STARTPOS" == "" ]; then
echo "WARNING: section $ITEM not found"
return
fi
ENDPOS=`nl -b a $FILENAME | sed -e "1,${STARTPOS}d" | grep "DEBCONF-$ITEM-END" | head -n 1 | sed -e "s/^ *\([0-9]*\).*/\1/g"`
if [ "$STARTPOS" == "" ]; then
echo "WARNING: end of section $ITEM not found"
return
fi
ENDPOS=$(($ENDPOS-1))
STARTPOS=$(($STARTPOS+1))
cat $FILENAME | sed -e "1,${ENDPOS}d" > $TAIL
cat $FILENAME | sed -e "${STARTPOS},\$d" > $TEMPFILE
cat $REPLACEMENT >> $TEMPFILE
cat $TAIL >> $TEMPFILE
rm -f $TAIL
mv -f $TEMPFILE $FILENAME
}
# pads $1 with as many empty rows as needed until $2 lines are complete
padLines() {
output="$1"
needed="$2"
num=`echo "$output" | wc -l`
echo "$output"
moreneeded=$(($needed-$num))
while (true); do
if [ $moreneeded -gt 0 ]
then
echo ""
moreneeded=$(($moreneeded-1))
else
break
fi
done
}
#----------------------------------------------------------------------------
db_get sems/config
if [ "$RET" = "false" ] ; then
# do not change config file
echo "Package sems postinstall script: NOT modifying config file $DEFAULTFILE."
else
BACKUP="$DEFAULTFILE.config_bck"
echo "Package sems postinstall script: MODIFYING config file $DEFAULTFILE."
echo "Creating backup copy as $BACKUP"
cp -f $DEFAULTFILE $BACKUP
db_get sems/USER
if test "$RET" != "!" ; then
fn_config_replace $DEFAULTFILE USER <<+++
SEMS_USER="$RET"
+++
fi
db_get sems/GROUP
if test "$RET" != "!" ; then
fn_config_replace $DEFAULTFILE GROUP <<+++
SEMS_GROUP="$RET"
+++
fi
#db_get sems/WORKDIR
#if test "$RET" != "!" ; then
# fn_config_replace $DEFAULTFILE WORKDIR <<+++
#SEMS_WORKDIR="$RET"
#+++
#fi
db_get sems/KERNEL_CORE_PID
if test "$RET" != "!" ; then
fn_config_replace $DEFAULTFILE KERNEL_CORE_PID <<+++
SEMS_KERNEL_CORE_PID="$RET"
+++
fi
fi # if changing config
echo ""
echo "***"
echo "Configuration of sems has finished."
echo ""
echo "To restart it when configuration has changed use '/etc/init.d/sems restart'"
echo ""
echo "To change it's configuration use 'dpkg-reconfigure sems'"
echo "***"
echo ""
echo "Setting sems to start automatically"
/usr/sbin/update-rc.d sems defaults || true
if [ -x "/etc/init.d/sems" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d sems restart || exit 0
else
/etc/init.d/sems restart || exit 0
fi
fi
exit 0

13
debian/postrm vendored

@ -0,0 +1,13 @@
#!/bin/sh
#DEBHELPER#
if [ "$1" = "purge" ] ; then
# remove user/group on purge
deluser --quiet --remove-home sems &>/dev/null || true
# remove /etc/ser if empty
rmdir /etc/sems || true
fi
exit 0

149
debian/rules vendored

@ -0,0 +1,149 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# $Id: rules,v 1.7 2007/12/20 14:21:19 paka Exp $
#
# History:
# --------
# 2008-02-06 stolen from SER and adapted for SEMS (stefan)
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
# export DH_COMPAT=4
# -- already set in compat
# force no striping (always include debug symbols for now)
export DEB_BUILD_OPTIONS:="$(DEB_BUILD_OPTIONS) nostrip"
PYTHON_MODULES=ivr py_sems conf_auth mailbox pin_collect
EXCLUDED_MODULES=mp3 examples
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE) cfg-target=/etc/sems/ prefix=/usr
#/usr/bin/docbook-to-man debian/ser.sgml > ser.1
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/sems
$(MAKE) -C core/ install \
basedir=$(CURDIR)/debian/sems \
prefix=/usr \
cfg-prefix=$(CURDIR)/debian/sems \
cfg-target=/etc/sems/
$(MAKE) -C apps/ install exclude_modules="$(EXCLUDED_MODULES) $(PYTHON_MODULES)" \
basedir=$(CURDIR)/debian/sems \
prefix=/usr \
cfg-prefix=$(CURDIR)/debian/sems \
cfg-target=/etc/sems/
# fix etc/ser dir location
# mv -f $(CURDIR)/debian/ser/usr/etc $(CURDIR)/debian/ser
# install only the python modules
$(MAKE) -C apps/ install modules="$(PYTHON_MODULES)" \
basedir=$(CURDIR)/debian/sems-python-modules \
prefix=/usr \
cfg-prefix=$(CURDIR)/debian/sems-python-modules \
cfg-target=/etc/sems/
# install /etc/default/sems file
mkdir -p $(CURDIR)/debian/sems/etc/default
cp -f debian/sems.default $(CURDIR)/debian/sems/etc/default/sems
#dh_movefiles
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common:
dh_testdir
dh_testroot
dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
dh_installinit -- defaults 23
dh_installcron
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-independent packages using the common target
binary-indep: build install
# (Uncomment this next line if you have such packages.)
# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# We have nothing to do by default.
# Build architecture-dependent packages using the common target
binary-arch: build install
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
# Any other binary targets build just one binary package at a time.
binary-%: build install
$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

@ -0,0 +1 @@
shlibs:Depends=libc6 (>= 2.3.2.ds1-21), libflite1, libgcc1 (>= 1:3.4.1-3), python2.3 (>= 2.3)

29
debian/sems.config vendored

@ -0,0 +1,29 @@
#!/bin/sh -e
. /usr/share/debconf/confmodule
# configure ?
db_input medium sems/config || true
db_go
db_get sems/config
if [ "$RET" = "false" ]; then
exit 0
fi
db_input medium sems/USER || true
db_go
db_input medium sems/GROUP || true
db_go
#db_input medium sems/WORKDIR || true
#db_go
db_input medium sems/KERNEL_CORE_PID || true
db_go
db_input medium sems/MEMORY || true
db_go

@ -0,0 +1,39 @@
# configuration for SEMS - SIP Express Media Server
#
# this file is sourced by SEMS init script /etc/init.d/sems
# Note: the #DEBCONF-xxx-START and DEBCONF-xxx-END lines are used for
# debconf configuration, please don't remove or alter them.
# ser configuration file
#DEBCONF-CFG_FILE-START
SEMS_CFG_FILE="/etc/sems/sems.conf"
#DEBCONF-CFG_FILE-END
# user to run ser as
#DEBCONF-USER-START
SEMS_USER="sems"
#DEBCONF-USER-END
# group to run ser as
#DEBCONF-GROUP-START
SEMS_GROUP="sems"
#DEBCONF-GROUP-END
# ser pidfile
SEMS_PIDFILE="/var/run/sems/sems.pid"
# working dir (cores will be placed there in case of sems crash)
#DEBCONF-WORKDIR-START
#SEMS_WORKDIR="/var/cores"
#DEBCONF-WORKDIR-END
# set if you want kernel flag to use pid for core files
#DEBCONF-KERNEL_CORE_PID-START
#SEMS_KERNEL_CORE_PID="yes"
#DEBCONF-KERNEL_CORE_PID-END

122
debian/sems.init vendored

@ -0,0 +1,122 @@
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
#
# adapted for ser by Andrei Pelinescu-Onciul <pelinescu-onciul@fokus.gmd.de>
# $Id: ser.init,v 1.3 2007/11/05 15:33:12 paka Exp $
# read configuration from /etc/default/sems file
if test -f /etc/default/sems ; then
. /etc/default/sems
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/sems
NAME=sems
DESC=sems
PARAMS=""
if test "$SEMS_PIDFILE" ; then
PARAMS="$PARAMS -P $SEMS_PIDFILE"
fi
if test "$SEMS_USER" ; then
PARAMS="$PARAMS -u $SEMS_USER"
fi
if test "$SEMS_GROUP" ; then
PARAMS="$PARAMS -g $SEMS_GROUP"
fi
if test "$SEMS_CFG_FILE" ; then
PARAMS="$PARAMS -f $SEMS_CFG_FILE"
CFGPARAMS="-f $SEMS_CFG_FILE"
fi
#if test "$SEMS_WORKDIR" ; then
# PARAMS="$PARAMS -w $SEMS_WORKDIR"
# # try to create the working dir
# mkdir -p $SEMS_WORKDIR || echo "Warning: error creating SEMS working dir $SEMS_WORKDIR"
#fi
if test "$SEMS_KERNEL_CORE_PID" = "true" ; then
# enable using pid for cores
echo 1 > /proc/sys/kernel/core_uses_pid || echo "Warning: error when enabling /proc/sys/kernel/core_uses_pid"
fi
if ! test -f $DAEMON ; then
echo "Error: cannot find $DAEMON"
exit 0
fi
LD_LIBRARY_PATH=/usr/lib/sems
export LD_LIBRARY_PATH
set -e
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $SEMS_PIDFILE \
--exec $DAEMON -- $PARAMS
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $SEMS_PIDFILE \
--exec $DAEMON
echo "."
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# $SEMS_PIDFILE --exec $DAEMON
#;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
# Check if configuration is valid before restarting the server
#(($DAEMON $CFGPARAMS -c 2>&1) | grep "config file ok, exiting") > /dev/null
#if [ $? -ne 0 ]; then
# ($DAEMON $CFGPARAMS -c 2>&1)
# echo -e "\nThere are errors in the configuration file. Please fix them first"
# echo -e "\n$out\n"
# exit 0
#fi
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile \
$SEMS_PIDFILE --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
$SEMS_PIDFILE --exec $DAEMON -- $PARAMS
echo "."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

@ -0,0 +1,2 @@
misc:Depends=debconf (>= 0.5) | debconf-2.0
shlibs:Depends=libc6 (>= 2.3.2.ds1-21), libgcc1 (>= 1:3.4.1-3), libspeex1, libstdc++6 (>= 3.4.3-1)

@ -0,0 +1,41 @@
Template: sems/config
Type: boolean
Default: false
Description: Change config file now ?
You have now opportunity to modify basic configuration values in '/etc/default/sems'
config file for SEMS Sip Express Media Server, installed from 'sems' package. Settings from this
file are used by SEMS init script when it is started - e.g. size of shared memory used,
usems and group to run as, working directory.
.
If you do not want to modify the config file now you can modify it manually later,
or repeat this configuartion by running "dpkg-reconfigure sems".
.
Note: if you choose 'yes' here then the values you enter will be automatically applied
each time the sems package is upgraded (or installed without purging previous installation).
Template: sems/USER
Type: string
Default: sems
Description: User to run SEMS as
Set the user which SEMS should run as. Default is 'sems' user.
.
Note: if you want sems to be able to dump a core file in case of crash, you have to run it as root user.
.
Enter "!" to not modify this option.
Template: sems/GROUP
Type: string
Default: sems
Description: Group to run SEMS as
Set the group which SEMS should run as. Default is 'sems' group.
.
Enter "!" to not modify this option.
Template: sems/KERNEL_CORE_PID
Type: boolean
Default: false
Description: Set kernel to use pid for core files
If enabled the '/proc/sys/kernel/core_uses_pid' will be set to '1' before starting SEMS,
to enable using of pid for core files creation. If disabled nothing will be set.
For debugging purposes it is recommended to enable this option.

7
debian/watch vendored

@ -0,0 +1,7 @@
# Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
version=2
# Site Directory Pattern Version Script
ftp://ftp.berlios.de/pub/sems/latest/src/sems-(.*)_src\.tar\.gz debian uupdate
Loading…
Cancel
Save