From ea1f4bece8870857691a7123bdc899562760b3fe Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Dec 2011 23:14:59 +0000 Subject: Tue Dec 20 23:14:59 UTC 2011 --- community-testing/opensips/PKGBUILD | 67 +++++++++++++++++++++++++++++ community-testing/opensips/opensips.init | 50 +++++++++++++++++++++ community-testing/opensips/opensips.install | 5 +++ 3 files changed, 122 insertions(+) create mode 100644 community-testing/opensips/PKGBUILD create mode 100644 community-testing/opensips/opensips.init create mode 100644 community-testing/opensips/opensips.install (limited to 'community-testing/opensips') diff --git a/community-testing/opensips/PKGBUILD b/community-testing/opensips/PKGBUILD new file mode 100644 index 000000000..b11589417 --- /dev/null +++ b/community-testing/opensips/PKGBUILD @@ -0,0 +1,67 @@ +# $Id: PKGBUILD 60926 2011-12-19 18:10:36Z andrea $ +# Maintainer: Sergej Pupykin + +pkgname=opensips +pkgver=1.6.4 +pkgrel=2 +pkgdesc="An Open Source SIP Server able to act as a SIP proxy, registrar, location server, redirect server ..." +url="http://www.opensips.org" +depends=('gcc-libs' 'openssl' 'db' 'attr' 'kernel-headers' 'libxml2') +makedepends=('postgresql-libs>=8.4.1' 'unixodbc' 'libldap>=2.4.18' 'libmysqlclient' 'lynx') +optdepends=('postgresql-libs' + 'unixodbc' + 'libldap' + 'libmysqlclient' + 'libsasl' + 'python2' + 'pcre') +backup=("etc/opensips/opensips.cfg" + "etc/opensips/dictionary.radius" + "etc/opensips/opensipsctlrc") +arch=('i686' 'x86_64') +license=('GPL') +install=opensips.install +options=('!emptydirs' 'zipman' '!makeflags' 'docs') +source=(#http://switch.dl.sourceforge.net/sourceforge/opensips/opensips-$pkgver-tls_src.tar.gz + http://opensips.org/pub/opensips/$pkgver/src/opensips-$pkgver-2-tls_src.tar.gz + opensips.init) +md5sums=('e9869d9a726d70f83de4a1e77cd24d40' + '685fbe00826df1285b410d4610dcbb0c') + +build() +{ + cd $srcdir/$pkgname-$pkgver-2-tls/ + + # python2 fix + for file in $(find . -name '*.py' -print); do + sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file + sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file + done + + make \ + include_modules="ldap db_mysql db_postgres db_unixodbc presence presence_xml h350" \ + TLS=1 DESTDIR=$pkgdir/usr LIBDIR=lib install + + # Conforms to the arch packaging standards (http://wiki.archlinux.org/index.php/Arch_Packaging_Standards) + mkdir -p $pkgdir/etc/ + mv $pkgdir/usr/etc/opensips/ $pkgdir/etc/ + sed -i 's#mpath=".*lib/opensips/modules/"#mpath="/usr/lib/opensips/modules/"#' $pkgdir/etc/opensips/opensips.cfg + + # Install starting script + mkdir -p $pkgdir/etc/rc.d/ + cp ../opensips.init $pkgdir/etc/rc.d/opensips + chmod 755 $pkgdir/etc/rc.d/opensips + + # fix bad paths + cd $pkgdir/usr/share + find -type f -exec sed -i "s#$pkgdir##" {} \; + + cd $pkgdir/usr/lib/opensips/opensipsctl + find -type f -exec sed -i "s#$pkgdir##" {} \; + + cd $pkgdir/usr/sbin + sed -i "s#$pkgdir##" opensipsctl opensipsdbctl osipsconsole + + cd $pkgdir/etc + find -type f -exec sed -i "s#$pkgdir##" {} \; +} diff --git a/community-testing/opensips/opensips.init b/community-testing/opensips/opensips.init new file mode 100644 index 000000000..1c883c4c2 --- /dev/null +++ b/community-testing/opensips/opensips.init @@ -0,0 +1,50 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +BINNAME=opensips +OSRDIR=/usr/sbin +OPENSIPS=$OSRDIR/$BINNAME + +TMPDIR=/var/tmp +CORE=$TMPDIR/core + +ETC=/etc/opensips/opensips.cfg +PIDFILE=/var/run/opensips.pid + +case "$1" in + start) + stat_busy "Starting OpenSIPS server" + cd $TMPDIR + $OPENSIPS -f $ETC -w $TMPDIR -P $PIDFILE 2>&1 > /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon opensips + stat_done + fi + ;; + stop) + stat_busy "Stopping OpenSIPS server" + if [ -r $PIDFILE ] + then + cat $PIDFILE | xargs kill + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon opensips + stat_done + fi + else + stat_fail + fi + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/community-testing/opensips/opensips.install b/community-testing/opensips/opensips.install new file mode 100644 index 000000000..9e8f2a47b --- /dev/null +++ b/community-testing/opensips/opensips.install @@ -0,0 +1,5 @@ +post_install() +{ + echo "To use MySQL, you should install mysql package and run '/usr/sbin/openser_mysql.sh create'" + /bin/true +} -- cgit v1.2.3-54-g00ecf