[packages/dahdi-tools] - updated to 3.3.0, patched for pppd 2.5.0
qboosh
qboosh at pld-linux.org
Sun Dec 10 18:38:35 CET 2023
commit 11fe800f0f214157d0660fd64d95dad47346f70f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Dec 10 18:12:17 2023 +0100
- updated to 3.3.0, patched for pppd 2.5.0
dahdi-tools-pppd.patch | 200 +++++++++++++++++++++++++++++++++++++++++++++++++
dahdi-tools.spec | 20 ++---
link.patch | 22 ------
3 files changed, 210 insertions(+), 32 deletions(-)
---
diff --git a/dahdi-tools.spec b/dahdi-tools.spec
index 14768a2..8b957de 100644
--- a/dahdi-tools.spec
+++ b/dahdi-tools.spec
@@ -6,16 +6,16 @@
Summary: DAHDI telephony device support
Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI
Name: dahdi-tools
-Version: 3.1.0
+Version: 3.3.0
Release: 1
License: GPL v2
Group: Applications/System
Source0: http://downloads.asterisk.org/pub/telephony/dahdi-tools/%{name}-%{version}.tar.gz
-# Source0-md5: bc9f39264e5a862dde92f206c55d1162
+# Source0-md5: 237e35e7fc5def7d339b088656a7b983
Source1: dahdi.init
Source2: dahdi.sysconfig
Patch0: %{name}-includes.patch
-Patch1: link.patch
+Patch1: %{name}-pppd.patch
URL: http://www.asterisk.org/
BuildRequires: asciidoc
BuildRequires: autoconf >= 2.59
@@ -27,13 +27,13 @@ BuildRequires: libusb-devel >= 1.0.9
BuildRequires: newt-devel
BuildRequires: perl-base
BuildRequires: perl-tools-pod
-%{?with_ppp:BuildRequires: ppp-plugin-devel}
+%{?with_ppp:BuildRequires: ppp-plugin-devel >= 3:2.5.0}
BuildRequires: rpm-perlprov >= 4.1-13
BuildRequires: rpmbuild(macros) >= 1.745
Requires: libusb >= 1.0.9
-Obsoletes: dahdi-tools-utils
-Obsoletes: zaptel
-Obsoletes: zaptel-utils
+Obsoletes: dahdi-tools-utils < 2.6.1
+Obsoletes: zaptel < 2
+Obsoletes: zaptel-utils < 2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -48,7 +48,7 @@ Summary(pl.UTF-8): Pliki nagłówkowe DAHDI
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: dahdi-linux-devel
-Obsoletes: zaptel-devel
+Obsoletes: zaptel-devel < 2
%description devel
DAHDI development headers.
@@ -87,7 +87,7 @@ Group: Applications/Communications
Requires(post,preun): /sbin/chkconfig
Requires: %{name} = %{version}-%{release}
Requires: rc-scripts
-Obsoletes: zaptel-init
+Obsoletes: zaptel-init < 2
%description init
DAHDI boot-time initialization.
@@ -153,7 +153,7 @@ Perlowy interfejs do DAHDI.
Summary: DAHDI plugin for PPP daemon
Summary(pl.UTF-8): Wtyczka DAHDI dla demona PPP
Group: Libraries
-Requires: ppp
+Requires: ppp >= 3:2.5.0
%description -n ppp-plugin-dahdi
DAHDI plugin for PPP daemon.
diff --git a/dahdi-tools-pppd.patch b/dahdi-tools-pppd.patch
new file mode 100644
index 0000000..5b3498e
--- /dev/null
+++ b/dahdi-tools-pppd.patch
@@ -0,0 +1,200 @@
+--- dahdi-tools-3.3.0/configure.ac.orig 2023-12-07 07:27:33.000000000 +0100
++++ dahdi-tools-3.3.0/configure.ac 2023-12-10 16:29:22.580323430 +0100
+@@ -333,7 +333,7 @@ case "$with_ppp" in
+ *) ppp_path="$with_ppp" ;;
+ esac
+
+-level_file="$ppp_path/include/pppd/patchlevel.h"
++level_file="$ppp_path/include/pppd/pppdconf.h"
+ PPP_VERSION=
+ if test "$ppp_path" != '' && test -r "$level_file"; then
+ PPPD_VERSION=`awk -F '"' '/VERSION/ { print $$2; }' $level_file`
+@@ -345,7 +345,7 @@ case "$with_ppp" in
+ # If we asked explicitly for ppp support
+ if test "$PPPD_VERSION" = ''; then
+ # but have not detected it
+- AC_MSG_ERROR(failed to find pppd/patchlevel.h: no ppp support.)
++ AC_MSG_ERROR(failed to find pppd/pppdconf.h: no ppp support.)
+ fi
+ ;;
+ esac
+--- dahdi-tools-3.3.0/ppp/dahdi.c.orig 2023-12-07 07:27:33.000000000 +0100
++++ dahdi-tools-3.3.0/ppp/dahdi.c 2023-12-10 18:09:40.067723903 +0100
+@@ -35,21 +35,23 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <stdio.h>
+
+ #include <pppd/pppd.h>
+ #include <pppd/fsm.h>
+ #include <pppd/lcp.h>
+ #include <pppd/ipcp.h>
+ #include <pppd/ccp.h>
+-#include <pppd/pathnames.h>
++#include <pppd/options.h>
++#include <pppd/pppdconf.h>
+
+ #include <dahdi/user.h>
+
+ extern int new_style_driver;
+
+-const char pppd_version[] = VERSION;
++const char pppd_version[] = PPPD_VERSION;
+
+-#define _PATH_DAHDI_OPT _ROOT_PATH "/etc/ppp/options."
++#define _PATH_DAHDI_OPT "/etc/ppp/options."
+
+ #define DAHDI_MTU (DAHDI_DEFAULT_MTU_MRU - 16)
+ extern int kill_link;
+@@ -61,7 +63,7 @@ static option_t dahdi_options[] = {
+ { "device name", o_wild, (void *) &setdevname_dahdi,
+ "Serial port device name",
+ OPT_DEVNAM | OPT_PRIVFIX | OPT_NOARG | OPT_A2STRVAL | OPT_STATIC,
+- devnam},
++ NULL},
+ { NULL }
+ };
+
+@@ -74,16 +76,17 @@ static int connect_dahdi(void)
+ struct dahdi_params dahdi_params;
+ int res;
+ int x;
++ const char* ddevnam = ppp_devnam();
+
+- info("DAHDI device is '%s'\n", devnam);
++ info("DAHDI device is '%s'\n", ddevnam);
+
+- strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
++ ppp_set_pppdevnam(ddevnam);
+
+- if (strlen(devnam) && strcmp(devnam, "stdin")) {
++ if (strlen(ddevnam) && strcmp(ddevnam, "stdin")) {
+ /* Get the channel number */
+- dahdi_chan = atoi(devnam);
++ dahdi_chan = atoi(ddevnam);
+ if (dahdi_chan < 1) {
+- fatal("'%s' is not a valid device name\n", devnam);
++ fatal("'%s' is not a valid device name\n", ddevnam);
+ return -1;
+ }
+
+@@ -114,7 +117,7 @@ static int connect_dahdi(void)
+ res = ioctl(dahdi_fd, DAHDI_GET_PARAMS, &dahdi_params);
+
+ if (res) {
+- fatal("Device '%s' does not appear to be a DAHDI device\n", devnam ? devnam : "<stdin>");
++ fatal("Device '%s' does not appear to be a DAHDI device\n", ddevnam ? ddevnam : "<stdin>");
+ }
+
+ x = 1;
+@@ -123,7 +126,7 @@ static int connect_dahdi(void)
+ res = ioctl(dahdi_fd, DAHDI_HDLCPPP, &x);
+
+ if (res) {
+- fatal("Unable to put device '%s' into HDLC mode\n", devnam);
++ fatal("Unable to put device '%s' into HDLC mode\n", ddevnam);
+ close(dahdi_fd);
+ dahdi_fd = -1;
+ return -1;
+@@ -141,15 +144,16 @@ static void disconnect_dahdi(void)
+ {
+ int res;
+ int x = 0;
++ const char *ddevnam = ppp_devnam();
+ /* Throw out of HDLC mode */
+ res = ioctl(dahdi_fd, DAHDI_HDLCPPP, &x);
+
+ if (res) {
+- warn("Unable to take device '%s' out of HDLC mode\n", devnam);
++ warn("Unable to take device '%s' out of HDLC mode\n", ddevnam);
+ }
+
+ /* Close if it's not stdin */
+- if (strlen(devnam))
++ if (strlen(ddevnam))
+ close(dahdi_fd);
+ warn("Disconnect from DAHDI");
+
+@@ -165,8 +169,8 @@ static void dahdi_extra_options()
+ {
+ int ret;
+ char buf[256];
+- snprintf(buf, 256, _PATH_DAHDI_OPT "%s",devnam);
+- if(!options_from_file(buf, 0, 0, 1))
++ snprintf(buf, 256, _PATH_DAHDI_OPT "%s",ppp_devnam());
++ if(!ppp_options_from_file(buf, 0, 0, 1))
+ exit(EXIT_OPTION_ERROR);
+
+ }
+@@ -196,11 +200,6 @@ static void recv_config_dahdi(int mru,
+ error("Couldn't increase MRU to %d", mru);
+ }
+
+-static void set_xaccm_pppoe(int unit, ext_accm accm)
+-{
+- /* NOTHING */
+-}
+-
+
+
+ struct channel dahdi_channel;
+@@ -218,9 +217,10 @@ int setdevname_dahdi(const char *cp)
+ {
+ int ret;
+ int chan;
++ const char *ddevnam = ppp_devnam();
+
+ /* If already set, forgoe */
+- if (strlen(devnam))
++ if (strlen(ddevnam))
+ return 1;
+
+
+@@ -232,9 +232,9 @@ int setdevname_dahdi(const char *cp)
+ }
+ }
+
+- dahdi_copy_string(devnam, cp, sizeof(devnam));
++ ppp_set_devnam(cp);
+
+- info("Using DAHDI device '%s'\n", devnam);
++ info("Using DAHDI device '%s'\n", ppp_devnam());
+
+ ret = 1;
+
+@@ -242,7 +242,7 @@ int setdevname_dahdi(const char *cp)
+
+ the_channel = &dahdi_channel;
+
+- modem = 0;
++ ppp_set_modem(false);
+
+ lcp_allowoptions[0].neg_accompression = 0;
+ lcp_wantoptions[0].neg_accompression = 0;
+@@ -270,9 +270,12 @@ int setdevname_dahdi(const char *cp)
+
+ void plugin_init(void)
+ {
+- if (!ppp_available() && !new_style_driver)
++ static char def_devnam[256];
++ if (!ppp_check_kernel_support() && !new_style_driver)
+ fatal("Kernel doesn't support ppp_generic needed for DAHDI PPP");
+- add_options(dahdi_options);
++ strlcpy(def_devnam, ppp_devnam(), 256);
++ dahdi_options[0].addr2 = def_devnam;
++ ppp_add_options(dahdi_options);
+
+ info("DAHDI Plugin Initialized");
+ }
+@@ -283,8 +286,8 @@ struct channel dahdi_channel = {
+ check_options: NULL,
+ connect: &connect_dahdi,
+ disconnect: &disconnect_dahdi,
+- establish_ppp: &generic_establish_ppp,
+- disestablish_ppp: &generic_disestablish_ppp,
++ establish_ppp: &ppp_generic_establish,
++ disestablish_ppp: &ppp_generic_disestablish,
+ send_config: &send_config_dahdi,
+ recv_config: &recv_config_dahdi,
+ close: NULL,
diff --git a/link.patch b/link.patch
deleted file mode 100644
index b9e3941..0000000
--- a/link.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- dahdi-tools-3.1.0/xpp/mpptalk.c~ 2019-10-03 16:48:11.000000000 +0200
-+++ dahdi-tools-3.1.0/xpp/mpptalk.c 2020-08-24 11:51:44.540425525 +0200
-@@ -237,7 +237,7 @@
- MEMBER(MPP, TWS_PORT_GET_REPLY);
- MEMBER(MPP, TWS_PWR_GET);
- MEMBER(MPP, TWS_PWR_GET_REPLY);
--} PACKED members;
-+} PACKED mpp_members;
-
- /*
- * Statuses
---- dahdi-tools-3.1.0/xpp/xtalk/xtalk_sync.c~ 2019-10-03 16:48:11.000000000 +0200
-+++ dahdi-tools-3.1.0/xpp/xtalk/xtalk_sync.c 2020-08-24 11:52:00.910944115 +0200
-@@ -60,7 +60,7 @@
- MEMBER(XTALK, ACK);
- MEMBER(XTALK, PROTO_GET);
- MEMBER(XTALK, PROTO_GET_REPLY);
--} PACKED members;
-+} PACKED xtalk_members;
-
- const struct xtalk_protocol xtalk_sync_proto = {
- .name = "XTALK-SYNC",
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dahdi-tools.git/commitdiff/11fe800f0f214157d0660fd64d95dad47346f70f
More information about the pld-cvs-commit
mailing list