summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leontiev2014-07-15 21:44:37 +0400
committerAnton Leontiev2015-02-15 07:48:23 +0300
commit47dcb6180e7f01d85a2e9419fd82c76d96afe768 (patch)
treee967983d0a866525b87a7506f58ee2233ca169c9
downloadaur-nmead.tar.gz
Initial v01.03.00
-rw-r--r--.SRCINFO29
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD39
-rw-r--r--nmead-01.03.00-115200.patch13
-rw-r--r--nmead-01.03.00-makefile.patch12
-rw-r--r--nmead-01.03.00-trigraphs.patch12
-rw-r--r--nmead-01.03.00-types.patch49
-rw-r--r--nmead.conf10
-rw-r--r--nmead.script18
-rw-r--r--nmead.service8
10 files changed, 196 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..eb58ddcadbb3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = nmead
+ pkgdesc = Service that distributes NMEA data over the network
+ pkgver = 01.03.00
+ pkgrel = 2
+ url = http://home.hiwaay.net/~taylorc/gps/nmea-server/
+ arch = i686
+ arch = x86_64
+ arch = arm
+ license = GPL3
+ backup = etc/conf.d/nmead
+ source = http://home.hiwaay.net/~taylorc/gps/nmea-server/nmead.src.01.03.00.tar.gz
+ source = nmead-01.03.00-makefile.patch
+ source = nmead-01.03.00-115200.patch
+ source = nmead-01.03.00-trigraphs.patch
+ source = nmead-01.03.00-types.patch
+ source = nmead.service
+ source = nmead.script
+ source = nmead.conf
+ md5sums = 80274744764fc637b08d3d67bf9f9ad0
+ md5sums = 83a2bbc8c38f4c2c958b5dfe42202b0b
+ md5sums = 912367456b0d1c0ac1c67b1e1b0cf965
+ md5sums = 7488313dc8784679c54566d97a1b815a
+ md5sums = f9c39c6f53dd625093f93ae48566e847
+ md5sums = 9bc23011a395f6e64623b2c7f72a6da0
+ md5sums = 3a7158004de6513c79afae9bf51c9ef7
+ md5sums = 3a4e6ccd40b93e27038e1a67849f06b7
+
+pkgname = nmead
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..e6b6b4b8077d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.tar.gz
+*.tar.bz2
+*.tar.xz
+*.tar.lz
+src/
+pkg/ \ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a425bef20b3e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Contributor: Anton Leontiev <bunder /at/ t-25.ru>
+pkgname=nmead
+pkgver=01.03.00
+pkgrel=2
+pkgdesc='Service that distributes NMEA data over the network'
+arch=('i686' 'x86_64' 'arm')
+url='http://home.hiwaay.net/~taylorc/gps/nmea-server/'
+license=('GPL3')
+source=(http://home.hiwaay.net/~taylorc/gps/nmea-server/nmead.src.01.03.00.tar.gz
+ nmead-01.03.00-makefile.patch nmead-01.03.00-115200.patch nmead-01.03.00-trigraphs.patch nmead-01.03.00-types.patch
+ nmead.service nmead.script nmead.conf)
+backup=('etc/conf.d/nmead')
+md5sums=('80274744764fc637b08d3d67bf9f9ad0'
+ '83a2bbc8c38f4c2c958b5dfe42202b0b'
+ '912367456b0d1c0ac1c67b1e1b0cf965'
+ '7488313dc8784679c54566d97a1b815a'
+ 'f9c39c6f53dd625093f93ae48566e847'
+ '9bc23011a395f6e64623b2c7f72a6da0'
+ '3a7158004de6513c79afae9bf51c9ef7'
+ '3a4e6ccd40b93e27038e1a67849f06b7')
+
+prepare() {
+ patch -p0 -i nmead-01.03.00-makefile.patch
+ patch -p0 -i nmead-01.03.00-115200.patch
+ patch -p0 -i nmead-01.03.00-trigraphs.patch
+ patch -p0 -i nmead-01.03.00-types.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+ make
+}
+
+package() {
+ install -m755 -D $pkgname-$pkgver/nmead "$pkgdir/usr/bin/nmead"
+ install -m644 -D nmead.service $pkgdir/usr/lib/systemd/system/nmead.service
+ install -m755 -D nmead.script $pkgdir/usr/lib/systemd/scripts/nmead
+ install -m644 -D nmead.conf $pkgdir/etc/conf.d/nmead
+}
diff --git a/nmead-01.03.00-115200.patch b/nmead-01.03.00-115200.patch
new file mode 100644
index 000000000000..d0b993bff10f
--- /dev/null
+++ b/nmead-01.03.00-115200.patch
@@ -0,0 +1,13 @@
+diff -aur nmead-01.03.00/main.c nmead-01.03.00-patched/main.c
+--- nmead-01.03.00/main.c 2004-07-27 04:28:32.000000000 +0400
++++ nmead-01.03.00-patched/main.c 2014-07-02 10:46:07.844835705 +0400
+@@ -302,6 +302,9 @@
+ case 19200:
+ ttybaud = B19200;
+ break;
++ case 115200:
++ ttybaud = B115200;
++ break;
+ default:
+ ttybaud = B4800;
+ break;
diff --git a/nmead-01.03.00-makefile.patch b/nmead-01.03.00-makefile.patch
new file mode 100644
index 000000000000..7773e87ad013
--- /dev/null
+++ b/nmead-01.03.00-makefile.patch
@@ -0,0 +1,12 @@
+diff -aur nmead-01.03.00/Makefile nmead-01.03.00-patched/Makefile
+--- nmead-01.03.00/Makefile 2004-07-27 04:28:32.000000000 +0400
++++ nmead-01.03.00-patched/Makefile 2014-07-02 11:05:25.669932413 +0400
+@@ -50,7 +50,7 @@
+ #
+ #
+
+-ifndef $(RM)
++ifndef RM
+ RM := $(shell which rm)
+ endif
+
diff --git a/nmead-01.03.00-trigraphs.patch b/nmead-01.03.00-trigraphs.patch
new file mode 100644
index 000000000000..281434224688
--- /dev/null
+++ b/nmead-01.03.00-trigraphs.patch
@@ -0,0 +1,12 @@
+diff -aur nmead-01.03.00/main.c nmead-01.03.00-patched/main.c
+--- nmead-01.03.00/main.c 2014-07-02 10:47:00.534310242 +0400
++++ nmead-01.03.00-patched/main.c 2014-07-02 10:47:13.850844110 +0400
+@@ -356,7 +356,7 @@
+ fprintf (stderr, " default/current value is %d\n", ttybaud);
+ fprintf (stderr, " -i serial_port sets name of serial input device\n");
+ fprintf (stderr, " default/current value is %s\n", ttyport);
+- fprintf (stderr, " (normally a symbolic link to /dev/tty??????)\n");
++ fprintf (stderr, " (normally a symbolic link to /dev/ttyXXX)\n");
+ fprintf (stderr, " -p tcp_port sets port number on which the server will listen\n");
+ fprintf (stderr, " default/current value is %d\n", port);
+ fprintf (stderr, " -s file simulate data stream by reading log file\n");
diff --git a/nmead-01.03.00-types.patch b/nmead-01.03.00-types.patch
new file mode 100644
index 000000000000..2378ac1f6f6e
--- /dev/null
+++ b/nmead-01.03.00-types.patch
@@ -0,0 +1,49 @@
+diff -aur nmead-01.03.00/connection.c nmead-01.03.00-patched/connection.c
+--- nmead-01.03.00/connection.c 2004-07-27 04:28:32.000000000 +0400
++++ nmead-01.03.00-patched/connection.c 2014-07-02 10:53:06.553994225 +0400
+@@ -52,6 +52,7 @@
+ *
+ */
+
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <sys/types.h>
+@@ -87,7 +88,7 @@
+
+ /* Use the address of the newly-allocated memory block as the
+ key ID. */
+- qkey = ftok (".", (int) c);
++ qkey = ftok (".", (uintptr_t) c & 0xff);
+
+ c->msgbuffer = newmsgbuffer ();
+ if (c->msgbuffer == NULL) {
+diff -aur nmead-01.03.00/simtalk.c nmead-01.03.00-patched/simtalk.c
+--- nmead-01.03.00/simtalk.c 2004-07-27 04:28:32.000000000 +0400
++++ nmead-01.03.00-patched/simtalk.c 2014-07-02 10:58:05.431015411 +0400
+@@ -51,6 +51,7 @@
+ *
+ */
+
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -140,7 +141,7 @@
+ sem_init (&semtick, 0, 1);
+
+ ticker = (pthread_t *) malloc (sizeof (pthread_t));
+- pthread_create (ticker, NULL, tick, (void *) ti->tickinterval);
++ pthread_create (ticker, NULL, tick, (void *)(uintptr_t) ti->tickinterval);
+
+ while (1) {
+
+@@ -208,7 +209,7 @@
+ */
+ void * tick (void * arg)
+ {
+- int tickinterval = (int) arg;
++ int tickinterval = (int)(intptr_t) arg;
+
+ if (verbose >= 10)
+ printf ("tick: started\n");
diff --git a/nmead.conf b/nmead.conf
new file mode 100644
index 000000000000..5e3955afbe53
--- /dev/null
+++ b/nmead.conf
@@ -0,0 +1,10 @@
+# For more information about these paramaters see program help: 'nmead --help'
+
+# Serial output baud rate
+NMEAD_BAUD=115200
+
+# Serial input device
+NMEAD_TTY=/dev/ttyUSB0
+
+# Port number on which the server will listen
+# NMEAD_PORT=1155
diff --git a/nmead.script b/nmead.script
new file mode 100644
index 000000000000..ccb2c2fe1ca8
--- /dev/null
+++ b/nmead.script
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# source application-specific settings
+[ -f /etc/conf.d/nmead ] && . /etc/conf.d/nmead
+
+if [ ! -z "$NMEAD_BAUD" ]; then
+ NMEAD_OPTIONS+=" -b $NMEAD_BAUD"
+fi
+
+if [ ! -z "$NMEAD_TTY" ]; then
+ NMEAD_OPTIONS+=" -i $NMEAD_TTY"
+fi
+
+if [ ! -z "$NMEAD_PORT" ]; then
+ NMEAD_OPTIONS+=" -p $NMEAD_PORT"
+fi
+
+nmead $NMEAD_OPTIONS
diff --git a/nmead.service b/nmead.service
new file mode 100644
index 000000000000..9e9fdccbe8e2
--- /dev/null
+++ b/nmead.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Service that distributes NMEA data over the network
+
+[Service]
+ExecStart=/usr/lib/systemd/scripts/nmead
+
+[Install]
+WantedBy=multi-user.target