PKGBUILDs/community/opensips/PKGBUILD

88 lines
2.5 KiB
Bash
Raw Normal View History

2014-07-28 02:20:32 +00:00
# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix building on ARM
pkgname=opensips
2015-05-08 18:21:07 +00:00
pkgver=2.1.0
2014-07-28 02:20:32 +00:00
pkgrel=1
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')
2015-05-08 18:21:07 +00:00
source=(http://opensips.org/pub/opensips/$pkgver/src/opensips-${pkgver}.tar.gz
2014-07-28 02:20:32 +00:00
opensips.service
arm.patch)
2015-05-08 18:21:07 +00:00
md5sums=('68375c1b6cb546ad2c036b5a1c5b31b9'
2014-07-28 02:20:32 +00:00
'35cdcb3692f6925236fd5fe7e9484c58'
'dc8d8f992e4e5ca24f740a046252fd2e')
prepare() {
2015-05-08 18:21:07 +00:00
cd $srcdir/$pkgname-$pkgver/
2014-07-28 02:20:32 +00:00
# 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
patch -p1 -i ../arm.patch
}
2015-05-08 18:21:07 +00:00
_modules="ldap db_mysql db_postgres db_unixodbc presence presence_xml h350 proto_tls tlsops"
2014-07-28 02:20:32 +00:00
build() {
2015-05-08 18:21:07 +00:00
cd $srcdir/$pkgname-$pkgver/
2014-07-28 02:20:32 +00:00
make \
2015-05-08 18:21:07 +00:00
include_modules="${_modules}" \
LIBDIR=lib PREFIX=/usr
2014-07-28 02:20:32 +00:00
}
package() {
2015-05-08 18:21:07 +00:00
cd $srcdir/$pkgname-$pkgver/
2014-07-28 02:20:32 +00:00
make \
2015-05-08 18:21:07 +00:00
include_modules="${_modules}" \
BASEDIR=$pkgdir PREFIX=/usr LIBDIR=lib install
2014-07-28 02:20:32 +00:00
# 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
}