OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 23-Mar-2008 12:30:57
Branch: HEAD Handle: 2008032311305600
Added files:
openpkg-src/asterisk-ldap
asterisk-ldap.patch asterisk-ldap.spec ldap.conf
Log:
new package: asterisk-ldap 2.0rc1 (Asterisk Extension: LDAP Query
Function)
Summary:
Revision Changes Path
1.1 +109 -0 openpkg-src/asterisk-ldap/asterisk-ldap.patch
1.1 +90 -0 openpkg-src/asterisk-ldap/asterisk-ldap.spec
1.1 +18 -0 openpkg-src/asterisk-ldap/ldap.conf
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/asterisk-ldap/asterisk-ldap.patch
============================================================================
$ cvs diff -u -r0 -r1.1 asterisk-ldap.patch
--- /dev/null 2008-03-23 12:30:18 +0100
+++ asterisk-ldap.patch 2008-03-23 12:30:57 +0100
@@ -0,0 +1,109 @@
+Index: Makefile
+--- Makefile.orig 2008-03-23 12:12:17 +0100
++++ Makefile 2008-03-23 12:11:59 +0100
+@@ -9,29 +9,20 @@
+ NAME=app_ldap
+ CONF=ldap.conf
+
+-CFLAGS=$(shell ./cflags.sh)
+-LIBS=-llber -lldap
++CFLAGS=-Wall -D_REENTRANT -D_GNU_SOURCE -fPIC -DNEW_CONFIG=1
-DCHANNEL_HAS_CID=1
++LIBS=-liconv -lldap -llber -lssl -lcrypto -lcrypt -lm
+ RES=$(NAME).so
+
+-CC=gcc
++CC=gcc
++CPPFLAGS=
++LDFLAGS=
+
+-OSARCH=$(shell uname -s)
+-
+-ifeq ($(OSARCH),Darwin)
+- CFLAGS+= -D__Darwin__
+- SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace -liconv
+- TESTLINK=-undefined suppress -force_flat_namespace
+- MODULES_DIR=/Library/Asterisk/modules
+- CONF_DIR=/Library/Asterisk/conf
+- CC=gcc -arch ppc -arch i386
+-else
+ SOLINK=-shared -Xlinker -x
+ MODULES_DIR=/usr/lib/asterisk/modules
+ CONF_DIR=/etc/asterisk
+-endif
+
+ %.so : %.o
+- $(CC) $(SOLINK) -o $@ $(LIBS) $<
++ $(CC) $(LDFLAGS) $(SOLINK) -o $@ $< $(LIBS)
+
+ all: $(RES)
+
+Index: app_ldap.c
+--- app_ldap.c.orig 2007-01-31 22:23:05 +0100
++++ app_ldap.c 2008-03-23 12:07:21 +0100
+@@ -9,6 +9,8 @@
+ *
+ */
+
++#include <asterisk.h>
++
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -26,23 +28,21 @@
+ #include <asterisk/config.h>
+ #include <asterisk/utils.h>
+ #include <asterisk/callerid.h>
++#include <asterisk/config.h>
+
+ #include <ctype.h>
+ #include <errno.h>
+ #include <iconv.h>
++#define LDAP_DEPRECATED 1
+ #include <ldap.h>
+
+-#define AST_MODULE "app_notify"
++#define AST_MODULE "app_ldap"
+
+ #define LDAP_CONFIG "ldap.conf"
+
+ int ldap_lookup(const char *host, int port, int version, int timeout, const
char *user, const char *pass, const char *base, const char *scope, const char
*filter, const char *attribute, char *result);
+ int strconvert(const char *incharset, const char *outcharset,
+-#ifdef __Darwin__
+ const char *in,
+-#else
+- char *in,
+-#endif
+ char *out);
+
+ static char *app = "LDAPget";
+@@ -61,6 +61,9 @@
+ char result[2048];
+ char *result_conv;
+ struct ast_config *cfg;
++#ifdef NEW_CONFIG
++ struct ast_flags config_flags = { 0 };
++#endif
+
+ int port = LDAP_PORT, version = LDAP_VERSION2, timeout = 10;
+ const char *temp, *host, *user, *pass, *_base, *scope, *_filter,
*attribute;
+@@ -101,7 +104,7 @@
+ }
+
+ #ifdef NEW_CONFIG
+- cfg = ast_config_load(LDAP_CONFIG);
++ cfg = ast_config_load(LDAP_CONFIG, config_flags);
+ #else
+ cfg = ast_load(LDAP_CONFIG);
+ #endif
+@@ -303,11 +306,7 @@
+ }
+
+ int strconvert(const char *incharset, const char *outcharset,
+-#ifdef __Darwin__
+ const char *in,
+-#else
+- char *in,
+-#endif
+ char *out) {
+ iconv_t cd;
+ size_t incount = strlen(in), outcount = strlen(in)*2, result;
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/asterisk-ldap/asterisk-ldap.spec
============================================================================
$ cvs diff -u -r0 -r1.1 asterisk-ldap.spec
--- /dev/null 2008-03-23 12:30:18 +0100
+++ asterisk-ldap.spec 2008-03-23 12:30:57 +0100
@@ -0,0 +1,90 @@
+##
+## asterisk-ldap.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package information
+Name: asterisk-ldap
+Summary: Asterisk Extension: LDAP Query Function
+URL: http://www.mezzo.net/asterisk/app_ldap.html
+Vendor: Sven Slezak
+Packager: OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class: EVAL
+Group: VoIP
+License: GPL
+Version: 2.0rc1
+Release: 20080323
+
+# list of sources
+Source0: http://www.mezzo.net/asterisk/app_ldap-%{version}.tgz
+Source1: ldap.conf
+Patch0: asterisk-ldap.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
+PreReq: OpenPKG, openpkg >= 20060823
+BuildPreReq: asterisk, openldap, libiconv, openssl
+PreReq: asterisk, openldap, libiconv, openssl
+AutoReq: no
+AutoReqProv: no
+
+%description
+ This is an extension module for the Asterisk PBX which integrates
+ the LDAPget() dialplan function for querying an LDAP directory.
+
+%track
+ prog asterisk-ldap = {
+ version = %{version}
+ url = http://www.mezzo.net/asterisk/app_ldap.html
+ regex = app_ldap-(__VER__)\.tgz
+ }
+
+%prep
+ %setup -q -n app_ldap-%{version}
+ %patch -p0
+
+%build
+ %{l_make} %{l_mflags} \
+ CC="%{l_cc}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}"
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk \
+ $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules
+ %{l_shtool} install -c -m 644 \
+ %{SOURCE ldap.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
+ %{l_shtool} install -c -m 755 \
+ app_ldap.so $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/asterisk/*'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/asterisk-ldap/ldap.conf
============================================================================
$ cvs diff -u -r0 -r1.1 ldap.conf
--- /dev/null 2008-03-23 12:30:18 +0100
+++ ldap.conf 2008-03-23 12:30:57 +0100
@@ -0,0 +1,18 @@
+;;
+;; ldap.conf -- Asterisk LDAP Query configuration
+;;
+
+; usage:
LDAPget(<varianle>=<config-file-section>[/<lookup-key1>,<lookup-key2>,...])
+; usage: LDAPget(<variable>=cidname)
+[cidname]
+host = 127.0.0.1
+port = 389
+timeout = 10
+version = 2
+user = cn=root,ou=people,o=example.com
+pass = asterisk
+base = ou=addressbook,o=example.com
+filter =
(&(objectClass=person)(|(telephoneNumber=${CALLERID(num)})(mobile=${CALLERID(num)})(homePhone=${CALLERID(num)})(fax=${CALLERID(num)})))
+attribute = commonName
+;convert = UTF-8,ISO-8859-1
+
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]