OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: r...@openpkg.org Module: openpkg-src Date: 28-Mar-2009 20:14:53 Branch: HEAD Handle: 2009032819145200 Modified files: openpkg-src/asterisk asterisk.patch asterisk.spec Log: modifying package: asterisk-1.6.0.6 20090223 -> 20090328 Summary: Revision Changes Path 1.46 +365 -1 openpkg-src/asterisk/asterisk.patch 1.90 +15 -21 openpkg-src/asterisk/asterisk.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/asterisk/asterisk.patch ============================================================================ $ cvs diff -u -r1.45 -r1.46 asterisk.patch --- openpkg-src/asterisk/asterisk.patch 23 Feb 2009 21:47:43 -0000 1.45 +++ openpkg-src/asterisk/asterisk.patch 28 Mar 2009 19:14:52 -0000 1.46 @@ -78,7 +78,7 @@ + +#include "asterisk.h" + -+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.45 $") ++ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.46 $") + +#include <stdio.h> +#include <asterisk/file.h> @@ -441,3 +441,367 @@ </member> <member name="EXTRA-SOUNDS-EN-GSM" displayname="English, GSM format" > </member> +Index: chan_capi-1.1.2/Makefile +--- chan_capi-1.1.2/Makefile.orig 2009-01-17 18:36:50 +0100 ++++ chan_capi-1.1.2/Makefile 2009-03-28 18:27:10 +0100 +@@ -90,6 +90,9 @@ + CFLAGS+=-O6 + CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) + CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) ++ifeq (${USE_OWN_LIBCAPI},yes) ++CFLAGS+=-DUSE_OWN_LIBCAPI ++endif + + LIBS=-ldl -lpthread -lm + CC=gcc +Index: chan_capi-1.1.2/chan_capi20.h +--- chan_capi-1.1.2/chan_capi20.h.orig 2005-09-20 20:33:40 +0200 ++++ chan_capi-1.1.2/chan_capi20.h 2009-03-28 18:28:02 +0100 +@@ -8,6 +8,8 @@ + + #undef CAPI_OS_HINT + ++#ifndef USE_OWN_LIBCAPI ++ + #if (defined(__FreeBSD__) || defined(__OpenBSD__) || \ + defined(__NetBSD__) || defined(__APPLE__)) + +@@ -29,6 +31,8 @@ + #include <capiutils.h> + #endif /* BSD */ + ++#endif ++ + #ifndef HEADER_CID + #define HEADER_CID(x) ((x)->adr.adrNCCI) + #endif +Index: chan_capi-1.1.2/libcapi20/capi20.c +--- chan_capi-1.1.2/libcapi20/capi20.c.orig 2008-12-31 17:29:36 +0100 ++++ chan_capi-1.1.2/libcapi20/capi20.c 2009-03-28 19:25:29 +0100 +@@ -19,8 +19,10 @@ + #include <stdio.h> + #include <ctype.h> + #include <assert.h> ++#ifdef __linux__ + #define _LINUX_LIST_H + #include <linux/capi.h> ++#endif + + #include <sys/socket.h> + #include <netinet/in.h> +@@ -46,17 +48,23 @@ + + #define SEND_BUFSIZ (128+2048) + ++#if 0 + static char capidevname[] = "/dev/capi20"; + static char capidevnamenew[] = "/dev/isdn/capi20"; ++#endif + + static int capi_fd = -1; ++#if 0 + static capi_ioctl_struct ioctl_data; ++#endif + + static int remote_capi; ++#if 0 + static char *globalconfigfilename = "/etc/capi20.conf"; + static char *userconfigfilename = ".capi20rc"; + static unsigned short int port; + static char hostname[1024]; ++#endif + static int tracelevel; + static char *tracefile; + +@@ -75,17 +83,21 @@ + #define RCAPI_AUTH_USER_REQ CAPICMD(0xff, 0x00) + #define RCAPI_AUTH_USER_CONF CAPICMD(0xff, 0x01) + ++#if 0 + static char *skip_whitespace(char *s) + { + while (*s && isspace(*s)) s++; + return s; + } ++#endif + ++#if 0 + static char *skip_nonwhitespace(char *s) + { + while (*s && !isspace(*s)) s++; + return s; + } ++#endif + + static unsigned char get_byte(unsigned char **p) + { +@@ -93,10 +105,12 @@ + return((unsigned char)*(*p - 1)); + } + ++#if 0 + static unsigned short get_word(unsigned char **p) + { + return(get_byte(p) | (get_byte(p) << 8)); + } ++#endif + + static unsigned short get_netword(unsigned char **p) + { +@@ -142,6 +156,7 @@ + * read config file + */ + ++#if 0 + static int read_config(void) + { + FILE *fp = NULL; +@@ -195,11 +210,13 @@ + fclose(fp); + return(1); + } ++#endif + + /* + * socket function + */ + ++#if 0 + static int open_socket(void) + { + int fd; +@@ -223,6 +240,7 @@ + close(fd); + return(-1); + } ++#endif + + static int socket_read(int fd, unsigned char *buf, int l) + { +@@ -316,6 +334,8 @@ + if (capi_fd >= 0) + return CapiNoError; + ++#if 0 ++ + /*----- open managment link -----*/ + if (read_config() && (remote_capi)) { + capi_fd = open_socket(); +@@ -335,6 +355,8 @@ + if (ioctl(capi_fd, CAPI_INSTALLED, 0) == 0) + return CapiNoError; + ++#endif ++ + return CapiRegNotInstalled; + } + +@@ -409,6 +431,7 @@ + unsigned char *bufferstart; + }; + ++#if 0 + static struct applinfo *alloc_buffers( + unsigned MaxB3Connection, + unsigned MaxB3Blks, +@@ -447,6 +470,7 @@ + ap->lastfree->next = 0; + return ap; + } ++#endif + + static void free_buffers(struct applinfo *ap) + { +@@ -564,14 +588,17 @@ + unsigned MaxSizeB3, + unsigned *ApplID) + { ++#if 0 + int applid = 0; + char buf[PATH_MAX]; + int i, fd = -1; + + *ApplID = 0; ++#endif + + if (capi20_isinstalled() != CapiNoError) + return CapiRegNotInstalled; ++#if 0 + if ((!remote_capi) || ((remote_capi) && ((fd = open_socket()) < 0))) { + if ((fd = open(capidevname, O_RDWR|O_NONBLOCK, 0666)) < 0 && + (errno == ENOENT)) { +@@ -609,6 +636,8 @@ + close(fd); + return(errcode); + } ++ } ++#if 0 + } else if ((applid = ioctl(fd, CAPI_REGISTER, &ioctl_data)) < 0) { + if (errno == EIO) { + if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { +@@ -654,6 +683,7 @@ + applid = alloc_applid(fd); + } // end old driver compatibility + } ++#endif + if (remember_applid(applid, fd) < 0) { + close(fd); + return CapiRegOSResourceErr; +@@ -664,6 +694,7 @@ + return CapiRegOSResourceErr; + } + *ApplID = applid; ++#endif + return CapiNoError; + } + +@@ -772,11 +803,15 @@ + ret = CapiIllAppNr; + break; + case EIO: ++#if 0 + if (ioctl(fd, CAPI_GET_ERRCODE, &ioctl_data) < 0) { ++#endif + ret = CapiMsgOSResourceErr; ++#if 0 + } else { + ret = (unsigned)ioctl_data.errcode; + } ++#endif + break; + default: + ret = CapiMsgOSResourceErr; +@@ -830,7 +865,7 @@ + rcvbuf[15] = (data >> 24) & 0xff; + } else { + u_int64_t data; +- ulong radr = (ulong)rcvbuf; ++ unsigned long radr = (unsigned long)rcvbuf; + if (CAPIMSG_LEN(rcvbuf) < 30) { + /* + * grr, 64bit arch, but no data64 included, +@@ -887,6 +922,9 @@ + { + if (capi20_isinstalled() != CapiNoError) + return 0; ++#ifndef CAPI_MANUFACTURER_LEN ++#define CAPI_MANUFACTURER_LEN 64 ++#endif + + if (remote_capi) { + unsigned char buf[100]; +@@ -899,15 +937,19 @@ + return Buf; + } + ++#if 0 + ioctl_data.contr = Ctrl; + + if (ioctl(capi_fd, CAPI_GET_MANUFACTURER, &ioctl_data) < 0) ++#endif + return 0; + ++#if 0 + memcpy(Buf, ioctl_data.manufacturer, CAPI_MANUFACTURER_LEN); + Buf[CAPI_MANUFACTURER_LEN-1] = 0; + + return Buf; ++#endif + } + + unsigned char * +@@ -922,16 +964,20 @@ + set_rcapicmd_header(&p, 14, RCAPI_GET_VERSION_REQ, Ctrl); + if(!(remote_command(capi_fd, buf, 14, RCAPI_GET_VERSION_CONF))) + return 0; +- memcpy(Buf, buf + 1, sizeof(capi_version)); ++ memcpy(Buf, buf + 1, 128 /* sizeof(capi_version) */); + return Buf; + } + ++#if 0 + ioctl_data.contr = Ctrl; + if (ioctl(capi_fd, CAPI_GET_VERSION, &ioctl_data) < 0) { ++#endif + return 0; ++#if 0 + } + memcpy(Buf, &ioctl_data.version, sizeof(capi_version)); + return Buf; ++#endif + } + + unsigned char * +@@ -940,6 +986,10 @@ + if (capi20_isinstalled() != CapiNoError) + return 0; + ++#ifndef CAPI_SERIAL_LEN ++#define CAPI_SERIAL_LEN 8 ++#endif ++ + if (remote_capi) { + unsigned char buf[100]; + unsigned char *p = buf; +@@ -951,15 +1001,19 @@ + return Buf; + } + ++#if 0 + ioctl_data.contr = Ctrl; + + if (ioctl(capi_fd, CAPI_GET_SERIAL, &ioctl_data) < 0) ++#endif + return 0; + ++#if 0 + memcpy(Buf, &ioctl_data.serial, CAPI_SERIAL_LEN); + Buf[CAPI_SERIAL_LEN-1] = 0; + + return Buf; ++#endif + } + + unsigned +@@ -975,11 +1029,14 @@ + if(!(remote_command(capi_fd, buf, 14, RCAPI_GET_PROFILE_CONF))) + return CapiMsgOSResourceErr; + if(*(unsigned short *)buf == CapiNoError) { +- memcpy(Buf, buf + 2, (Ctrl) ? sizeof(struct capi_profile) : 2); ++ memcpy(Buf, buf + 2, (Ctrl) ? 224 /* sizeof(struct capi_profile) */ : 2); + } + return (*(unsigned short *)buf); + } + ++#if 1 ++ return CapiMsgOSResourceErr; ++#else + ioctl_data.contr = Ctrl; + + if (ioctl(capi_fd, CAPI_GET_PROFILE, &ioctl_data) < 0) { +@@ -996,6 +1053,7 @@ + sizeof(ioctl_data.profile.ncontroller)); + } + return CapiNoError; ++#endif + } + /* + * functions added to the CAPI2.0 spec +Index: chan_capi-1.1.2/libcapi20/convert.c +--- chan_capi-1.1.2/libcapi20/convert.c.orig 2008-03-13 12:02:41 +0100 ++++ chan_capi-1.1.2/libcapi20/convert.c 2009-03-28 18:34:40 +0100 +@@ -11,7 +11,14 @@ + #include <stddef.h> + #include <time.h> + #include <ctype.h> ++#ifdef __FreeBSD__ ++#include <sys/endian.h> ++#define bswap_16 bswap16 ++#define bswap_32 bswap32 ++#define bswap_64 bswap64 ++#else + #include <byteswap.h> ++#endif + + #include "capi20.h" + @@ . patch -p0 <<'@@ .' Index: openpkg-src/asterisk/asterisk.spec ============================================================================ $ cvs diff -u -r1.89 -r1.90 asterisk.spec --- openpkg-src/asterisk/asterisk.spec 23 Feb 2009 21:47:43 -0000 1.89 +++ openpkg-src/asterisk/asterisk.spec 28 Mar 2009 19:14:52 -0000 1.90 @@ -25,10 +25,10 @@ %define V_opkg 1.6.0.6 %define V_asterisk 1.6.0.6 %define V_asterisk_addons 1.6.0.1 -%define V_asterisk_sounds_core_en 1.4.14 +%define V_asterisk_sounds_core_en 1.4.15 %define V_asterisk_sounds_core_de current -%define V_asterisk_sounds_extra_en 1.4.8 -%define V_chan_capi 1_6_1 +%define V_asterisk_sounds_extra_en 1.4.9 +%define V_chan_capi 1.1.2 # package information Name: asterisk @@ -41,7 +41,7 @@ Group: VoIP License: GPL Version: %{V_opkg} -Release: 20090223 +Release: 20090328 # package options %option with_dahdi no @@ -64,7 +64,7 @@ Source2: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-alaw-%{V_asterisk_sounds_core_en}.tar.gz Source3: http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-alaw-%{V_asterisk_sounds_extra_en}.tar.gz Source4: http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-%{V_asterisk_sounds_core_de}.tar.gz -Source5: http://www.turbocat.net/~hselasky/capi4pbx/releases/chan_capi_%{V_chan_capi}.tar.bz2 +Source5: ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz Source6: asterisk.txt Source7: rc.asterisk Patch0: asterisk.patch @@ -159,8 +159,8 @@ } prog asterisk:chan_capi = { version = %{V_chan_capi} - url = http://www.turbocat.net/~hselasky/capi4pbx/releases/ - regex = chan_capi_(__VER__)\.tar\.bz2 + url = ftp://ftp.chan-capi.org/chan-capi/ + regex = chan_capi-(__VER__)\.tar\.gz } %prep @@ -198,16 +198,6 @@ * ) echo "option \"with_dahdi\" supported under Linux and FreeBSD only" 1>&2; exit 1 ;; esac %endif -%if "%{with_capi}" == "yes" - case "%{l_platform -t}" in - *-freebsd* | *-netbsd* ) - if [ ! -f /usr/include/i4b/include/capi20.h ]; then - echo "option \"with_chan_capi\" requires I4B 1.6 or newer installed" 1>&2; exit 1 - fi - ;; - * ) echo "option \"with_capi\" supported under FreeBSD and NetBSD only" 1>&2; exit 1 ;; - esac -%endif # re-configure music-on-hold to find mpg123 %if "%{with_mp3}" == "yes" @@ -371,9 +361,12 @@ CC="%{l_cc} %{l_cflags -O} -I. %{l_cppflags ncurses tiff .}" ) || exit $? %if "%{with_capi}" == "yes" - ( cd chan_capi_* + ( cd chan_capi-* + ln -s ../include/asterisk . + ln -s ../include/asterisk.h . %{l_make} %{l_mflags} \ - INSTALL_PREFIX=%{l_prefix} + INSTALL_PREFIX=%{l_prefix} \ + ASTERISK_HEADER_DIR="`pwd`" ) || exit $? %endif @@ -391,10 +384,11 @@ INSTALL_PREFIX=%{l_prefix} ) || exit $? %if "%{with_capi}" == "yes" - ( cd chan_capi_* + ( cd chan_capi-* %{l_make} %{l_mflags} install \ INSTALL_PREFIX=$RPM_BUILD_ROOT%{l_prefix} \ - INSTALL="%{l_shtool} install -c" + INSTALL="%{l_shtool} install -c" \ + MODULES_DIR='$(INSTALL_PREFIX)/lib/asterisk/modules' ) || exit $? %endif @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org