Skip to content

Commit

Permalink
Merge branch 'BeIP-debian-jessie'
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Sep 4, 2015
2 parents 086fe7c + cda3986 commit 65bfc1a
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 37 deletions.
13 changes: 12 additions & 1 deletion packaging/debian/changelog
@@ -1,4 +1,15 @@
opensips (2.0.0-1) unstable; urgency=low
opensips (2.1.0-2) stable; urgency=low

* Modify init script to use LSB functions.
* Update dependencies for Jessie.
* Remove mysql-client dependency on opensips-modules-mysql.
* Add systemd unit file.
* Add new package opensips-rest-module

-- Steve Frécinaux <sfrecinaux@beip.be> Wed, 29 Jul 2015 14:57:06 +0200


opensips (2.1.0) stable; urgency=low

* Major Public Release.

Expand Down
17 changes: 13 additions & 4 deletions packaging/debian/control
Expand Up @@ -4,6 +4,7 @@ Priority: optional
Maintainer: Razvan Crainea <razvan@opensips.org>
Build-Depends: bison,
debhelper (>= 9),
dh-systemd (>= 1.5),
dh-python,
dpkg-dev (>= 1.16.1.1),
flex,
Expand Down Expand Up @@ -66,6 +67,7 @@ Suggests: opensips-b2bua-module,
opensips-radius-modules,
opensips-redis-module,
opensips-regex-module,
opensips-restclient-module,
opensips-sctp-module,
opensips-snmpstats-module,
opensips-tls-module,
Expand Down Expand Up @@ -105,10 +107,7 @@ Description: very fast and configurable SIP server [debug symbols]

Package: opensips-mysql-module
Architecture: any
Depends: mysql-client,
opensips (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Depends: ${shlibs:Depends}, opensips (= ${binary:Version})
Description: MySQL database connectivity module for OpenSIPS
OpenSIPS is a very fast and flexible SIP (RFC3261)
server. Written entirely in C, OpenSIPS can handle thousands calls
Expand Down Expand Up @@ -459,6 +458,16 @@ Description: Emerrgency call module for OpenSIPS
the architecture i2 specification of the american entity NENA. (National
Emergency Number Association).

Package: opensips-rest-module
Architecture: any
Depends: ${shlibs:Depends}, opensips (= ${binary:Version}), libcurl3-gnutls
Description: HTTP REST client for OpenSIPS.
OpenSIPS is a very fast and flexible SIP (RFC3261)
server. Written entirely in C, OpenSIPS can handle thousands calls
per second even on low-budget hardware.
.
This package provides an HTTP REST client for OpenSIPS.

Package: opensips-tls-module
Architecture: any
Depends: libssl-dev,
Expand Down
54 changes: 22 additions & 32 deletions packaging/debian/opensips.init
Expand Up @@ -15,6 +15,8 @@
# Should-Start: postgresql mysql radius
# Should-Stop: postgresql mysql radius

set -e

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/opensips
NAME=opensips
Expand All @@ -29,6 +31,17 @@ RUN_OPENSIPS=no


[-e "/lib/lsb/init-functions" ] && . /lib/lsb/init-functions
test -f $DAEMON || exit 0

# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi

if [ "$RUN_OPENSIPS" != "yes" ]; then
echo "OpenSIPS not yet configured. Edit /etc/default/opensips first."
exit 0
fi

# Do not start opensips if fork=no is set in the config file
# otherwise the boot process will just stop
Expand Down Expand Up @@ -77,19 +90,6 @@ create_radius_seqfile ()
fi
}

test -f $DAEMON || exit 0

# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi

if [ "$RUN_OPENSIPS" != "yes" ]; then
echo "OpenSIPS not yet configured. Edit /etc/default/opensips first."
exit 0
fi

set -e

S_MEMORY=$((`echo $S_MEMORY | sed -e 's/[^0-9]//g'`))
P_MEMORY=$((`echo $P_MEMORY | sed -e 's/[^0-9]//g'`))
Expand Down Expand Up @@ -120,7 +120,7 @@ case "$1" in
check_fork
fi

# dirs under /var/run can go away on reboots.
# dirs under /var/run will go away on reboot.
mkdir -p "$HOMEDIR"
chmod 775 "$HOMEDIR"
chown "$USER:$GROUP" "$HOMEDIR" >/dev/null 2>&1 || true
Expand All @@ -142,47 +142,37 @@ case "$1" in
mv "$CFGFILE" "$M4ARCHIVEDIR/$NAME.cfg-`date +%Y%m%d_%H%M%S`"
fi


mv "$CFGFILE.tmp" "$CFGFILE"
chown $USER:$GROUP $CFGFILE
chmod 640 $CFGFILE
fi

echo -n "Starting $DESC: $NAME"
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || echo -n " already running"
echo "."
log_end_msg $?
;;
stop)
echo -n "Stopping $DESC: $NAME"
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
echo "."
log_end_msg $?
;;
restart|force-reload)
check_opensips_config
create_radius_seqfile

echo -n "Restarting $DESC: $NAME"
log_daemon_msg "Restarting $DESC" "$NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile \
$PIDFILE --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
$PIDFILE --exec $DAEMON -- $OPTIONS
echo "."
log_end_msg $?
;;
status)
echo -n "Status of $DESC: "
if [ ! -r "$PIDFILE" ]; then
echo "$NAME is not running."
exit 3
fi
if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
echo "$NAME is running."
exit 0
else
echo "$NAME is not running but $PIDFILE exists."
exit 1
fi
status_of_proc -p $PIDFILE "$DAEMON" "$NAME"
;;
*)
N=/etc/init.d/$NAME
Expand Down
19 changes: 19 additions & 0 deletions packaging/debian/opensips.service
@@ -0,0 +1,19 @@
[Unit]
Description=OpenSIPS SIP Server
After=network.target mysqld.service postgresql.service rtpproxy.service

[Service]
Type=forking
User=opensips
Group=opensips
Environment=P_MEMORY=32 S_MEMORY=32
EnvironmentFile=-/etc/default/opensips
PIDFile=/var/run/opensips/opensips.pid
ExecStart=/usr/sbin/opensips -P /var/run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m $S_MEMORY -M $P_MEMORY $OPTIONS
ExecStartPre=/usr/sbin/opensips -c -f /etc/opensips/opensips.cfg
Restart=always
TimeoutStopSec=30s

[Install]
WantedBy=multi-user.target

1 change: 1 addition & 0 deletions packaging/debian/opensips.tmpfile
@@ -0,0 +1 @@
d /run/opensips 0775 opensips opensips -
6 changes: 6 additions & 0 deletions packaging/debian/rules
Expand Up @@ -26,6 +26,9 @@ URL := https://github.com/OpenSIPS/opensips/archive/$(UPVERSION).tar.gz

# List of all debian module packages we will build
# Used to index the make variable below, which has details about each package
#
# LUA has been removed due to libmemcache dependency.
# See https://github.com/OpenSIPS/opensips/issues/580
ALL_MODPKG_LIST := \
MYSQL POSTGRES UNIXODBC JABBER CPL RADIUS \
PRESENCE XMLRPC PERL SNMPSTATS XMPP CROUTE BERKELEY LDAP \
Expand Down Expand Up @@ -183,6 +186,9 @@ LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
# force lib (versus lib64) and SMP support all the time
VARS = LIBDIR=lib ISSMP=yes

# Debian Jessie doesn't package radius-ng, so use freeradius instead
VARS += FREERADIUS=yes

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
Expand Down

0 comments on commit 65bfc1a

Please sign in to comment.