summaryrefslogtreecommitdiff
path: root/community/opensips
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
committerroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
commit8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch)
tree03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/opensips
parente445a313723389ba9ee1fded025c567dae5b21ea (diff)
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/opensips')
-rw-r--r--community/opensips/PKGBUILD78
-rw-r--r--community/opensips/opensips.install3
-rw-r--r--community/opensips/opensips.service11
3 files changed, 92 insertions, 0 deletions
diff --git a/community/opensips/PKGBUILD b/community/opensips/PKGBUILD
new file mode 100644
index 000000000..7a39ec2b6
--- /dev/null
+++ b/community/opensips/PKGBUILD
@@ -0,0 +1,78 @@
+# $Id: PKGBUILD 91536 2013-05-23 11:21:11Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+
+pkgname=opensips
+pkgver=1.9.1
+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' 'libxml2')
+makedepends=('postgresql-libs>=8.4.1' 'unixodbc' 'libldap>=2.4.18' 'libmariadbclient'
+ 'lynx' 'libxslt')
+optdepends=('postgresql-libs'
+ 'unixodbc'
+ 'libldap'
+ 'libmariadbclient'
+ '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://opensips.org/pub/opensips/$pkgver/src/opensips-${pkgver}_src.tar.gz
+ opensips.service)
+md5sums=('0b7b93f4df29a96daedf12e490e7ec86'
+ '35cdcb3692f6925236fd5fe7e9484c58')
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver-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
+
+ sed -i 's|sbin|bin|g' Makefile
+ sed -i 's|bin-dir = sbin/|bin-dir = bin/|' Makefile.defs
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver-tls/
+
+ make \
+ include_modules="ldap db_mysql db_postgres db_unixodbc presence presence_xml h350" \
+ TLS=1 LIBDIR=lib
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver-tls/
+
+ 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
+
+ # 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/bin
+ sed -i "s#$pkgdir##" opensipsctl opensipsdbctl osipsconsole
+
+ cd $pkgdir/etc
+ find -type f -exec sed -i "s#$pkgdir##" {} \;
+
+ install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+}
diff --git a/community/opensips/opensips.install b/community/opensips/opensips.install
new file mode 100644
index 000000000..40973a77a
--- /dev/null
+++ b/community/opensips/opensips.install
@@ -0,0 +1,3 @@
+post_install() {
+ echo "To use MySQL, you should install mysql package and run '/usr/bin/openser_mysql.sh create'"
+}
diff --git a/community/opensips/opensips.service b/community/opensips/opensips.service
new file mode 100644
index 000000000..220a5d419
--- /dev/null
+++ b/community/opensips/opensips.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSIPS daemon
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/run/opensips.pid
+ExecStart=/usr/bin/opensips -f /etc/opensips/opensips.cfg -w /var/tmp -P /run/opensips.pid
+
+[Install]
+WantedBy=multi-user.target