[svn] r3107 - in trunk/rpms: asterisk asterisk-sounds zaptel

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Tue Apr 5 11:57:20 CEST 2005


Author: thias
Date: 2005-04-05 11:57:17 +0200 (Tue, 05 Apr 2005)
New Revision: 3107

Added:
   trunk/rpms/zaptel/zaptel-1.0.6-makefile.patch
Removed:
   trunk/rpms/zaptel/zaptel-1.0.4-makefile.patch
Modified:
   trunk/rpms/asterisk-sounds/asterisk-sounds.spec
   trunk/rpms/asterisk/asterisk-1.0-RC2-cdr.patch
   trunk/rpms/asterisk/asterisk.spec
   trunk/rpms/zaptel/zaptel.spec
Log:
Update asterisk, asterisk-sounds and zaptel to 1.0.7.


Modified: trunk/rpms/asterisk/asterisk-1.0-RC2-cdr.patch
===================================================================
--- trunk/rpms/asterisk/asterisk-1.0-RC2-cdr.patch	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/asterisk/asterisk-1.0-RC2-cdr.patch	2005-04-05 09:57:17 UTC (rev 3107)
@@ -49,342 +49,3 @@
  			return -1;
  		}
  	} else {
-diff -Naupr asterisk-1.0-RC2.orig/cdr/cdr_pgsql.c.orig asterisk-1.0-RC2/cdr/cdr_pgsql.c.orig
---- asterisk-1.0-RC2.orig/cdr/cdr_pgsql.c.orig	1970-01-01 01:00:00.000000000 +0100
-+++ asterisk-1.0-RC2/cdr/cdr_pgsql.c.orig	2004-07-28 20:42:35.000000000 +0200
-@@ -0,0 +1,335 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * PostgreSQL CDR logger 
-+ *
-+ * Matthew D. Hardeman <mhardemn at papersoft.com> 
-+ * Adapted from the MySQL CDR logger originally by James Sharp 
-+ *
-+ * Modified September 2003
-+ * Matthew D. Hardeman <mhardemn at papersoft.com>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License.
-+ *
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/config.h>
-+#include <asterisk/options.h>
-+#include <asterisk/channel.h>
-+#include <asterisk/cdr.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include "../asterisk.h"
-+
-+#include <stdio.h>
-+#include <string.h>
-+
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <time.h>
-+
-+#include <libpq-fe.h>
-+
-+#define DATE_FORMAT "%Y-%m-%d %T"
-+
-+static char *desc = "PostgreSQL CDR Backend";
-+static char *name = "pgsql";
-+static char *config = "cdr_pgsql.conf";
-+static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbsock = NULL, *pgdbport = NULL;
-+static int hostname_alloc = 0, dbname_alloc = 0, dbuser_alloc = 0, password_alloc = 0, dbsock_alloc = 0, dbport_alloc = 0;
-+static int connected = 0;
-+
-+AST_MUTEX_DEFINE_STATIC(pgsql_lock);
-+
-+PGconn		*conn;
-+PGresult	*result;
-+
-+static int pgsql_log(struct ast_cdr *cdr)
-+{
-+	struct tm tm;
-+	char sqlcmd[2048] = "", timestr[128];
-+	char *pgerror;
-+
-+	ast_mutex_lock(&pgsql_lock);
-+
-+	localtime_r(&cdr->start.tv_sec,&tm);
-+	strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
-+
-+	if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) {
-+		conn = PQsetdbLogin(pghostname, pgdbport, NULL, NULL, pgdbname, pgdbuser, pgpassword);
-+		if (PQstatus(conn) != CONNECTION_BAD) {
-+			connected = 1;
-+		} else {
-+			pgerror = PQerrorMessage(conn);
-+			ast_log(LOG_ERROR, "cdr_pgsql: Unable to connect to database server %s.  Calls will not be logged!\n", pghostname);
-+                        ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);
-+		}
-+	}
-+
-+	if (connected) {
-+		char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL;
-+		char *uniqueid=NULL, *userfield=NULL;
-+
-+		/* Maximum space needed would be if all characters needed to be escaped, plus a trailing NULL */
-+		if ((clid = alloca(strlen(cdr->clid) * 2 + 1)) != NULL)
-+			PQescapeString(clid, cdr->clid, strlen(cdr->clid));
-+		if ((dcontext = alloca(strlen(cdr->dcontext) * 2 + 1)) != NULL)
-+			PQescapeString(dcontext, cdr->dcontext, strlen(cdr->dcontext));
-+		if ((channel = alloca(strlen(cdr->channel) * 2 + 1)) != NULL)
-+			PQescapeString(channel, cdr->channel, strlen(cdr->channel));
-+		if ((dstchannel = alloca(strlen(cdr->dstchannel) * 2 + 1)) != NULL)
-+			PQescapeString(dstchannel, cdr->dstchannel, strlen(cdr->dstchannel));
-+		if ((lastapp = alloca(strlen(cdr->lastapp) * 2 + 1)) != NULL)
-+			PQescapeString(lastapp, cdr->lastapp, strlen(cdr->lastapp));
-+		if ((lastdata = alloca(strlen(cdr->lastdata) * 2 + 1)) != NULL)
-+			PQescapeString(lastdata, cdr->lastdata, strlen(cdr->lastdata));
-+		if ((uniqueid = alloca(strlen(cdr->uniqueid) * 2 + 1)) != NULL)
-+			PQescapeString(uniqueid, cdr->uniqueid, strlen(cdr->uniqueid));
-+		if ((userfield = alloca(strlen(cdr->userfield) * 2 + 1)) != NULL)
-+			PQescapeString(userfield, cdr->userfield, strlen(cdr->userfield));
-+
-+		/* Check for all alloca failures above at once */
-+		if ((!clid) || (!dcontext) || (!channel) || (!dstchannel) || (!lastapp) || (!lastdata) || (!uniqueid) || (!userfield)) {
-+			ast_log(LOG_ERROR, "cdr_pgsql:  Out of memory error (insert fails)\n");
-+			ast_mutex_unlock(&pgsql_lock);
-+			return -1;
-+		}
-+
-+		ast_log(LOG_DEBUG,"cdr_pgsql: inserting a CDR record.\n");
-+
-+		snprintf(sqlcmd,sizeof(sqlcmd),"INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s','%s','%s')",timestr,clid,cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata,cdr->duration,cdr->billsec,ast_cdr_disp2str(cdr->disposition),cdr->amaflags, cdr->accountcode, uniqueid, userfield);
-+		ast_log(LOG_DEBUG,"cdr_pgsql: SQL command executed:  %s\n",sqlcmd);
-+	
-+		/* Test to be sure we're still connected... */
-+		/* If we're connected, and connection is working, good. */
-+		/* Otherwise, attempt reconnect.  If it fails... sorry... */
-+		if (PQstatus(conn) == CONNECTION_OK) {
-+			connected = 1;
-+		} else {
-+			ast_log(LOG_ERROR, "cdr_pgsql: Connection was lost... attempting to reconnect.\n");
-+			PQreset(conn);
-+			if (PQstatus(conn) == CONNECTION_OK) {
-+				ast_log(LOG_ERROR, "cdr_pgsql: Connection reestablished.\n");
-+				connected = 1;
-+			} else {
-+				pgerror = PQerrorMessage(conn);
-+				ast_log(LOG_ERROR, "cdr_pgsql: Unable to reconnect to database server %s. Calls will not be logged!\n", pghostname);
-+				ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);
-+				connected = 0;
-+				ast_mutex_unlock(&pgsql_lock);
-+				return -1;
-+			}
-+		}
-+		result = PQexec(conn, sqlcmd);
-+		if ( PQresultStatus(result) != PGRES_COMMAND_OK) {
-+                        pgerror = PQresultErrorMessage(result);
-+			ast_log(LOG_ERROR,"cdr_pgsql: Failed to insert call detail record into database!\n");
-+                        ast_log(LOG_ERROR,"cdr_pgsql: Reason: %s\n", pgerror);
-+			ast_mutex_unlock(&pgsql_lock);
-+			return -1;
-+		}
-+	}
-+	ast_mutex_unlock(&pgsql_lock);
-+	return 0;
-+}
-+
-+char *description(void)
-+{
-+	return desc;
-+}
-+
-+static int my_unload_module(void)
-+{ 
-+	if (conn)
-+		PQfinish(conn);
-+	conn = NULL;
-+	connected = 0;
-+	if (pghostname && hostname_alloc) {
-+		free(pghostname);
-+		pghostname = NULL;
-+		hostname_alloc = 0;
-+	}
-+	if (pgdbname && dbname_alloc) {
-+		free(pgdbname);
-+		pgdbname = NULL;
-+		dbname_alloc = 0;
-+	}
-+	if (pgdbuser && dbuser_alloc) {
-+		free(pgdbuser);
-+		pgdbuser = NULL;
-+		dbuser_alloc = 0;
-+	}
-+	if (pgdbsock && dbsock_alloc) {
-+		free(pgdbsock);
-+		pgdbsock = NULL;
-+		dbsock_alloc = 0;
-+	}
-+	if (pgpassword && password_alloc) {
-+		free(pgpassword);
-+		pgpassword = NULL;
-+		password_alloc = 0;
-+	}
-+	if (pgdbport && dbport_alloc) {
-+		free(pgdbport);
-+		pgdbport = NULL;
-+		dbport_alloc = 0;
-+	}
-+	ast_cdr_unregister(name);
-+	return 0;
-+}
-+
-+static int my_load_module(void)
-+{
-+	int res;
-+	struct ast_config *cfg;
-+	struct ast_variable *var;
-+        char *pgerror;
-+	char *tmp;
-+
-+	cfg = ast_load(config);
-+	if (!cfg) {
-+		ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CDR's: %s\n", config);
-+		return 0;
-+	}
-+	
-+	var = ast_variable_browse(cfg, "global");
-+	if (!var) {
-+		/* nothing configured */
-+		return 0;
-+	}
-+
-+	tmp = ast_variable_retrieve(cfg,"global","hostname");
-+	if (tmp) {
-+		pghostname = malloc(strlen(tmp) + 1);
-+		if (pghostname != NULL) {
-+			memset(pghostname, 0, strlen(tmp) + 1);
-+			hostname_alloc = 1;
-+			strncpy(pghostname, tmp, strlen(tmp));
-+		} else {
-+			ast_log(LOG_ERROR,"Out of memory error.\n");
-+			return -1;
-+		}
-+	} else {
-+		ast_log(LOG_WARNING,"PostgreSQL server hostname not specified.  Assuming localhost\n");
-+		pghostname = "localhost";
-+	}
-+
-+	tmp = ast_variable_retrieve(cfg,"global","dbname");
-+	if (tmp) {
-+		pgdbname = malloc(strlen(tmp) + 1);
-+		if (pgdbname != NULL) {
-+			memset(pgdbname, 0, strlen(tmp) + 1);
-+			dbname_alloc = 1;
-+			strncpy(pgdbname, tmp, strlen(tmp));
-+		} else {
-+			ast_log(LOG_ERROR,"Out of memory error.\n");
-+			return -1;
-+		}
-+	} else {
-+		ast_log(LOG_WARNING,"PostgreSQL database not specified.  Assuming asterisk\n");
-+		pgdbname = "asteriskcdrdb";
-+	}
-+
-+	tmp = ast_variable_retrieve(cfg,"global","user");
-+	if (tmp) {
-+		pgdbuser = malloc(strlen(tmp) + 1);
-+		if (pgdbuser != NULL) {
-+			memset(pgdbuser, 0, strlen(tmp) + 1);
-+			dbuser_alloc = 1;
-+			strncpy(pgdbuser, tmp, strlen(tmp));
-+		} else {
-+			ast_log(LOG_ERROR,"Out of memory error.\n");
-+			return -1;
-+		}
-+	} else {
-+		ast_log(LOG_WARNING,"PostgreSQL database user not specified.  Assuming root\n");
-+		pgdbuser = "root";
-+	}
-+
-+	tmp = ast_variable_retrieve(cfg,"global","password");
-+	if (tmp) {
-+		pgpassword = malloc(strlen(tmp) + 1);
-+		if (pgpassword != NULL) {
-+			memset(pgpassword, 0, strlen(tmp) + 1);
-+			password_alloc = 1;
-+			strncpy(pgpassword, tmp, strlen(tmp));
-+		} else {
-+			ast_log(LOG_ERROR,"Out of memory error.\n");
-+			return -1;
-+		}
-+	} else {
-+		ast_log(LOG_WARNING,"PostgreSQL database password not specified.  Assuming blank\n");
-+		pgpassword = "";
-+	}
-+
-+	tmp = ast_variable_retrieve(cfg,"global","port");
-+	if (tmp) {
-+		pgdbport = malloc(strlen(tmp) + 1);
-+		if (pgdbport != NULL) {
-+			memset(pgdbport, 0, strlen(tmp) + 1);
-+			dbport_alloc = 1;
-+			strncpy(pgdbport, tmp, strlen(tmp));
-+		} else {
-+			ast_log(LOG_ERROR,"Out of memory error.\n");
-+			return -1;
-+		}
-+	} else {
-+		ast_log(LOG_WARNING,"PostgreSQL database port not specified.  Using default 5432.\n");
-+		pgdbport = "5432";
-+	}
-+
-+	ast_destroy(cfg);
-+
-+	ast_log(LOG_DEBUG,"cdr_pgsql: got hostname of %s\n",pghostname);
-+	ast_log(LOG_DEBUG,"cdr_pgsql: got port of %s\n",pgdbport);
-+	if (pgdbsock)
-+		ast_log(LOG_DEBUG,"cdr_pgsql: got sock file of %s\n",pgdbsock);
-+	ast_log(LOG_DEBUG,"cdr_pgsql: got user of %s\n",pgdbuser);
-+	ast_log(LOG_DEBUG,"cdr_pgsql: got dbname of %s\n",pgdbname);
-+	ast_log(LOG_DEBUG,"cdr_pgsql: got password of %s\n",pgpassword);
-+
-+	conn = PQsetdbLogin(pghostname, pgdbport, NULL, NULL, pgdbname, pgdbuser, pgpassword);
-+	if (PQstatus(conn) != CONNECTION_BAD) {
-+		ast_log(LOG_DEBUG,"Successfully connected to PostgreSQL database.\n");
-+		connected = 1;
-+	} else {
-+                pgerror = PQerrorMessage(conn);
-+		ast_log(LOG_ERROR, "cdr_pgsql: Unable to connect to database server %s.  Calls will not be logged!\n", pghostname);
-+                ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);
-+		connected = 0;
-+	}
-+
-+	res = ast_cdr_register(name, desc, pgsql_log);
-+	if (res) {
-+		ast_log(LOG_ERROR, "Unable to register PGSQL CDR handling\n");
-+	}
-+	return res;
-+}
-+
-+int load_module(void)
-+{
-+	return my_load_module();
-+}
-+
-+int unload_module(void)
-+{
-+	return my_unload_module();
-+}
-+
-+int reload(void)
-+{
-+	my_unload_module();
-+	return my_load_module();
-+}
-+
-+int usecount(void)
-+{
-+	return connected;
-+}
-+
-+char *key()
-+{
-+	return ASTERISK_GPL_KEY;
-+}

Modified: trunk/rpms/asterisk/asterisk.spec
===================================================================
--- trunk/rpms/asterisk/asterisk.spec	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/asterisk/asterisk.spec	2005-04-05 09:57:17 UTC (rev 3107)
@@ -9,9 +9,9 @@
 #define prever RC2
 #define cvs 20041125
 
-Summary: The Asterisk PBX and telephony application and toolkit
+Summary: PBX and telephony application and toolkit
 Name: asterisk
-Version: 1.0.5
+Version: 1.0.7
 Release: %{?prever:0.%{prever}.}%{?cvs:1.%{cvs}.}1
 License: GPL
 Group: Applications/Internet
@@ -138,6 +138,12 @@
 
 
 %changelog
+* Tue Apr  5 2005 Matthias Saou <http://freshrpms.net> 1.0.7-1
+- Update to 1.0.7.
+
+* Tue Mar  8 2005 Matthias Saou <http://freshrpms.net> 1.0.6-1
+- Update to 1.0.6.
+
 * Wed Feb  2 2005 Matthias Saou <http://freshrpms.net> 1.0.5-1
 - Update to 1.0.5.
 - Don't create nor include sbin/safe_asterisk.orig.

Modified: trunk/rpms/asterisk-sounds/asterisk-sounds.spec
===================================================================
--- trunk/rpms/asterisk-sounds/asterisk-sounds.spec	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/asterisk-sounds/asterisk-sounds.spec	2005-04-05 09:57:17 UTC (rev 3107)
@@ -7,7 +7,7 @@
 
 Summary: Sound files for the Asterisk PBX and telephony application and toolkit
 Name: asterisk-sounds
-Version: 1.0.1
+Version: 1.0.7
 Release: %{?prever:0.%{prever}.}1
 License: BSD
 Group: Applications/Internet
@@ -51,10 +51,13 @@
 %files
 %defattr(0644, root, root, 0755)
 %doc README.txt sounds-extra.txt
-%{_var}/lib/asterisk/sounds
+%{_var}/lib/asterisk/sounds/
 
 
 %changelog
+* Tue Apr  5 2005 Matthias Saou <http://freshrpms.net> 1.0.7-1
+- Update to 1.0.7.
+
 * Wed Feb  2 2005 Matthias Saou <http://freshrpms.net> 1.0.1-1
 - Minor cleanups.
 

Deleted: trunk/rpms/zaptel/zaptel-1.0.4-makefile.patch
===================================================================
--- trunk/rpms/zaptel/zaptel-1.0.4-makefile.patch	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/zaptel/zaptel-1.0.4-makefile.patch	2005-04-05 09:57:17 UTC (rev 3107)
@@ -1,156 +0,0 @@
-diff -Naupr zaptel-1.0.4.orig/Makefile zaptel-1.0.4/Makefile
---- zaptel-1.0.4.orig/Makefile	2005-01-17 01:57:59.000000000 +0100
-+++ zaptel-1.0.4/Makefile	2005-02-02 12:46:49.046727824 +0100
-@@ -4,6 +4,9 @@
- #
- BASEADDR=0xd0000
- 
-+# Kernel version
-+KVERSION=$(uname -r)
-+
- #
- # Okay, the people at RedHat have to break everything they can possibly even attempt to.
- # So, we have to look in /usr/src/linux-2.4/include for header files given their brain dead
-@@ -13,15 +16,15 @@ BASEADDR=0xd0000
- # (assuming He's running Linux -- which we all know He must).
- #
- HOSTCC=gcc
--KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi)
-+KINCLUDES=/lib/modules/$(KVERSION)/build/include
- 
--CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
-+CFLAGS+=-I. -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
- CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
- CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)
- LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
--KFLAGS+=-I/usr/src/linux-2.4/include -O6
--KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net \
--	-Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/net
-+KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB
-+KFLAGS+=-Wall -Wstrict-prototypes -fomit-frame-pointer
-+KFLAGS+=-I. -Wall -I$(KINCLUDES) -I$(KINCLUDES)/net -I$(KINCLUDES)/net/wan
- KFLAGS+=$(shell [ -f $(KINCLUDES)/linux/modversions.h ] && echo "-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h")
- KFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-msoft-float -fsigned-char"; fi)
- #
-@@ -38,8 +41,8 @@ INSTALL_PREFIX=
- CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
- CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
- 
--BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
--MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi)
-+BUILDVER=$(shell if echo $(KVERSION) | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
-+MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/modprobe.conf ; fi)
- 
- ifeq (${BUILDVER},linux24)
- #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4
-@@ -67,7 +70,7 @@ BINS=ztcfg torisatool makefw ztmonitor z
- PRIMARY=torisa
- #PRIMARY=wcfxo
- PWD=$(shell pwd)
--KERNEL_SOURCE?=/lib/modules/`uname -r`/build
-+KERNEL_SOURCE?=/lib/modules/$(KVERSION)/build
- 
- all: $(BUILDVER)
- 
-@@ -240,43 +243,43 @@ ifeq ($(DYNFS),)
- 	rm -f $(INSTALL_PREFIX)/dev/zap/252
- 	rm -f $(INSTALL_PREFIX)/dev/zap/251
- 	rm -f $(INSTALL_PREFIX)/dev/zap/250
--	mknod $(INSTALL_PREFIX)/dev/zap/ctl c 196 0
--	mknod $(INSTALL_PREFIX)/dev/zap/timer c 196 253
--	mknod $(INSTALL_PREFIX)/dev/zap/channel c 196 254
--	mknod $(INSTALL_PREFIX)/dev/zap/pseudo c 196 255
--	N=1; \
--	while [ $$N -lt 250 ]; do \
--		rm -f $(INSTALL_PREFIX)/dev/zap/$$N; \
--		mknod $(INSTALL_PREFIX)/dev/zap/$$N c 196 $$N; \
--		N=$$[$$N+1]; \
--	done
-+#	mknod $(INSTALL_PREFIX)/dev/zap/ctl c 196 0
-+#	mknod $(INSTALL_PREFIX)/dev/zap/timer c 196 253
-+#	mknod $(INSTALL_PREFIX)/dev/zap/channel c 196 254
-+#	mknod $(INSTALL_PREFIX)/dev/zap/pseudo c 196 255
-+#	N=1; \
-+#	while [ $$N -lt 250 ]; do \
-+#		rm -f $(INSTALL_PREFIX)/dev/zap/$$N; \
-+#		mknod $(INSTALL_PREFIX)/dev/zap/$$N c 196 $$N; \
-+#		N=$$[$$N+1]; \
-+#	done
- else
- 	@echo "**** Dynamic filesystem detected -- not creating device nodes"
- 	@echo "**** If you are running udev, read README.udev"
- endif
- 
- install:  all devices $(LIBTONEZONE)
--	install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg
-+	install -D -m 755 ztcfg $(INSTALL_PREFIX)/usr/sbin/ztcfg
- 	if [ -f sethdlc-new ]; then \
--		install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
-+		install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/usr/sbin/sethdlc; \
- 	elif [ -f sethdlc ]; then \
--		install -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \
-+		install -D -m 755 sethdlc $(INSTALL_PREFIX)/usr/sbin/sethdlc ; \
- 	fi
--	if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi
-+	if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/usr/sbin/zttool; fi
- 
- 	if [ -f zaptel.ko ]; then \
- 		for x in $(MODULESKO) ztdummy.ko; do \
--			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \
-+			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERSION)/misc/$$x ; \
- 		done; \
- 		if ! [ -f wcfxsusb.ko ]; then \
--			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
-+			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERSION)/misc/wcfxsusb.o; \
- 		fi; \
- 	else \
- 		for x in $(MODULESO); do \
--			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \
-+			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERSION)/misc/$$x ; \
- 		done; \
- 		if ! [ -f wcfxsusb.o ]; then \
--			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.ko; \
-+			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERSION)/misc/wcfxsusb.ko; \
- 		fi; \
- 	fi
- 
-@@ -287,11 +290,14 @@ install:  all devices $(LIBTONEZONE)
- 	install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
- 	( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
- 	[ `id -u` = 0 ] && /sbin/ldconfig || :
--	if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
--	cat $(MODCONF).bak | grep -v "alias char-major-250" | \
--	grep -v "post-install torisa /sbin/ztcfg" | \
--	grep -v "post-install wcfxsusb /sbin/ztcfg" | \
--	grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true
-+#	if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
-+#	cat $(MODCONF).bak | grep -v "alias char-major-250" | \
-+#
-+	mkdir -p `dirname $(MODCONF)`
-+	touch $(MODCONF)
-+#	grep -v "post-install torisa /sbin/ztcfg" | \
-+#	grep -v "post-install wcfxsusb /sbin/ztcfg" | \
-+#	grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true
- 	if ! grep "options torisa" $(MODCONF); then \
- 		echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \
- 	fi
-@@ -303,8 +309,8 @@ install:  all devices $(LIBTONEZONE)
- 		if ! grep "post-install $$x" $(MODCONF); then \
- 			if ! grep "install $$x " $(MODCONF); then \
- 				if [ "$$x" != "zaptel" ] ; then \
--					if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \
--					else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \
-+					if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /usr/sbin/ztcfg" >> $(MODCONF); \
-+					else echo "post-install $$x /usr/sbin/ztcfg" >> $(MODCONF); \
- 					fi; \
- 				fi; \
- 			fi; \
-@@ -312,7 +318,7 @@ install:  all devices $(LIBTONEZONE)
- 	done
- 
- 	if [ -d /etc/modutils ]; then \
--		/sbin/update-modules ; \
-+		[ `id -u` = 0 ] && /sbin/update-modules ; \
- 	fi
- 	[ `id -u` = 0 ] && /sbin/depmod -a || :
- 	[ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)

Added: trunk/rpms/zaptel/zaptel-1.0.6-makefile.patch
===================================================================
--- trunk/rpms/zaptel/zaptel-1.0.6-makefile.patch	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/zaptel/zaptel-1.0.6-makefile.patch	2005-04-05 09:57:17 UTC (rev 3107)
@@ -0,0 +1,53 @@
+diff -Naupr zaptel-1.0.6.orig/Makefile zaptel-1.0.6/Makefile
+--- zaptel-1.0.6.orig/Makefile	2005-02-07 05:20:33.000000000 +0100
++++ zaptel-1.0.6/Makefile	2005-03-10 19:23:35.631437440 +0100
+@@ -13,7 +13,8 @@ BASEADDR=0xd0000
+ # (assuming He's running Linux -- which we all know He must).
+ #
+ HOSTCC=gcc
+-KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi)
++[ -z "${KVERSION}" ] && KVERSION=`uname -r`
++KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /lib/modules/${KVERSION}/build ; fi)
+ 
+ CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
+ CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
+@@ -38,7 +39,7 @@ INSTALL_PREFIX=
+ CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
+ CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
+ 
+-BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
++BUILDVER=$(shell if echo ${KVERSION} | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
+ MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi)
+ 
+ ifeq (${BUILDVER},linux24)
+@@ -67,7 +68,7 @@ BINS=ztcfg torisatool makefw ztmonitor z
+ PRIMARY=torisa
+ #PRIMARY=wcfxo
+ PWD=$(shell pwd)
+-KERNEL_SOURCE?=/lib/modules/`uname -r`/build
++KERNEL_SOURCE=/lib/modules/${KVERSION}/build
+ 
+ all: $(BUILDVER)
+ 
+@@ -266,17 +266,17 @@ install:  all devices $(LIBTONEZONE)
+ 
+ 	if [ -f zaptel.ko ]; then \
+ 		for x in $(MODULESKO) ztdummy.ko; do \
+-			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \
++			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/${KVERSION}/misc/$$x ; \
+ 		done; \
+ 		if ! [ -f wcfxsusb.ko ]; then \
+-			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
++			rm -f $(INSTALL_PREFIX)/lib/modules/${KVERSION}/misc/wcfxsusb.o; \
+ 		fi; \
+ 	else \
+ 		for x in $(MODULESO); do \
+-			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \
++			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/${KVERSION}/misc/$$x ; \
+ 		done; \
+ 		if ! [ -f wcfxsusb.o ]; then \
+-			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.ko; \
++			rm -f $(INSTALL_PREFIX)/lib/modules/${KVERSION}/misc/wcfxsusb.ko; \
+ 		fi; \
+ 	fi
+ 

Modified: trunk/rpms/zaptel/zaptel.spec
===================================================================
--- trunk/rpms/zaptel/zaptel.spec	2005-04-05 09:51:17 UTC (rev 3106)
+++ trunk/rpms/zaptel/zaptel.spec	2005-04-05 09:57:17 UTC (rev 3107)
@@ -6,28 +6,28 @@
 
 # "uname -r" output of the kernel to build for, the running one
 # if none was specified with "--define 'kernel <uname -r>'"
-#%{!?kernel: %{expand: %%define kernel %(uname -r)}}
+%{!?kernel: %{expand: %%define kernel %(uname -r)}}
  
-#%define kversion %(echo %{kernel} | sed -e s/smp// -)
-#%define krelver  %(echo %{kversion} | tr -s '-' '_')
-#%if %(echo %{kernel} | grep -c smp)
-#        %{expand:%%define ksmp -smp}
-#%endif
+%define kversion %(echo %{kernel} | sed -e s/smp// -)
+%define krelver  %(echo %{kversion} | tr -s '-' '_')
+%if %(echo %{kernel} | grep -c smp)
+        %{expand:%%define ksmp -smp}
+%endif
 
-Summary: Zaptel telephony interface support
+Summary: Telephony interface support
 Name: zaptel
-Version: 1.0.4
-Release: %{?prever:0.%{prever}.}0
+Version: 1.0.7
+Release: %{?prever:0.%{prever}.}1
 License: GPL
 Group: System Environment/Libraries
 URL: http://www.asterisk.org/
 Source0: ftp://ftp.asterisk.org/pub/zaptel/zaptel-%{version}%{?prever:-%{prever}}.tar.gz
 Source1: zaptel-makedev.d.txt
-Patch: zaptel-1.0.4-makefile.patch
+Patch: zaptel-1.0.6-makefile.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-#Requires: kernel-module-zaptel
-#BuildRequires: newt-devel, kernel-source = %{kversion}, MAKEDEV
+BuildRequires: kernel-devel = %{kversion}
 BuildRequires: newt-devel, MAKEDEV
+Provides: %{name}-devel = %{version}-%{release}
 
 %description
 This package contains the libraries, device entries, startup scripts and tools
@@ -35,46 +35,50 @@
 interfaces.
 
 You will also need to install a kernel modules package matching your current
-kernel for everything to work, and edit /etc/modules.conf.
+kernel for everything to work, and edit /etc/modprobe.conf.
 
 
-#%package -n kernel%{?ksmp}-module-zaptel
-#Summary: Kernel modules for the Zaptel devices.
-#Release: %{release}_%{krelver}
-#Group: System Environment/Kernel
-#Requires: kernel%{?ksmp} = %{kversion}, /sbin/depmod
-#Provides: kernel-modules
-#%{?ksmp:Provides: kernel-module-zaptel = %{version}-%{release}_%{krelver}}
-#
-#%description -n kernel%{?ksmp}-module-zaptel
-#This package contains the zaptel kernel modules for the Linux kernel package :
-#%{kversion} (%{_target_cpu}%{?ksmp:, SMP}).
+%package -n kernel%{?ksmp}-module-zaptel
+Summary: Kernel modules required for some hardware to operate with Zaptel
+Release: %{release}_%{krelver}
+Group: System Environment/Kernel
+Requires: kernel%{?ksmp} = %{kversion}, /sbin/depmod
+Provides: kernel-modules
+%{?ksmp:Provides: kernel-module-zaptel = %{version}-%{release}_%{krelver}}
 
+%description -n kernel%{?ksmp}-module-zaptel
+This package contains the zaptel kernel modules for the Linux kernel package :
+%{kversion} (%{_target_cpu}%{?ksmp:, SMP}).
 
+
 %prep
 %setup -n zaptel-%{version}%{?prever:-%{prever}}
 %patch -p1 -b .makefile
 
 
 %build
-# Only build the binaries, not the kernel modules
-%{__perl} -pi -e 's|^all.*|all: \$(BINS)|g' Makefile
 export CFLAGS="%{optflags}"
-%{__make} %{?_smp_mflags}
+%{__make} %{?_smp_mflags} \
+    KVERSION="%{kversion}"
 
 
 %install
 %{__rm} -rf %{buildroot}
+# Install checks the presence of this file to decide which to modify
+%{__mkdir_p} %{buildroot}%{_sysconfdir}
+touch %{buildroot}%{_sysconfdir}/modprobe.conf
+# Main install
 %{__make} install \
-    KVERSION=%{kversion} \
-    INSTALL_PREFIX=%{buildroot} \
-    ROOT_PREFIX=%{buildroot}
+    KVERSION="%{kversion}" \
+    INSTALL_PREFIX="%{buildroot}" \
+    ROOT_PREFIX="%{buildroot}"
 
 # Install and generate all the device stuff
 %{__install} -Dp -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/makedev.d/zaptel
  
 # Create entry list
-/dev/MAKEDEV \
+[ -x /sbin/MAKEDEV ] && MAKEDEV=/sbin/MAKEDEV || MAKEDEV=/dev/MAKEDEV
+${MAKEDEV} \
     -c %{buildroot}%{_sysconfdir}/makedev.d \
     -d %{buildroot}/dev -M zaptel | sed 's|%{buildroot}||g' | \
     grep -v 'dir /dev$' > device.list
@@ -91,9 +95,16 @@
         %{buildroot}/lib/modules/%{kernel}/kernel/
 
 # Move the modules config file back in order to put it in docs instead
-%{__mv} %{buildroot}%{_sysconfdir}/{modprobe,modules}.conf . || :
+%{__mv} %{buildroot}%{_sysconfdir}/modprobe.conf . || :
 
+# Move the binaries from /sbin back to /usr/sbin
+%{__mkdir_p} %{buildroot}%{_sbindir}
+%{__mv} %{buildroot}/sbin/* %{buildroot}%{_sbindir}/
 
+# Remove the backup of the empty file we created earlier
+%{__rm} -f %{buildroot}%{_sysconfdir}/modprobe.conf.bak || :
+
+
 %clean
 %{__rm} -rf %{buildroot}
 
@@ -104,13 +115,14 @@
 %postun
 /sbin/ldconfig
 
-#%post -n kernel%{?ksmp}-module-zaptel
-#/sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} >/dev/null 2>&1 || :
-#
-#%postun -n kernel%{?ksmp}-module-zaptel
-#/sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} >/dev/null 2>&1 || :
 
+%post -n kernel%{?ksmp}-module-zaptel
+/sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} &>/dev/null || :
 
+%postun -n kernel%{?ksmp}-module-zaptel
+/sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} &>/dev/null || :
+
+
 %files -f device.list
 %defattr(-, root, root, 0755)
 %doc ChangeLog README.fxsusb mod*.conf
@@ -119,18 +131,27 @@
 %config(noreplace) %{_sysconfdir}/zaptel.conf
 %{_sysconfdir}/makedev.d/zaptel
 %{_sysconfdir}/rc.d/init.d/zaptel
+%{_includedir}/*.h
+%{_includedir}/linux/*.h
 %{_sbindir}/ztcfg
 %{_sbindir}/zttool
-%{_includedir}/*.h
-%{_includedir}/linux/*.h
 %{_libdir}/*.so*
 
-#%files -n kernel%{?ksmp}-module-zaptel
-#%defattr(-, root, root, 0755)
-#/lib/modules/%{kernel}/kernel/misc/*
+%files -n kernel%{?ksmp}-module-zaptel
+%defattr(-, root, root, 0755)
+/lib/modules/%{kernel}/kernel/misc/
 
 
 %changelog
+* Tue Apr  5 2005 Matthias Saou <http://freshrpms.net/> 1.0.7-0
+- Update to 1.0.7.
+- This spec still doesn't build with mach (sub-package release tag bug).
+
+* Tue Mar  8 2005 Matthias Saou <http://freshrpms.net/> 1.0.6-0
+- Update to 1.0.6.
+- Change /dev/MAKEDEV calls to /sbin/MAKEDEV for FC3.
+- Rework and re-enable the kernel modules, only through kernel-devel, though.
+
 * Wed Feb  2 2005 Matthias Saou <http://freshrpms.net/> 1.0.4-0
 - Update to 1.0.4.
 - Updated makefile patch.




More information about the commits mailing list