[arch-commits] Commit in opensips/repos (5 files)

Felix Yan felixonmars at gemini.archlinux.org
Sat Nov 13 21:02:35 UTC 2021


    Date: Saturday, November 13, 2021 @ 21:02:35
  Author: felixonmars
Revision: 1046159

archrelease: copy trunk to community-staging-x86_64

Added:
  opensips/repos/community-staging-x86_64/
  opensips/repos/community-staging-x86_64/PKGBUILD
    (from rev 1046158, opensips/trunk/PKGBUILD)
  opensips/repos/community-staging-x86_64/openldap-2.5.patch
    (from rev 1046158, opensips/trunk/openldap-2.5.patch)
  opensips/repos/community-staging-x86_64/opensips.install
    (from rev 1046158, opensips/trunk/opensips.install)
  opensips/repos/community-staging-x86_64/opensips.service
    (from rev 1046158, opensips/trunk/opensips.service)

--------------------+
 PKGBUILD           |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++
 openldap-2.5.patch |   57 ++++++++++++++++++++++++++++++++++++++++
 opensips.install   |    3 ++
 opensips.service   |   11 +++++++
 4 files changed, 143 insertions(+)

Copied: opensips/repos/community-staging-x86_64/PKGBUILD (from rev 1046158, opensips/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-11-13 21:02:35 UTC (rev 1046159)
@@ -0,0 +1,72 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+
+pkgname=opensips
+pkgver=3.1.2
+pkgrel=3
+pkgdesc="An Open Source SIP Server able to act as a SIP proxy, registrar, location server, redirect server ..."
+url="https://www.opensips.org"
+depends=('gcc-libs' 'openssl' 'db' 'attr' 'libxml2')
+makedepends=('postgresql-libs>=8.4.1' 'unixodbc' 'libldap>=2.4.18' 'libmariadbclient'
+	     'lynx' 'libxslt' 'libmicrohttpd')
+optdepends=('postgresql-libs'
+	    'unixodbc'
+	    'libldap'
+	    'mariadb-libs'
+	    'libsasl'
+	    'pcre')
+backup=("etc/opensips/opensips.cfg"
+	"etc/opensips/osipsconsolerc"
+	"etc/opensips/opensipsctlrc")
+arch=('x86_64')
+license=('GPL')
+install=opensips.install
+options=('!emptydirs' 'zipman' '!makeflags' 'docs')
+source=(https://opensips.org/pub/opensips/${pkgver}/opensips-${pkgver}.tar.gz
+        openldap-2.5.patch
+	opensips.service)
+sha256sums=('557b33db1436d8212ac122f299481bee3f2957f060a2bc0b4256430faf8b3bbc'
+            '48069c579676e6d38673152b22481624d98cf17ce7ae46bdff51f7df61c03c5e'
+            'c2fec4be085b108db10834fa9832e98d696c2de6408f85f96cf89c13bf6be819')
+
+prepare() {
+  cd "$srcdir"/$pkgname-$pkgver/
+
+  patch -Np1 -i ../openldap-2.5.patch
+
+  sed -i 's|sbin|bin|g' Makefile
+  sed -i 's|bin-dir = sbin/|bin-dir = bin/|' Makefile.defs
+}
+
+_modules="ldap db_mysql db_postgres db_unixodbc presence presence_xml h350 proto_tls tlsops tls_mgm db_http httpd tm rr"
+
+build() {
+  cd "$srcdir"/$pkgname-$pkgver/
+
+  make \
+	include_modules="${_modules}" \
+	LIBDIR=lib PREFIX=/usr
+}
+
+package() {
+  cd "$srcdir"/$pkgname-$pkgver/
+
+  make \
+	include_modules="${_modules}" \
+	BASEDIR="$pkgdir" PREFIX=/usr LIBDIR=lib install
+
+  # Conforms to the arch packaging standards (https://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"##" {} \;
+
+  mv "$pkgdir"/usr/sbin "$pkgdir"/usr/bin
+
+  cd "$pkgdir"/etc
+  find -type f -exec sed -i "s#"$pkgdir"##" {} \;
+
+  install -Dm0644 "$srcdir"/$pkgname.service "$pkgdir"/usr/lib/systemd/system/$pkgname.service
+}

Copied: opensips/repos/community-staging-x86_64/openldap-2.5.patch (from rev 1046158, opensips/trunk/openldap-2.5.patch)
===================================================================
--- community-staging-x86_64/openldap-2.5.patch	                        (rev 0)
+++ community-staging-x86_64/openldap-2.5.patch	2021-11-13 21:02:35 UTC (rev 1046159)
@@ -0,0 +1,57 @@
+diff -upr opensips-3.1.2.orig/modules/ldap/ldap_api_fn.c opensips-3.1.2/modules/ldap/ldap_api_fn.c
+--- opensips-3.1.2.orig/modules/ldap/ldap_api_fn.c	2021-05-06 17:40:16.000000000 +0300
++++ opensips-3.1.2/modules/ldap/ldap_api_fn.c	2021-11-13 22:51:36.709798951 +0200
+@@ -118,7 +118,7 @@ struct ld_conn* get_ldap_connection(stru
+ 		return NULL;
+ 	}
+ 
+-	if (ldap_connect(lds->name, NULL) < 0) {
++	if (opensips_ldap_connect(lds->name, NULL) < 0) {
+ 			LM_ERR("failed to create new ldap connection!\n");
+ 			return NULL;
+ 	}
+diff -upr opensips-3.1.2.orig/modules/ldap/ldap_connect.c opensips-3.1.2/modules/ldap/ldap_connect.c
+--- opensips-3.1.2.orig/modules/ldap/ldap_connect.c	2021-05-06 17:40:16.000000000 +0300
++++ opensips-3.1.2/modules/ldap/ldap_connect.c	2021-11-13 22:51:36.709798951 +0200
+@@ -113,7 +113,7 @@ error:
+ }
+ 
+ 
+-int ldap_connect(char* _ld_name, struct ld_conn* conn)
++int opensips_ldap_connect(char* _ld_name, struct ld_conn* conn)
+ {
+ 	int rc;
+ 	int ldap_proto_version;
+@@ -411,7 +411,7 @@ int ldap_reconnect(char* _ld_name, struc
+ 		return -1;
+ 	}
+ 
+-	if ((rc = ldap_connect(_ld_name, conn)) != 0)
++	if ((rc = opensips_ldap_connect(_ld_name, conn)) != 0)
+ 	{
+ 		LM_ERR("[%s]: reconnect failed\n",
+ 				_ld_name);
+diff -upr opensips-3.1.2.orig/modules/ldap/ldap_connect.h opensips-3.1.2/modules/ldap/ldap_connect.h
+--- opensips-3.1.2.orig/modules/ldap/ldap_connect.h	2021-05-06 17:40:16.000000000 +0300
++++ opensips-3.1.2/modules/ldap/ldap_connect.h	2021-11-13 22:51:38.336506198 +0200
+@@ -43,7 +43,7 @@
+ /* forward declaration for this structure */
+ struct ld_conn;
+ 
+-extern int ldap_connect(char* _ld_name, struct ld_conn* conn);
++extern int opensips_ldap_connect(char* _ld_name, struct ld_conn* conn);
+ extern int ldap_disconnect(char* _ld_name, struct ld_conn* conn);
+ extern int ldap_reconnect(char* _ld_name, struct ld_conn* conn);
+ extern int ldap_get_vendor_version(char** _version);
+diff -upr opensips-3.1.2.orig/modules/ldap/ldap_mod.c opensips-3.1.2/modules/ldap/ldap_mod.c
+--- opensips-3.1.2.orig/modules/ldap/ldap_mod.c	2021-05-06 17:40:16.000000000 +0300
++++ opensips-3.1.2/modules/ldap/ldap_mod.c	2021-11-13 22:51:36.709798951 +0200
+@@ -186,7 +186,7 @@ static int child_init(int rank)
+ 		}
+ 
+ 		/* won't check for null in get_ld_session since it's barely been initialized */
+-		if (ldap_connect(ld_name, &get_ld_session(ld_name)->conn_s) != 0)
++		if (opensips_ldap_connect(ld_name, &get_ld_session(ld_name)->conn_s) != 0)
+ 		{
+ 			LM_ERR("[%s]: failed to connect to LDAP host(s)\n", ld_name);
+ 			ldap_disconnect(ld_name, NULL);

Copied: opensips/repos/community-staging-x86_64/opensips.install (from rev 1046158, opensips/trunk/opensips.install)
===================================================================
--- community-staging-x86_64/opensips.install	                        (rev 0)
+++ community-staging-x86_64/opensips.install	2021-11-13 21:02:35 UTC (rev 1046159)
@@ -0,0 +1,3 @@
+post_install() {
+  echo "To use MySQL, you should install mysql package and run 'opensipsdbctl create'"
+}

Copied: opensips/repos/community-staging-x86_64/opensips.service (from rev 1046158, opensips/trunk/opensips.service)
===================================================================
--- community-staging-x86_64/opensips.service	                        (rev 0)
+++ community-staging-x86_64/opensips.service	2021-11-13 21:02:35 UTC (rev 1046159)
@@ -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



More information about the arch-commits mailing list