Subject: pkg/13377: Bugs in wmWeather pkg
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ben@wongs.net>
List: netbsd-bugs
Date: 07/04/2001 15:16:34
>Number:         13377
>Category:       pkg
>Synopsis:       wmWeather will not compile and has other bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 04 12:14:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ben Wong
>Release:        NetBSD-1.5
>Organization:
Georgia Tech
	
>Environment:
	
System: NetBSD hrududu.wongs.net 1.5 NetBSD 1.5 (HRUDUDU) #8: Tue May 15 04:47:24 EDT 2001 hackerb9@hrududu.wongs.net:/usr/src/sys/arch/i386/compile/HRUDUDU i386


>Description:

The wmWeather package has a few problems. First it will not compile
because it looks for X11/X.h and X11/xpm.h in $PREFIX/include instead
of /usr/X11R6/include. Second, it tries to links with X11 libraries in
$PREFIX. Third, it uses NetBSD's ftp as a replacement for wget in a
way that dumps messages to the user's screen inappropriately.

>How-To-Repeat:

cd /usr/pkgsrc/x11/wmweather; make update

>Fix:

The patch files patch-aa and patch-bb should be replaced (and distinfo
regenerated). Here are working versions of those two files:

<=====================  Cut here for patch-aa  ======================>
--- Makefile.orig	Tue Mar 16 19:59:39 1999
+++ Makefile	Wed Jul  4 14:49:13 2001
@@ -1,8 +1,6 @@
-CC     = gcc
-CFLAGS = -O2 -Wall
 INCDIR = -I/usr/X11R6/include/X11 -I/usr/X11R6/include
-DESTDIR= /usr/X11R6
-LIBDIR = -L/usr/X11R6/lib
+DESTDIR= ${PREFIX}
+LIBDIR = -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib
 # for linux
 LIBS   = -lXpm -lX11 -lXext
 # for Solaris
@@ -10,16 +8,14 @@
 OBJS   = wmWeather.o \
          xutils.o
 
-
 .c.o:
-	$(CC) $(CFLAGS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
-
+	$(CC) $(CFLAGS) -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} $(LIBDIR) $(LIBS)
 
 clean:
 	for i in $(OBJS) ; do \
@@ -28,7 +24,7 @@
 	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 $(DESTDIR)/bin
+	${BSD_INSTALL_SCRIPT} GrabWeather $(DESTDIR)/bin
+	${BSD_INSTALL_MAN} wmWeather.1 $(DESTDIR)/man/man1 
<========================  End of patch-aa  =========================>
 

<=====================  Cut here for patch-ab  ======================>
--- GrabWeather.orig	Fri Apr 16 17:41:53 1999
+++ GrabWeather	Wed Jul  4 14:49:13 2001
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/pkg/bin/perl
 
 #
 #    Grabs the latest local weather conditions from the National Weather Service (NWS).
@@ -44,13 +44,10 @@
 
 
 
+    # Use NetBSD's ftp to automatically try passive, if possible. 
     #
-    #  I think some of these wget command line options may cause problems
-    #  for some people? Dont know why... (Perhaps they have a ~/.wgetrc file
-    #  that overrides command line options?).
-    #
-    $GrabCmd = "wget --proxy=off --passive-ftp --tries 0 -q -O $home/.wmWeatherReports/$StationID.TXT $URL";
-    system "$GrabCmd";
+    $GrabCmd = "/usr/bin/ftp -V -r 5 -o $home/.wmWeatherReports/$StationID.TXT $URL";
+    system "$GrabCmd 2>/dev/null";
<========================  End of patch-ab  =========================>
 
 
 
>Release-Note:
>Audit-Trail:
>Unformatted: