From 4ad18632fb6f590611e6ed432b8e455bb0ff6b75 Mon Sep 17 00:00:00 2001 From: blshkv Date: Sun, 7 Feb 2016 17:03:47 +0800 Subject: [PATCH] minimodem: initial ebuild, issue #72 --- net-dialup/minimodem/Manifest | 1 + .../files/minimodem-0.22.1-ttytdd.patch | 68 +++++++++++++++++++ net-dialup/minimodem/minimodem-0.22.1.ebuild | 40 +++++++++++ .../base/package.accept_keywords/net-dialup | 2 + 4 files changed, 111 insertions(+) create mode 100644 net-dialup/minimodem/Manifest create mode 100644 net-dialup/minimodem/files/minimodem-0.22.1-ttytdd.patch create mode 100644 net-dialup/minimodem/minimodem-0.22.1.ebuild diff --git a/net-dialup/minimodem/Manifest b/net-dialup/minimodem/Manifest new file mode 100644 index 000000000..bacf45a3f --- /dev/null +++ b/net-dialup/minimodem/Manifest @@ -0,0 +1 @@ +DIST minimodem-0.22.1-1.tar.gz 58348 SHA256 a3195094106eb1b8b8223f1b8a547f9aa68db0fd68d23121eb73b2d86588957a SHA512 c51013873b5920e250d8bcef57258a305201956ac84d46d35dcabe4534e37f321156abb67e48089f61a0e89a1caf2de325a228969d027518a8e41d9afee8fe6a WHIRLPOOL 1b38be35b54a8c965f36e9a6c0119cb415dbe0efd12f6588988ced3d381b3a5fc109a63ee7c8824caea17cd1a0719e7c3f8a0b29bf80196400eeb52748fb1aea diff --git a/net-dialup/minimodem/files/minimodem-0.22.1-ttytdd.patch b/net-dialup/minimodem/files/minimodem-0.22.1-ttytdd.patch new file mode 100644 index 000000000..4a1222a4a --- /dev/null +++ b/net-dialup/minimodem/files/minimodem-0.22.1-ttytdd.patch @@ -0,0 +1,68 @@ +From f48257ac595afbc8f576d5ac4fcc180a608c6a25 Mon Sep 17 00:00:00 2001 +From: Rodrigo Menezes +Date: Tue, 19 Jan 2016 19:31:20 -0200 +Subject: [PATCH] TTY/TDD support + +--- + src/minimodem.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/minimodem.c b/src/minimodem.c +index 7cc8c46..812bdfa 100644 +--- a/src/minimodem.c ++++ b/src/minimodem.c +@@ -409,6 +409,7 @@ usage() + " 1200 Bell202 1200 bps --ascii\n" + " 300 Bell103 300 bps --ascii\n" + " rtty RTTY 45.45 bps --baudot --stopbits=1.5\n" ++ " tdd TTY/TDD 45.45 bps --baudot --stopbits=2.0\n" + " same NOAA SAME 520.83 bps --sync-byte=0xAB ...\n" + " callerid Bell202 CID 1200 bps\n" + " uic{-train,-ground} UIC-751-3 Train/Ground 600 bps\n" +@@ -781,6 +782,16 @@ main( int argc, char*argv[] ) + bfsk_n_data_bits = 5; + if ( bfsk_nstopbits < 0 ) + bfsk_nstopbits = 1.5; ++ } else if ( strncasecmp(modem_mode, "tdd",3)==0 ) { ++ bfsk_databits_decode = databits_decode_baudot; ++ bfsk_databits_encode = databits_encode_baudot; ++ bfsk_data_rate = 45.45; ++ if ( bfsk_n_data_bits == 0 ) ++ bfsk_n_data_bits = 5; ++ if ( bfsk_nstopbits < 0 ) ++ bfsk_nstopbits = 2.0; ++ bfsk_mark_f = 1400; ++ bfsk_space_f = 1800; + } else if ( strncasecmp(modem_mode, "same",5)==0 ) { + // http://www.nws.noaa.gov/nwr/nwrsame.htm + bfsk_data_rate = 520.0 + 5/6.0; +diff --git a/src/minimodem.1.in b/src/minimodem.1.in +index dc4f6b0..c95a0ee 100644 +--- a/src/minimodem.1.in ++++ b/src/minimodem.1.in +@@ -31,7 +31,7 @@ is a command-line program which decodes (or generates) audio + modem tones at any specified baud rate, using various framing protocols. + It acts a general-purpose software FSK modem, and includes support for + various standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME, +-and Caller-ID. ++TTY/TDD, and Caller-ID. + .PP + .B Minimodem + can play and capture audio modem tones in real-time via the system +@@ -67,6 +67,9 @@ default mark and space tone frequencies. + .B rtty + : RTTY 45.45 bps \-\-baudot \-\-stopbits 1.5 + .TP ++.B tdd ++: TTY/TDD 45.45 bps \-\-baudot \-\-stopbits 2.0 ++.TP + .B same + : SAME 520.83 bps \-\-startbits 0 \-\-stopbits 0 \-\-sync-byte 0xAB + .br +diff --git a/tests/81-tdd.test b/tests/81-tdd.test +new file mode 100755 +index 0000000..a55a2ac +--- /dev/null ++++ b/tests/81-tdd.test +@@ -0,0 +1 @@ ++exec ./self-test testdata-baudot.txt tdd diff --git a/net-dialup/minimodem/minimodem-0.22.1.ebuild b/net-dialup/minimodem/minimodem-0.22.1.ebuild new file mode 100644 index 000000000..397222810 --- /dev/null +++ b/net-dialup/minimodem/minimodem-0.22.1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit autotools autotools-utils + +DESCRIPTION="General-purpose software audio FSK modem." +HOMEPAGE="https://github.com/kamalmostafa/minimodem" +SRC_URI="https://github.com/kamalmostafa/minimodem/archive/${P}-1.tar.gz" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="alsa pulseaudio sndfile" + +DEPEND="" +RDEPEND="${RDEPEND} + sci-libs/fftw:3.0 + alsa? ( media-libs/alsa-lib ) + pulseaudio? ( media-sound/pulseaudio ) + sndfile? ( media-libs/libsndfile )" + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +S="${WORKDIR}/${PN}-${P}-1" + +src_prepare() { + #apply upstream patch + epatch "${FILESDIR}/${P}-ttytdd.patch" + eautoreconf +} + +src_configure() { + econf \ + $(use_with alsa ) \ + $(use_with pulseaudio ) \ + $(use_with sndfile ) +} diff --git a/profiles/pentoo/base/package.accept_keywords/net-dialup b/profiles/pentoo/base/package.accept_keywords/net-dialup index 39a0f073b..0010f7978 100644 --- a/profiles/pentoo/base/package.accept_keywords/net-dialup +++ b/profiles/pentoo/base/package.accept_keywords/net-dialup @@ -1 +1,3 @@ #~net-dialup/freeradius-2.2.0 + +~net-dialup/minimodem-0.22.1