Initial v01.03.00

This commit is contained in:
Anton Leontiev 2014-07-15 21:44:37 +04:00
commit 47dcb6180e
10 changed files with 196 additions and 0 deletions

29
.SRCINFO Normal file
View file

@ -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

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
*.tar.gz
*.tar.bz2
*.tar.xz
*.tar.lz
src/
pkg/

39
PKGBUILD Normal file
View file

@ -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
}

View file

@ -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;

View file

@ -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

View file

@ -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");

View file

@ -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");

10
nmead.conf Normal file
View file

@ -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

18
nmead.script Normal file
View file

@ -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

8
nmead.service Normal file
View file

@ -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