[ptxdist] [PATCH 2/2] wvdial: Add package

2017-09-29 Thread Sascha Hauer
Back in the good old days wvdial was used to easily connect
a modem to the internet without having to write chat scripts
manually. Some people still use modems, so add support for
wvdial to ptxdist.

The original wvdial uses a homebrew build system not suitable
for cross compilation, so we replace it with autoconf/automake.

Signed-off-by: Sascha Hauer 
---
 patches/wvdial-1.61/0001-remove-build-files.patch  | 552 +
 .../0002-Add-autoconf-automake-files.patch | 292 +++
 patches/wvdial-1.61/autogen.sh |  27 +
 patches/wvdial-1.61/series |   2 +
 rules/wvdial.in|  32 ++
 rules/wvdial.make  |  69 +++
 6 files changed, 974 insertions(+)
 create mode 100644 patches/wvdial-1.61/0001-remove-build-files.patch
 create mode 100644 patches/wvdial-1.61/0002-Add-autoconf-automake-files.patch
 create mode 100755 patches/wvdial-1.61/autogen.sh
 create mode 100644 patches/wvdial-1.61/series
 create mode 100644 rules/wvdial.in
 create mode 100644 rules/wvdial.make

diff --git a/patches/wvdial-1.61/0001-remove-build-files.patch 
b/patches/wvdial-1.61/0001-remove-build-files.patch
new file mode 100644
index 0..6c561c08e
--- /dev/null
+++ b/patches/wvdial-1.61/0001-remove-build-files.patch
@@ -0,0 +1,552 @@
+From 451b4b47aca6c7e6e2daaf1e6941b327f8a6efbe Mon Sep 17 00:00:00 2001
+From: Sascha Hauer 
+Date: Fri, 29 Sep 2017 09:04:00 +0200
+Subject: [PATCH 1/2] remove build files
+
+Signed-off-by: Sascha Hauer 
+---
+ Makefile.in|  74 
+ config.defaults.mk |  35 
+ configure  |  13 ---
+ gen-cc |  26 --
+ wvrules-posix.mk   |  96 -
+ wvrules.mk | 248 -
+ 6 files changed, 492 deletions(-)
+ delete mode 100644 Makefile.in
+ delete mode 100644 config.defaults.mk
+ delete mode 100755 configure
+ delete mode 100755 gen-cc
+ delete mode 100644 wvrules-posix.mk
+ delete mode 100644 wvrules.mk
+
+diff --git a/Makefile.in b/Makefile.in
+deleted file mode 100644
+index ebe8c94..000
+--- a/Makefile.in
 /dev/null
+@@ -1,74 +0,0 @@
+-WVPACKAGE_NAME=@PACKAGE_NAME@
+-WVPACKAGE_STRING=@PACKAGE_STRING@
+-WVPACKAGE_TARNAME=@PACKAGE_TARNAME@
+-WVPACKAGE_VERSION=@PACKAGE_VERSION@
+-
+-prefix=/usr/local
+-WVSTREAMS_INC=
+-WVSTREAMS_LIB=
+-WVSTREAMS_BIN=$(prefix)/bin
+-WVSTREAMS_SRC=.
+-
+-PC_CFLAGS=$(shell pkg-config --cflags libwvstreams)
+-ifeq ($(PC_CFLAGS),)
+- $(error WvStreams does not appear to be installed)
+-endif
+-CPPFLAGS+=$(PC_CFLAGS)
+-
+-PC_LIBS=$(shell pkg-config --libs libwvstreams)
+-ifeq ($(PC_LIBS),)
+- $(error WvStreams does not appear to be installed)
+-endif
+-LIBS+=$(PC_LIBS)
+-
+-BINDIR=${prefix}/bin
+-MANDIR=${prefix}/share/man
+-PPPDIR=/etc/ppp/peers
+-
+-include wvrules.mk
+-
+-default: all papchaptest
+-all: wvdial.a wvdial wvdialconf pppmon
+-
+-wvdial.a: wvdialer.o wvmodemscan.o wvpapchap.o wvdialbrain.o \
+-  wvdialmon.o
+-
+-wvdial wvdialconf papchaptest pppmon: \
+-  LDFLAGS+=-luniconf -lwvstreams -lwvutils -lwvbase
+-
+-wvdial wvdialconf papchaptest pppmon: wvdial.a
+-
+-install-bin: all
+-  [ -d ${BINDIR}  ] || install -d ${BINDIR}
+-  [ -d ${PPPDIR}  ] || install -d ${PPPDIR}
+-  install -m 0755 wvdial wvdialconf ${BINDIR}
+-  cp ppp.provider ${PPPDIR}/wvdial
+-  cp ppp.provider-pipe ${PPPDIR}/wvdial-pipe
+-
+-install-man:
+-  [ -d ${MANDIR}/man1 ] || install -d ${MANDIR}/man1
+-  [ -d ${MANDIR}/man5 ] || install -d ${MANDIR}/man5
+-  install -m 0644 wvdial.1 wvdialconf.1 ${MANDIR}/man1
+-  install -m 0644 wvdial.conf.5 ${MANDIR}/man5
+-
+-install: install-bin install-man
+-
+-uninstall-bin:
+-  rm -f ${BINDIR}/wvdial ${BINDIR}/wvdialconf
+-  rm -f ${PPPDIR}/wvdial
+-  rm -f ${PPPDIR}/wvdial-pipe
+-
+-uninstall-man:
+-  rm -f ${MANDIR}/man1/wvdial.1 ${MANDIR}/man1/wvdialconf.1
+-  rm -f ${MANDIR}/man5/wvdial.conf.5
+-
+-uninstall: uninstall-bin uninstall-man
+-
+-clean:
+-  rm -f wvdial wvdialconf wvdialmon papchaptest pppmon
+-
+-distclean:
+-  rm -f version.h Makefile
+-
+-.PHONY: clean all install-bin install-man install uninstall-bin uninstall-man 
\
+-  uninstall
+diff --git a/config.defaults.mk b/config.defaults.mk
+deleted file mode 100644
+index 1210f10..000
+--- a/config.defaults.mk
 /dev/null
+@@ -1,35 +0,0 @@
+-COMPILER_STANDARD=posix
+-EXEEXT=
+-INSTALL=/usr/bin/install -c
+-INSTALL_DATA=${INSTALL} -m 644
+-INSTALL_PROGRAM=${INSTALL}
+-INSTALL_SCRIPT=${INSTALL}
+-LN_S=ln -s
+-LN=ln
+-MOC=/usr/bin/moc
+-
+-LIBS_DBUS=-ldbus-1
+-LIBS_QT=-lqt-mt
+-LIBS_PAM=-lpam
+-LIBS_TCL=
+-
+-prefix=/usr/local
+-datadir=${prefix}/share
+-includedir=${prefix}/include
+-infodir=${prefix}/share/info
+-localstatedir=${prefix}/var
+-mandir=${prefix}/share/man

[ptxdist] [PATCH 1/2] wvstreams: Add package

2017-09-29 Thread Sascha Hauer
wvstreams is a C++ networking library which is added here because
it's used by wvdial. Upstream for this library is dead, so we
download the package from storage.googleapis.com.

To make it compile the debian patches are added.

WvStreams uses autoconf, but not automake which for us means
that parallel build is broken. Disable parallel build for now.

Signed-off-by: Sascha Hauer 
---
 .../0001-Fix-FTBFS-with-gcc-4.7.patch  | 54 
 .../0002-fix-FTBFS-with-OpenSSL-1.0.patch  | 25 ++
 .../0003-fix-FTBFS-with-glibc-2.12.patch   | 41 
 .../0004-Fix-compilation-with-gcc-6.patch  | 49 +++
 patches/wvstreams-4.6.1/series |  4 ++
 rules/wvstreams.in | 11 +
 rules/wvstreams.make   | 57 ++
 7 files changed, 241 insertions(+)
 create mode 100644 patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
 create mode 100644 
patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
 create mode 100644 patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
 create mode 100644 
patches/wvstreams-4.6.1/0004-Fix-compilation-with-gcc-6.patch
 create mode 100644 patches/wvstreams-4.6.1/series
 create mode 100644 rules/wvstreams.in
 create mode 100644 rules/wvstreams.make

diff --git a/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch 
b/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
new file mode 100644
index 0..b8597d29a
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
@@ -0,0 +1,54 @@
+From 912004e2faa35c95558a04b8d7ac7d132676d92f Mon Sep 17 00:00:00 2001
+From: Paul Tagliamonte 
+Date: Thu, 28 Sep 2017 15:50:05 +0200
+Subject: [PATCH 1/4] Fix FTBFS with gcc-4.7
+
+Small header include change. This is borderlinde cosmetic, but still
+needed to prevent the FTBFS.
+---
+ utils/wvcrash.cc | 2 +-
+ utils/wvcrashbase.cc | 2 +-
+ utils/wvuid.cc   | 1 +
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/wvcrash.cc b/utils/wvcrash.cc
+index 0417759..d5e1d87 100644
+--- a/utils/wvcrash.cc
 b/utils/wvcrash.cc
+@@ -26,7 +26,7 @@
+ #endif
+ 
+ // FIXME: this file mostly only works in Linux
+-#ifdef __linux
++#if 1
+ 
+ # include 
+ #include 
+diff --git a/utils/wvcrashbase.cc b/utils/wvcrashbase.cc
+index 8d67027..53e2037 100644
+--- a/utils/wvcrashbase.cc
 b/utils/wvcrashbase.cc
+@@ -66,7 +66,7 @@ const char *wvcrash_ring_buffer_get()
+ 
+ 
+ // FIXME: leaving of a will and catching asserts mostly only works in Linux
+-#ifdef __linux
++#if 1
+ 
+ #ifdef __USE_GNU
+ static const char *argv0 = program_invocation_short_name;
+diff --git a/utils/wvuid.cc b/utils/wvuid.cc
+index 7fa1035..709a484 100644
+--- a/utils/wvuid.cc
 b/utils/wvuid.cc
+@@ -33,6 +33,7 @@ wvuid_t wvgetuid()
+ 
+ #else // not WIN32
+ 
++#include 
+ 
+ WvString wv_username_from_uid(wvuid_t uid)
+ {
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch 
b/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
new file mode 100644
index 0..d308bc93c
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
@@ -0,0 +1,25 @@
+From f6a5f6c664be64c04d4e70c7a69993401318f36a Mon Sep 17 00:00:00 2001
+From: Luca Falavigna 
+Date: Thu, 28 Sep 2017 15:51:26 +0200
+Subject: [PATCH 2/4] fix FTBFS with OpenSSL 1.0
+
+---
+ crypto/wvx509.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/crypto/wvx509.cc b/crypto/wvx509.cc
+index 93dae06..41fa742 100644
+--- a/crypto/wvx509.cc
 b/crypto/wvx509.cc
+@@ -1157,7 +1157,7 @@ WvString WvX509::get_extension(int nid) const
+ 
+ if (ext)
+ {
+-X509V3_EXT_METHOD *method = X509V3_EXT_get(ext);
++X509V3_EXT_METHOD *method = (X509V3_EXT_METHOD 
*)X509V3_EXT_get(ext);
+ if (!method)
+ {
+ WvDynBuf buf;
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch 
b/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
new file mode 100644
index 0..183583aab
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
@@ -0,0 +1,41 @@
+From 013d7fc99cafd215a18ee2e3ad15c4428242 Mon Sep 17 00:00:00 2001
+From: Luca Falavigna 
+Date: Thu, 28 Sep 2017 15:52:12 +0200
+Subject: [PATCH 3/4] fix FTBFS with glibc 2.12
+
+---
+ ipstreams/wvunixdgsocket.cc | 2 --
+ streams/wvatomicfile.cc | 3 ---
+ 2 files changed, 5 deletions(-)
+
+diff --git a/ipstreams/wvunixdgsocket.cc b/ipstreams/wvunixdgsocket.cc
+index 41d2911..c8b539f 100644
+--- a/ipstreams/wvunixdgsocket.cc
 b/ipstreams/wvunixdgsocket.cc
+@@ -1,8 +1,6 @@
+ #include "wvunixdgsocket.h"
+-#ifdef MACOS
+ #include 
+ #include 
+-#endif
+ 
+