aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Scardovi <marco@scardovi.com>2021-06-25 19:11:49 +0200
committerMarco Scardovi <marco@scardovi.com>2021-06-25 19:11:49 +0200
commite869241d43b6b12ce36eaa75c46418c59920ce9d (patch)
tree472da3803977200f5973be4bdae8e66c55b253b8 /net-dialup/atinout
parentdev-libs/libofono: removed as not required by phosh (diff)
downloadguru-e869241d43b6b12ce36eaa75c46418c59920ce9d.tar.gz
guru-e869241d43b6b12ce36eaa75c46418c59920ce9d.tar.bz2
guru-e869241d43b6b12ce36eaa75c46418c59920ce9d.zip
net-dialup/atinout: new package
atinout is a command line manager for the pinephone modem Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Marco Scardovi <marco@scardovi.com>
Diffstat (limited to 'net-dialup/atinout')
-rw-r--r--net-dialup/atinout/Manifest1
-rw-r--r--net-dialup/atinout/atinout-0.9.1.ebuild19
-rw-r--r--net-dialup/atinout/files/0001-make-gcc-happy-by-adding-fallthrough-comment.patch25
-rw-r--r--net-dialup/atinout/files/0002-do-not-rely-on-CR-in-modem-output.patch84
-rw-r--r--net-dialup/atinout/metadata.xml8
5 files changed, 137 insertions, 0 deletions
diff --git a/net-dialup/atinout/Manifest b/net-dialup/atinout/Manifest
new file mode 100644
index 000000000..71e1a00a7
--- /dev/null
+++ b/net-dialup/atinout/Manifest
@@ -0,0 +1 @@
+DIST atinout-0.9.1.tar.gz 24117 BLAKE2B b8d7f120d010d12f8acf620ddeb697c2e63d5b33711c2e717ba378f3a97fbc3ab8dafeceb2782779e33defc072923a2be21020e0826f9909f4707528baead926 SHA512 ae25b2c4f3e2a9b861a7fc7d8e469d0d9d7a230281266393ce8547abca7e2368a709db3293ca31c00d5599b1de12ae9c8cd2bc0beefce53fa30012b6a2d7764b
diff --git a/net-dialup/atinout/atinout-0.9.1.ebuild b/net-dialup/atinout/atinout-0.9.1.ebuild
new file mode 100644
index 000000000..1232e50b8
--- /dev/null
+++ b/net-dialup/atinout/atinout-0.9.1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="AT commands as input are sent to modem and responses given as output"
+HOMEPAGE="http://atinout.sourceforge.net/index.html"
+SRC_URI="https://netix.dl.sourceforge.net/project/atinout/v0.9.1/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+PATCHES=(
+ "${FILESDIR}"/0001-make-gcc-happy-by-adding-fallthrough-comment.patch
+ "${FILESDIR}"/0002-do-not-rely-on-CR-in-modem-output.patch
+)
+
+QA_PREBUILT="/usr/bin/atinout"
diff --git a/net-dialup/atinout/files/0001-make-gcc-happy-by-adding-fallthrough-comment.patch b/net-dialup/atinout/files/0001-make-gcc-happy-by-adding-fallthrough-comment.patch
new file mode 100644
index 000000000..ce7800fe0
--- /dev/null
+++ b/net-dialup/atinout/files/0001-make-gcc-happy-by-adding-fallthrough-comment.patch
@@ -0,0 +1,25 @@
+From ca2e04f8b069d269172f0d55d3716a809537f696 Mon Sep 17 00:00:00 2001
+From: Beralt Meppelink <b.meppelink@riwo.eu>
+Date: Fri, 27 Oct 2017 09:12:18 +0200
+Subject: [PATCH 1/2] make gcc happy by adding fallthrough comment
+
+---
+ atinout.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/atinout.c b/atinout.c
+index d04f300..924b5bc 100644
+--- a/atinout.c
++++ b/atinout.c
+@@ -150,7 +150,7 @@ static bool is_final_result(const char * const response)
+ if (strcmp(&response[1], "K\r\n") == 0) {
+ return true;
+ }
+- /* no break */
++ // fallthrough
+ default:
+ return false;
+ }
+--
+2.23.0
+
diff --git a/net-dialup/atinout/files/0002-do-not-rely-on-CR-in-modem-output.patch b/net-dialup/atinout/files/0002-do-not-rely-on-CR-in-modem-output.patch
new file mode 100644
index 000000000..593dc8538
--- /dev/null
+++ b/net-dialup/atinout/files/0002-do-not-rely-on-CR-in-modem-output.patch
@@ -0,0 +1,84 @@
+From 65dae46181119867cd8e93ca5b33d3b0cf3df08c Mon Sep 17 00:00:00 2001
+From: Beralt Meppelink <b.meppelink@riwo.eu>
+Date: Fri, 27 Oct 2017 10:42:50 +0200
+Subject: [PATCH 2/2] do not rely on CR in modem output
+
+---
+ atinout.c | 24 +++++++++++-------------
+ 1 file changed, 11 insertions(+), 13 deletions(-)
+
+diff --git a/atinout.c b/atinout.c
+index 924b5bc..4cd7689 100644
+--- a/atinout.c
++++ b/atinout.c
+@@ -34,7 +34,6 @@
+
+ #define MAX_LINE_LENGTH (4 * 1024)
+ static char buf[MAX_LINE_LENGTH];
+-static char buf2[MAX_LINE_LENGTH];
+
+ static struct option long_options[] = {
+ {"help", no_argument, NULL, 'h'},
+@@ -125,36 +124,36 @@ static bool is_final_result(const char * const response)
+ }
+ return false;
+ case 'B':
+- if (strcmp(&response[1], "USY\r\n") == 0) {
++ if (strcmp(&response[1], "USY\n") == 0) {
+ return true;
+- }
++ }
++
+ return false;
+
+ case 'E':
+- if (strcmp(&response[1], "RROR\r\n") == 0) {
++ if (strcmp(&response[1], "RROR\n") == 0) {
+ return true;
+ }
+ return false;
+ case 'N':
+- if (strcmp(&response[1], "O ANSWER\r\n") == 0) {
++ if (strcmp(&response[1], "O ANSWER\n") == 0) {
+ return true;
+ }
+- if (strcmp(&response[1], "O CARRIER\r\n") == 0) {
++ if (strcmp(&response[1], "O CARRIER\n") == 0) {
+ return true;
+ }
+- if (strcmp(&response[1], "O DIALTONE\r\n") == 0) {
++ if (strcmp(&response[1], "O DIALTONE\n") == 0) {
+ return true;
+ }
+ return false;
+ case 'O':
+- if (strcmp(&response[1], "K\r\n") == 0) {
++ if (strcmp(&response[1], "K\n") == 0) {
+ return true;
+ }
+ // fallthrough
+ default:
+ return false;
+ }
+-
+ }
+
+ int main(int argc, char *argv[])
+@@ -248,11 +247,10 @@ int main(int argc, char *argv[])
+ fprintf(stderr, "EOF from modem\n");
+ return EXIT_FAILURE;
+ }
+- strcpy(buf2, line);
+- strip_cr(buf2);
+- res = fputs(buf2, output);
++ strip_cr(line);
++ res = fputs(line, output);
+ if (res < 0) {
+- fprintf(stderr, "failed to write '%s' to output file (res = %d)\n", buf2, res);
++ fprintf(stderr, "failed to write '%s' to output file (res = %d)\n", line, res);
+ return EXIT_FAILURE;
+ }
+ } while (! is_final_result(line));
+--
+2.23.0
+
diff --git a/net-dialup/atinout/metadata.xml b/net-dialup/atinout/metadata.xml
new file mode 100644
index 000000000..144c8091c
--- /dev/null
+++ b/net-dialup/atinout/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>marco@scardovi.com</email>
+ <name>Marco Scardovi</name>
+ </maintainer>
+</pkgmetadata>