Index: head/astro/wmspaceweather/Makefile =================================================================== --- head/astro/wmspaceweather/Makefile (revision 558857) +++ head/astro/wmspaceweather/Makefile (revision 558858) @@ -1,30 +1,31 @@ # Created by: Chris Piazza # $FreeBSD$ PORTNAME= wmspaceweather PORTVERSION= 1.04 PORTREVISION= 5 CATEGORIES= astro windowmaker MASTER_SITES= https://api.opensuse.org/public/source/openSUSE:Factory/WindowMaker-applets/ \ ftp://ftp.canadatux.org/linux/windowmaker/ DISTNAME= wmSpaceWeather-${PORTVERSION} MAINTAINER= xride@FreeBSD.org COMMENT= DockApp that shows the weather at geosynchronous orbit LICENSE= GPLv2 RUN_DEPENDS= p5-Time-modules>=0:devel/p5-Time-modules +USES= shebangfix xorg + WRKSRC= ${WRKDIR}/${DISTNAME}/wmSpaceWeather -USES= shebangfix xorg SHEBANG_FILES= GetKp USE_XORG= x11 xext xpm ALL_TARGET= clean all MAKE_JOBS_UNSAFE= yes PLIST_FILES= bin/GetKp bin/wmSpaceWeather \ man/man1/wmSpaceWeather.1.gz .include Index: head/astro/wmspaceweather/files/patch-GetKp =================================================================== --- head/astro/wmspaceweather/files/patch-GetKp (revision 558857) +++ head/astro/wmspaceweather/files/patch-GetKp (revision 558858) @@ -1,29 +1,54 @@ ---- GetKp.orig 1999-02-12 05:42:01 UTC +--- GetKp.orig 2020-12-21 20:19:53 UTC +++ GetKp -@@ -5,7 +5,7 @@ +@@ -5,21 +5,21 @@ # - require "ctime.pl"; + use Time::CTime; ($Year, $Month, $Day) = &year_month_day(); -@@ -19,7 +19,7 @@ + +- if (-e "/tmp/DGD.txt"){ +- unlink("/tmp/DGD.txt"); ++ if (-e "/tmp/daily-geomagnetic-indices.txt"){ ++ unlink("/tmp/daily-geomagnetic-indices.txt"); } +- if (-e "/tmp/curind.txt"){ +- unlink("/tmp/curind.txt"); ++ if (-e "/tmp/current-space-weather-indices.txt"){ ++ unlink("/tmp/current-space-weather-indices.txt"); + } + - $grabcmd = "cd /tmp; wget --passive-ftp --tries 2 -q ftp://www.sec.noaa.gov/pub/indices/DGD.txt"; -+ $grabcmd = "cd /tmp; fetch -q ftp://ftp.sec.noaa.gov/pub/indices/DGD.txt"; ++ $grabcmd = "cd /tmp; fetch -q https://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt"; system "$grabcmd"; -@@ -68,7 +68,7 @@ +@@ -37,7 +37,7 @@ + $Kp{190001018} = 999; + + +- open(TmpFile, "/tmp/DGD.txt"); ++ open(TmpFile, "/tmp/daily-geomagnetic-indices.txt"); + while (){ + chop; + if ($_ =~ /^\d{4} \d{2} \d{2}\s*\d*/ ){ +@@ -68,12 +68,12 @@ # # Add in very latest stuff # - $grabcmd = "cd /tmp; wget --passive-ftp --tries 2 -q ftp://www.sec.noaa.gov/pub/latest/curind.txt"; -+ $grabcmd = "cd /tmp; fetch -q ftp://ftp.sec.noaa.gov/pub/latest/curind.txt"; ++ $grabcmd = "cd /tmp; fetch -q https://services.swpc.noaa.gov/text/current-space-weather-indices.txt"; system "$grabcmd"; %lmonstr = ( "Jan", 1, "Feb", 2, "Mar", 3, "Apr", 4, "May", 5, "Jun", 6, "Jul", 7, "Aug", 8, "Sep", 9, "Oct", 10, "Nov", 11, "Dec", 12); + @lval = ($lyear, $lmonstr{$lmon}, $ldom); +- open(TmpFile, "/tmp/curind.txt"); ++ open(TmpFile, "/tmp/current-space-weather-indices.txt"); + while (){ + chop; + if ($_ =~ /^:Geomagnetic_Values: (\d{4}) (.*) (\d{1,2})/){ Index: head/astro/wmspaceweather/files/patch-wmSpaceWeather.c =================================================================== --- head/astro/wmspaceweather/files/patch-wmSpaceWeather.c (revision 558857) +++ head/astro/wmspaceweather/files/patch-wmSpaceWeather.c (revision 558858) @@ -1,87 +1,87 @@ --- wmSpaceWeather.c.orig 1999-02-18 17:57:45 UTC +++ wmSpaceWeather.c @@ -115,7 +115,7 @@ XEvent event; int i, n, s, k, m, dt1, dt2; int Year, Month, Day, DayOfMonth, OldDayOfMonth; int Hours, Mins, Secs, OldSecs, xoff, D[10], xsize; -long CurrentLocalTime; +time_t CurrentLocalTime; int height, UpToDate, LEDOn; double UT, TU, TU2, TU3, T0, gmst, hour24(); -@@ -126,6 +126,7 @@ int Kp[8] = { -1, -1, -1, -1, -1, -1, +@@ -126,6 +126,7 @@ int Kp[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; double E1, E2, P1, P2, P3; char Xray[10], digit[2]; FILE *fp; +char FileName[1024]; @@ -249,13 +250,13 @@ FILE *fp; /* - * Check the Kp file every (approx.) 2 seconds. + * Check the Kp file every (approx.) 60 seconds. * Can significantly reduce this frequency later. But its * easier to debug this way... * Do this before trying to download again! The file may be there and it * may be Up-To-Date! */ - if (dt2 > 2){ + if (dt2 > 60){ dt2 = 0; @@ -272,13 +273,13 @@ FILE *fp; Secs = Time->tm_sec; UT = (double)Hours + (double)Mins/60.0 + (double)Secs/3600.0; CurrentJD = jd(Year, Month, Day, UT); - /* * Read in Kp values */ - if ((fp = fopen("/tmp/LatestKp.txt", "r")) != NULL){ + snprintf(FileName, sizeof(FileName), "/tmp/LatestKp.txt", getenv("HOME")); + if ((fp = fopen(FileName, "r")) != NULL){ for (i=0; i<8; ++i){ fscanf(fp, "%ld %d", &TimeTag[i], &Kp[i]); @@ -289,7 +290,7 @@ FILE *fp; fscanf(fp, "%lf", &P3); fscanf(fp, "%lf", &E1); fscanf(fp, "%lf", &E2); - fscanf(fp, "%10s", Xray); + fscanf(fp, "%9s", Xray); fclose(fp); } else { @@ -318,7 +319,7 @@ FILE *fp; LatestAvailJD = jd(Year, Month, Day, UT); DeltaT = (CurrentJD - LatestAvailJD)*24.0; - UpToDate = (DeltaT <= 3.0) ? 1 : 0; + UpToDate = (DeltaT <= 4.0) ? 1 : 0; if (!UpToDate){ -@@ -560,7 +561,7 @@ void ParseCMDLine(int argc, char *argv[] +@@ -560,7 +561,7 @@ void ParseCMDLine(int argc, char *argv[]) { } else if ((!strcmp(argv[i], "-url"))||(!strcmp(argv[i], "-u"))){ - strcpy(URL, argv[++i]); + strlcpy(URL, argv[++i], sizeof(URL)); } else { @@ -651,7 +652,7 @@ void pressEvent(XButtonEvent *xev){ if (GotDoubleClick1) { GotFirstClick1 = 0; GotDoubleClick1 = 0; - sprintf(Command, "netscape -remote 'openURL(%s)' || netscape '%s' &", URL, URL); + snprintf(Command, sizeof(Command), "netscape -remote 'openURL(%s)' || netscape '%s' &", URL, URL); system(Command); } Index: head/astro/wmspaceweather/files/patch-wmgeneral.c =================================================================== --- head/astro/wmspaceweather/files/patch-wmgeneral.c (nonexistent) +++ head/astro/wmspaceweather/files/patch-wmgeneral.c (revision 558858) @@ -0,0 +1,10 @@ +--- ../wmgeneral/wmgeneral.c.orig 2020-12-21 11:20:47.205960000 -0600 ++++ ../wmgeneral/wmgeneral.c 2020-12-21 11:21:15.735441000 -0600 +@@ -51,6 +51,7 @@ + XpmIcon wmgen; + Pixmap pixmask; + ++Display *display; + /*****************/ + /* Mouse Regions */ + /*****************/ Property changes on: head/astro/wmspaceweather/files/patch-wmgeneral.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/astro/wmspaceweather/files/patch-wmgeneral.h =================================================================== --- head/astro/wmspaceweather/files/patch-wmgeneral.h (nonexistent) +++ head/astro/wmspaceweather/files/patch-wmgeneral.h (revision 558858) @@ -0,0 +1,11 @@ +--- ../wmgeneral/wmgeneral.h.orig 2020-12-21 11:21:23.324171000 -0600 ++++ ../wmgeneral/wmgeneral.h 2020-12-21 11:21:41.194688000 -0600 +@@ -28,7 +28,7 @@ + /* Global variable */ + /*******************/ + +-Display *display; ++extern Display *display; + + /***********************/ + /* Function Prototypes */ Property changes on: head/astro/wmspaceweather/files/patch-wmgeneral.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property