diff options
author | dbj <dbj@pkgsrc.org> | 2018-06-04 07:18:47 +0000 |
---|---|---|
committer | dbj <dbj@pkgsrc.org> | 2018-06-04 07:18:47 +0000 |
commit | ca8b61a7f00acb577b86d259cf566c30f9b0ff52 (patch) | |
tree | 19309df31d4af1b33fe3e9435382de25af0ddf7a /ham/predict | |
parent | 1255b748046fdcc111003e49b8f5635576421a91 (diff) | |
download | pkgsrc-ca8b61a7f00acb577b86d259cf566c30f9b0ff52.tar.gz |
ham/predict: add new package for version 2.2.3
predict is a curses based satellite tracking/orbital prediction program
PREDICT provides real-time satellite tracking and orbital prediction
information to users and client applications in a variety of ways:
Through the system console
Through the command line
Through a network socket
Through the generation of audio speech
Data such as a spacecraft's sub-satellite point, azimuth and elevation
headings, Doppler shift, path loss, slant range, orbital altitude,
orbital velocity, footprint diameter, orbital phase (mean anomaly),
squint angle, eclipse depth, the time and date of the next AOS (or LOS
of the current pass), orbit number, and sunlight and visibility
information are provided on a real-time basis. PREDICT can also track
(or predict the position of) the Sun and Moon. PREDICT also has the
ability to control AZ/EL antenna rotators to maintain accurate
orientation in the direction of communication satellites. As an aid in
locating and tracking satellites through optical means, PREDICT can
articulate tracking coordinates and visibility information as plain
speech.
Diffstat (limited to 'ham/predict')
-rw-r--r-- | ham/predict/DESCR | 20 | ||||
-rw-r--r-- | ham/predict/MESSAGE | 23 | ||||
-rw-r--r-- | ham/predict/Makefile | 40 | ||||
-rw-r--r-- | ham/predict/PLIST | 46 | ||||
-rw-r--r-- | ham/predict/distinfo | 7 | ||||
-rw-r--r-- | ham/predict/files/vocalizer.sh | 95 | ||||
-rw-r--r-- | ham/predict/patches/patch-predict.c | 63 |
7 files changed, 294 insertions, 0 deletions
diff --git a/ham/predict/DESCR b/ham/predict/DESCR new file mode 100644 index 00000000000..e1da4d5c712 --- /dev/null +++ b/ham/predict/DESCR @@ -0,0 +1,20 @@ +PREDICT provides real-time satellite tracking and orbital prediction +information to users and client applications in a variety of ways: + + Through the system console + Through the command line + Through a network socket + Through the generation of audio speech + +Data such as a spacecraft's sub-satellite point, azimuth and elevation +headings, Doppler shift, path loss, slant range, orbital altitude, +orbital velocity, footprint diameter, orbital phase (mean anomaly), +squint angle, eclipse depth, the time and date of the next AOS (or LOS +of the current pass), orbit number, and sunlight and visibility +information are provided on a real-time basis. PREDICT can also track +(or predict the position of) the Sun and Moon. PREDICT also has the +ability to control AZ/EL antenna rotators to maintain accurate +orientation in the direction of communication satellites. As an aid in +locating and tracking satellites through optical means, PREDICT can +articulate tracking coordinates and visibility information as plain +speech. diff --git a/ham/predict/MESSAGE b/ham/predict/MESSAGE new file mode 100644 index 00000000000..c1af9b102bb --- /dev/null +++ b/ham/predict/MESSAGE @@ -0,0 +1,23 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1 2018/06/04 07:18:47 dbj Exp $ + +The TLE database included in this package has not been updated since 2006. +You probably should update it from online sources such as: + +https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt +https://www.celestrak.com/NORAD/elements/amateur.txt +https://www.celestrak.com/NORAD/elements/visual.txt +https://www.celestrak.com/NORAD/elements/weather.txt +https://www.celestrak.com/NORAD/elements/goes.txt +https://www.celestrak.com/NORAD/elements/stations.txt + +Similarly, many of the default satellites loaded on first run +are no longer available. You can edit them with the [E] menu +option and change the name and catalog number before loading new +elements. + +Alternately, you can edit the list in + ~/.predict/predict.tle +after first launch to include the satellites you wish to track. + +=========================================================================== diff --git a/ham/predict/Makefile b/ham/predict/Makefile new file mode 100644 index 00000000000..226246557e3 --- /dev/null +++ b/ham/predict/Makefile @@ -0,0 +1,40 @@ +# $NetBSD: Makefile,v 1.1 2018/06/04 07:18:47 dbj Exp $ +# + +DISTNAME= predict-2.2.3 +CATEGORIES= ham +#MASTER_SITES= http://www.amsat.org/amsat/ftp/software/Linux/ +MASTER_SITES= http://www.qsl.net/kd2bd/predict-2.2.3.tar.gz + +MAINTAINER= dbj@NetBSD.org +HOMEPAGE= http://www.qsl.net/kd2bd/predict.html +COMMENT= PREDICT - curses satellite tracking/orbital prediction program + +LICENSE= gnu-gpl-v2 + +USE_LANGUAGES= c + +do-configure: + printf "const char predictpath[] = \"${PREFIX}/share/predict/\";\n" > "${WRKSRC}/predict.h" + printf "const int soundcard = 1;\n" >> "${WRKSRC}/predict.h" + printf "const char version[] = \"$$(cat "${WRKSRC}/.version")\";\n" >> "${WRKSRC}/predict.h" + +do-build: + cd ${WRKSRC} && ${CC} ${CFLAGS} ${LDFLAGS} predict.c -o predict -lm -lncurses -lpthread + ${SED} -e 's|@PREFIX@|${PREFIX}|g' ${FILESDIR}/vocalizer.sh > ${WRKSRC}/vocalizer/vocalizer.sh + +INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 share/predict/default share/predict/vocalizer + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/predict ${DESTDIR}${PREFIX}/bin/ + ${INSTALL_SCRIPT} ${WRKSRC}/vocalizer/vocalizer.sh ${DESTDIR}${PREFIX}/share/predict/vocalizer/vocalizer + ${INSTALL_MAN} ${WRKSRC}/docs/man/predict.man ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/predict.1 + ${INSTALL_DATA} ${WRKSRC}/vocalizer/*.wav ${DESTDIR}${PREFIX}/share/predict/vocalizer/ + ${INSTALL_DATA} ${WRKSRC}/default/predict.* ${DESTDIR}${PREFIX}/share/predict/default/ + +# Run time only dependency on the play utility +DEPENDS+= sox-[0-9]*:../../audio/sox + +.include "../../mk/curses.buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/ham/predict/PLIST b/ham/predict/PLIST new file mode 100644 index 00000000000..e52d04ce2a2 --- /dev/null +++ b/ham/predict/PLIST @@ -0,0 +1,46 @@ +@comment $NetBSD: PLIST,v 1.1 2018/06/04 07:18:47 dbj Exp $ +bin/predict +man/man1/predict.1 +share/predict/default/predict.db +share/predict/default/predict.qth +share/predict/default/predict.tle +share/predict/vocalizer/alarm.wav +share/predict/vocalizer/approaching.wav +share/predict/vocalizer/azimuth.wav +share/predict/vocalizer/eclipse.wav +share/predict/vocalizer/eight.wav +share/predict/vocalizer/eighteen.wav +share/predict/vocalizer/eighty.wav +share/predict/vocalizer/elevation.wav +share/predict/vocalizer/eleven.wav +share/predict/vocalizer/fifteen.wav +share/predict/vocalizer/fifty.wav +share/predict/vocalizer/five.wav +share/predict/vocalizer/forty.wav +share/predict/vocalizer/four.wav +share/predict/vocalizer/fourteen.wav +share/predict/vocalizer/hundred.wav +share/predict/vocalizer/intro.wav +share/predict/vocalizer/los.wav +share/predict/vocalizer/nine.wav +share/predict/vocalizer/nineteen.wav +share/predict/vocalizer/ninety.wav +share/predict/vocalizer/one.wav +share/predict/vocalizer/receding.wav +share/predict/vocalizer/seven.wav +share/predict/vocalizer/seventeen.wav +share/predict/vocalizer/seventy.wav +share/predict/vocalizer/six.wav +share/predict/vocalizer/sixteen.wav +share/predict/vocalizer/sixty.wav +share/predict/vocalizer/sunlight.wav +share/predict/vocalizer/ten.wav +share/predict/vocalizer/thirteen.wav +share/predict/vocalizer/thirty.wav +share/predict/vocalizer/three.wav +share/predict/vocalizer/twelve.wav +share/predict/vocalizer/twenty.wav +share/predict/vocalizer/two.wav +share/predict/vocalizer/visible.wav +share/predict/vocalizer/vocalizer +share/predict/vocalizer/zero.wav diff --git a/ham/predict/distinfo b/ham/predict/distinfo new file mode 100644 index 00000000000..96df3928c80 --- /dev/null +++ b/ham/predict/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2018/06/04 07:18:47 dbj Exp $ + +SHA1 (predict-2.2.3.tar.gz) = 1eb4fcc9cf1aca79d890ef62b512763617453c9e +RMD160 (predict-2.2.3.tar.gz) = b0ec4efcad5ca530f787b2a83d3ba9bb80489d6e +SHA512 (predict-2.2.3.tar.gz) = 7ab964db85d8fa0e7f32d9d93904599e25d7b50baa79e80cb72407991bf5522aaa91d266b09ce25e1281e4f013124f7e955ca85b46e44cc1c2035331aa54bc6e +Size (predict-2.2.3.tar.gz) = 1639784 bytes +SHA1 (patch-predict.c) = 0c7c53edba937737694f98127df32f08df83695a diff --git a/ham/predict/files/vocalizer.sh b/ham/predict/files/vocalizer.sh new file mode 100644 index 00000000000..0df1498ebe4 --- /dev/null +++ b/ham/predict/files/vocalizer.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +trap 'kill -- $$' EXIT SIGINT + +WAVPATH="@PREFIX@/share/predict/vocalizer" +PLAYBIN="@PREFIX@/bin/play" + +playwav() +{ + "${PLAYBIN}" -q -V1 "$@" +} + +playfile() +{ + case $1 in + 0) playwav "${WAVPATH}/zero.wav" ;; + 1) playwav "${WAVPATH}/one.wav" ;; + 2) playwav "${WAVPATH}/two.wav" ;; + 3) playwav "${WAVPATH}/three.wav" ;; + 4) playwav "${WAVPATH}/four.wav" ;; + 5) playwav "${WAVPATH}/five.wav" ;; + 6) playwav "${WAVPATH}/six.wav" ;; + 7) playwav "${WAVPATH}/seven.wav" ;; + 8) playwav "${WAVPATH}/eight.wav" ;; + 9) playwav "${WAVPATH}/nine.wav" ;; + 10) playwav "${WAVPATH}/ten.wav" ;; + 11) playwav "${WAVPATH}/eleven.wav" ;; + 12) playwav "${WAVPATH}/twelve.wav" ;; + 13) playwav "${WAVPATH}/thirteen.wav" ;; + 14) playwav "${WAVPATH}/fourteen.wav" ;; + 15) playwav "${WAVPATH}/fifteen.wav" ;; + 16) playwav "${WAVPATH}/sixteen.wav" ;; + 17) playwav "${WAVPATH}/seventeen.wav" ;; + 18) playwav "${WAVPATH}/eighteen.wav" ;; + 19) playwav "${WAVPATH}/nineteen.wav" ;; + 20) playwav "${WAVPATH}/twenty.wav" ;; + 30) playwav "${WAVPATH}/thirty.wav" ;; + 40) playwav "${WAVPATH}/forty.wav" ;; + 50) playwav "${WAVPATH}/fifty.wav" ;; + 60) playwav "${WAVPATH}/sixty.wav" ;; + 70) playwav "${WAVPATH}/seventy.wav" ;; + 80) playwav "${WAVPATH}/eighty.wav" ;; + 90) playwav "${WAVPATH}/ninety.wav" ;; + *) playwav "${WAVPATH}/${1}.wav" ;; + esac +} + +saynumber() +{ + case $(($1 / 100)) in + [1-9]) playfile $(($1 / 100)) + playfile hundred ;; + esac + case $(($1 % 100 / 10)) in + [2-9]) playfile $(($1 % 100 / 10 * 10)) ;; + esac + if [ $1 = 0 ]; then + playfile $1 + elif [ $(($1 % 100)) -lt 20 -a $(($1 % 100)) -gt 0 ]; then + playfile $(($1 % 100)) + elif [ $(($1 % 100 % 10)) != 0 ]; then + playfile $(($1 % 100 % 10)) + fi +} + +if [ $# = 1 ]; then + case $1 in + eclipse) + playfile alarm + playfile eclipse + ;; + sunlight) + playfile alarm + playfile sunlight + ;; + los) + playfile los + ;; + esac +elif [ $# -gt 1 ]; then + playfile intro + saynumber "${1}" + playfile azimuth + saynumber "${2}" + playfile elevation + if [ "$3" = "+" ]; then + playfile approaching + elif [ "$3" = "-" ]; then + playfile receding + fi + if [ "$4" == "V" ]; then + playfile visible + fi +fi +exit 0 diff --git a/ham/predict/patches/patch-predict.c b/ham/predict/patches/patch-predict.c new file mode 100644 index 00000000000..0edcbc63d45 --- /dev/null +++ b/ham/predict/patches/patch-predict.c @@ -0,0 +1,63 @@ +$NetBSD: patch-predict.c,v 1.1 2018/06/04 07:18:47 dbj Exp $ + +sundry fixes to server mode: + fix buffer size issue looking for netport + provide default port if getservbyname fails + provide default proto if getprotobyname fails + fix inexplicable incorrect listen call +remove reference to exended ascii symbol for degrees + +--- predict.c.orig 2006-05-14 23:19:56.000000000 +0000 ++++ predict.c +@@ -172,7 +172,7 @@ double tsince, jul_epoch, jul_utc, eclip + moon_az, moon_el, moon_dx, moon_ra, moon_dec, moon_gha, moon_dv; + + char qthfile[50], tlefile[50], dbfile[50], temp[80], output[25], +- serial_port[15], resave=0, reload_tle=0, netport[6], ++ serial_port[15], resave=0, reload_tle=0, netport[8], + once_per_second=0, ephem[5], sat_sun_status, findsun, + calc_squint, database=0, xterm, io_lat='N', io_lon='W'; + +@@ -1984,6 +1984,7 @@ int passivesock(char *service, char *pro + + struct servent *pse; + struct protoent *ppe; ++ struct protoent ppedef = { 0, 0, 17 }; // udp + struct sockaddr_in sin; + int sd, type; + +@@ -1996,14 +1997,12 @@ int passivesock(char *service, char *pro + + else if ((sin.sin_port=htons((unsigned short)atoi(service)))==0) + { +- bailout("Can't get service"); +- exit(-1); ++ sin.sin_port=htons(1210); + } + + if ((ppe=getprotobyname(protocol))==0) + { +- bailout("Can't get protocol"); +- exit(-1); ++ ppe = &ppedef; + } + + if (strcmp(protocol,"udp")==0) +@@ -2025,7 +2024,7 @@ int passivesock(char *service, char *pro + exit(-1); + } + +- if ((type=SOCK_STREAM && listen(s,qlen))<0) ++ if (type==SOCK_STREAM && listen(sd,qlen)<0) + { + bailout("Listen fail"); + exit(-1); +@@ -5002,7 +5001,7 @@ char speak; + mvprintw(7+tshift,29,"%0.f ",(3600.0*sat_vel)*km2mi); + mvprintw(8+tshift,29,"%0.f ",3600.0*sat_vel); + +- mvprintw(18+bshift,3,"%+6.2f%c ",eclipse_depth/deg2rad,176); ++ mvprintw(18+bshift,3,"%+6.2f ",eclipse_depth/deg2rad); + mvprintw(18+bshift,20,"%5.1f",256.0*(phase/twopi)); + mvprintw(18+bshift,37,"%s",ephem); + |