Import of wmWeather 1.31.
Submitted by Peter Stromberg <home@wilfried.net>. wmWeather monitors local weather conditions (temperature, dew point, pressure, humidity and wind direction and speed).
This commit is contained in:
parent
f2022b67e2
commit
9cf060dd31
21
x11/wmweather/Makefile
Normal file
21
x11/wmweather/Makefile
Normal file
@ -0,0 +1,21 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2001/01/09 22:13:42 naddy Exp $
|
||||
|
||||
DISTNAME= wmWeather-1.31
|
||||
PKGNAME= ${DISTNAME:L}
|
||||
CATEGORIES= x11
|
||||
NEED_VERSION= 1.348
|
||||
MASTER_SITES= http://nis-www.lanl.gov/~mgh/WindowMaker/
|
||||
HOMEPAGE= http://nis-www.lanl.gov/~mgh/WindowMaker/DockApps.shtml
|
||||
|
||||
MAINTAINER= Peter Stromberg <home@wilfried.net>
|
||||
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
RUN_DEPENDS= wget::net/wget
|
||||
|
||||
WRKSRC= ${WRKDIST}/Src
|
||||
|
||||
.include <bsd.port.mk>
|
3
x11/wmweather/files/md5
Normal file
3
x11/wmweather/files/md5
Normal file
@ -0,0 +1,3 @@
|
||||
MD5 (wmWeather-1.31.tar.gz) = f04693aa86d22099162cff3d0b5c9275
|
||||
RMD160 (wmWeather-1.31.tar.gz) = 60266955f7c9692ea73c1bc85f85f863d9f639e3
|
||||
SHA1 (wmWeather-1.31.tar.gz) = b03ac1ad93f9e942feca26cfad91c1ea0b92eeb9
|
42
x11/wmweather/patches/patch-Makefile
Normal file
42
x11/wmweather/patches/patch-Makefile
Normal file
@ -0,0 +1,42 @@
|
||||
$OpenBSD: patch-Makefile,v 1.1.1.1 2001/01/09 22:13:42 naddy Exp $
|
||||
--- Src/Makefile.orig Wed Mar 17 01:59:39 1999
|
||||
+++ Src/Makefile Tue Jan 9 18:21:05 2001
|
||||
@@ -1,8 +1,5 @@
|
||||
-CC = gcc
|
||||
-CFLAGS = -O2 -Wall
|
||||
-INCDIR = -I/usr/X11R6/include/X11 -I/usr/X11R6/include
|
||||
-DESTDIR= /usr/X11R6
|
||||
-LIBDIR = -L/usr/X11R6/lib
|
||||
+CFLAGS += -I${X11BASE}/include
|
||||
+LIBDIR = -L${X11BASE}/lib
|
||||
# for linux
|
||||
LIBS = -lXpm -lX11 -lXext
|
||||
# for Solaris
|
||||
@@ -11,15 +8,11 @@ OBJS = wmWeather.o \
|
||||
xutils.o
|
||||
|
||||
|
||||
-.c.o:
|
||||
- $(CC) $(CFLAGS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
|
||||
-
|
||||
-
|
||||
all: wmWeather.o wmWeather
|
||||
|
||||
wmWeather.o: wmWeather_master.xpm wmWeather_mask.xbm
|
||||
wmWeather: $(OBJS)
|
||||
- $(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $^ $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
for i in $(OBJS) ; do \
|
||||
@@ -28,7 +21,6 @@ clean:
|
||||
rm -f wmWeather
|
||||
|
||||
install:: wmWeather
|
||||
- install -c -s -m 0755 wmWeather $(DESTDIR)/bin
|
||||
- install -c -m 0755 GrabWeather $(DESTDIR)/bin
|
||||
- install -c -m 0644 wmWeather.1 $(DESTDIR)/man/man1
|
||||
-
|
||||
+ $(BSD_INSTALL_PROGRAM) wmWeather $(PREFIX)/bin
|
||||
+ $(BSD_INSTALL_SCRIPT) GrabWeather $(PREFIX)/bin
|
||||
+ $(BSD_INSTALL_MAN) wmWeather.1 $(PREFIX)/man/man1
|
108
x11/wmweather/patches/patch-wmWeather_c
Normal file
108
x11/wmweather/patches/patch-wmWeather_c
Normal file
@ -0,0 +1,108 @@
|
||||
$OpenBSD: patch-wmWeather_c,v 1.1.1.1 2001/01/09 22:13:42 naddy Exp $
|
||||
--- Src/wmWeather.c.orig Tue May 4 22:20:04 1999
|
||||
+++ Src/wmWeather.c Tue Jan 9 18:54:59 2001
|
||||
@@ -229,12 +229,12 @@ char dir[5];
|
||||
int Year, Month, Day;
|
||||
int Hours, Mins, Secs;
|
||||
int UpdateLTHour = 0.0, UpdateLTMin = 0.0, UpdateUTHour, UpdateUTMin;
|
||||
-long CurrentLocalTime;
|
||||
+time_t CurrentLocalTime;
|
||||
double UpdateUT, UpdateLT, UT, LT, DT, hour24();
|
||||
|
||||
|
||||
double jd(), CurrentJD;
|
||||
-char command[1024], Line[512], FileName[10];
|
||||
+char command[1024], Line[512], FileName[1024];
|
||||
int Tens, q, digit, chr;
|
||||
double Pressure, Temperature, sgn, Humidity, DewPoint, WindChill, val;
|
||||
double Direction, Speed;
|
||||
@@ -416,7 +416,7 @@ FILE *fp;
|
||||
/*
|
||||
* Read in weather data
|
||||
*/
|
||||
- sprintf(FileName, "%s/.wmWeatherReports/%s.dat", getenv("HOME"), StationID);
|
||||
+ snprintf(FileName, sizeof(FileName), "%s/.wmWeatherReports/%s.dat", getenv("HOME"), StationID);
|
||||
if ((fp = fopen(FileName, "r")) != NULL){
|
||||
|
||||
fgets(Line, 512, fp);
|
||||
@@ -713,7 +713,7 @@ FILE *fp;
|
||||
q = 0;
|
||||
i = (int)(Direction/360.0*16.0 + 0.5);
|
||||
if (i>15) i = 0;
|
||||
- strcpy(dir, CompassDirection[i]);
|
||||
+ strlcpy(dir, CompassDirection[i], sizeof(dir));
|
||||
len = strlen(dir);
|
||||
for (j=0; j<len; ++j){
|
||||
digit = (int)dir[j] - 48;
|
||||
@@ -816,7 +816,7 @@ UpToDate = 0;
|
||||
/*
|
||||
* Execute Perl script to grab the Latest METAR Report
|
||||
*/
|
||||
- sprintf(command, "GrabWeather %s &", StationID);
|
||||
+ snprintf(command, sizeof(command), "GrabWeather %s &", StationID);
|
||||
system(command);
|
||||
|
||||
ForceDownload = 0;
|
||||
@@ -868,7 +868,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(BackColor, argv[++i]);
|
||||
+ strlcpy(BackColor, argv[++i], sizeof(BackColor));
|
||||
|
||||
} else if (!strcmp(argv[i], "-tc")){
|
||||
|
||||
@@ -877,7 +877,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(StationTimeColor, argv[++i]);
|
||||
+ strlcpy(StationTimeColor, argv[++i], sizeof(StationTimeColor));
|
||||
|
||||
} else if (!strcmp(argv[i], "-lc")){
|
||||
|
||||
@@ -886,7 +886,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(LabelColor, argv[++i]);
|
||||
+ strlcpy(LabelColor, argv[++i], sizeof(LabelColor));
|
||||
|
||||
} else if (!strcmp(argv[i], "-wgc")){
|
||||
|
||||
@@ -895,7 +895,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(WindGustColor, argv[++i]);
|
||||
+ strlcpy(WindGustColor, argv[++i], sizeof(WindGustColor));
|
||||
|
||||
} else if (!strcmp(argv[i], "-dc")){
|
||||
|
||||
@@ -904,7 +904,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(DataColor, argv[++i]);
|
||||
+ strlcpy(DataColor, argv[++i], sizeof(DataColor));
|
||||
|
||||
} else if (!strcmp(argv[i], "-beaufort")){
|
||||
|
||||
@@ -944,7 +944,7 @@ void ParseCMDLine(int argc, char *argv[]
|
||||
print_usage();
|
||||
exit(-1);
|
||||
}
|
||||
- strcpy(StationID, StringToUpper(argv[++i]));
|
||||
+ strlcpy(StationID, StringToUpper(argv[++i]), sizeof(StationID));
|
||||
|
||||
} else if (!strcmp(argv[i], "-delay")) {
|
||||
|
||||
@@ -1131,7 +1131,7 @@ void ButtonPressEvent(XButtonEvent *xev)
|
||||
if (GotDoubleClick1) {
|
||||
GotFirstClick1 = 0;
|
||||
GotDoubleClick1 = 0;
|
||||
- sprintf(Command, "xmessage -center -file %s/.wmWeatherReports/%s.TXT &", getenv("HOME"), StationID);
|
||||
+ snprintf(Command, sizeof(Command), "xmessage -center -file %s/.wmWeatherReports/%s.TXT &", getenv("HOME"), StationID);
|
||||
system(Command);
|
||||
}
|
||||
|
1
x11/wmweather/pkg/COMMENT
Normal file
1
x11/wmweather/pkg/COMMENT
Normal file
@ -0,0 +1 @@
|
||||
dockable weather monitor
|
4
x11/wmweather/pkg/DESCR
Normal file
4
x11/wmweather/pkg/DESCR
Normal file
@ -0,0 +1,4 @@
|
||||
wmWeather monitors local weather conditions (temperature, dew point, pressure,
|
||||
humidity and wind direction and speed).
|
||||
|
||||
WWW: ${HOMEPAGE}
|
4
x11/wmweather/pkg/PLIST
Normal file
4
x11/wmweather/pkg/PLIST
Normal file
@ -0,0 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/01/09 22:13:42 naddy Exp $
|
||||
bin/GrabWeather
|
||||
bin/wmWeather
|
||||
man/man1/wmWeather.1
|
Loading…
Reference in New Issue
Block a user