[comp.sources.d] A patch to aid installing vn on a SYS V Rel 2.0 AT&T 3B5

roth@macom1.UUCP (dennis paul roth) (12/30/87)

First I thank Bob Mcqueer for posting the 8/87 version of vn. We have been using
the previous release for over a year here. Vn is the most popular news reading 
program on macom1. The readers here much prefer it to "vnews".

The system here is Unix System V Release 2.0 for the the AT&T 3B5. For
the benefit of those who want to bring up vn on similar systems I offer
the following observations and a patch.

To get the 8/87 release of vn to work on our System V Rel. 2.0 AT&T 3B5
I added #define	MAXPATHLEN 240 to std.c.
Changed LIBS = -ltermcap to LIBS = -lcurses -lPW in Makefile
Changed line 144 in svart.c from
		if (mkdir(dir,0755) != 0)
to

#ifdef SYSV
		(void) sprintf(msg,"mkdir %s",dir);
		if (system(msg) == 0)
			(void) chmod(dir,0755);
		else
#else
		if (mkdir(dir,0755) != 0)
#endif

And changed
#define DEF_ED "/usr/ucb/vi"	/* editor to use if no EDITOR variable */
to
#define DEF_ED "/usr/bin/vi"	/* editor to use if no EDITOR variable */
and
#define DEF_PRINT "/usr/ucb/lpr"		/* print command */
to
#define DEF_PRINT "/usr/bin/lp"		/* print command */
in config.h

When I tried to run the 8/87 version of vn it would die and leave this message.

	News order range error

This I traced to duplicate entries in my active file. I fixed this by
editing and cleaning up my active file, removing all duplicate entries.
After that the new vn worked fine. Keep up the good work Bob Mcqueer! Vn is 
appreciated around here.

The follow patch will make the same changes. Just feed this acticle into
the patch program if you have it.
############## patch starts here ###########################
Index: Makefile
49,51c49,51
< #LIBS = -ltermcap
< #EXTRAOBJS = tmpnam.o
< #CFLAGS = -O -DSYSV -Dregfree=free -Dindex=strchr -Drindex=strrchr
---
> LIBS = -lcurses -lPW
> EXTRAOBJS = tmpnam.o
> CFLAGS = -O -DSYSV -Dregfree=free -Dindex=strchr -Drindex=strrchr
75,78c75,76
< vn:
< 	@echo "PLEASE READ THE MAKEFILE"
< #vn:	$(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS)
< #	cc -o vn $(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS) $(LIBS)
---
> vn:	$(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS)
> 	cc -s -o vn $(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS) $(LIBS)
Index: config.h
9c9
< #define DEF_ED "/usr/ucb/vi"	/* editor to use if no EDITOR variable */
---
> #define DEF_ED "/usr/bin/vi"	/* editor to use if no EDITOR variable */
13c13
< #define DEF_PRINT "/usr/ucb/lpr"		/* print command */
---
> #define DEF_PRINT "/usr/bin/lp"		/* print command */
Index: std.c
16a17
> #define	MAXPATHLEN 240
Index: svart.c
144c144,151
< 		if (mkdir(dir,0755) != 0)
---
> #ifdef SYSV
> 		(void) sprintf(msg,"mkdir %s",dir);
> 		if (system(msg) == 0)
> 			(void) chmod(dir,0755);
> 		else
> #else
> 		if (mkdir(dir,0755) != 0)
> #endif
-- 
Dennis Roth @ CENTEL Information Systems, Inc. 5515 Security Lane, Rockville, 
Maryland, 20852, (301) 984-3636         
{decuac, grebyn, netsys}!macom1!roth 
DZY DZY 001E - ABEND ERROR 01 S 14F4 302C AABF  ABORT

bobm@rtech.UUCP (Bob McQueer) (01/14/88)

These bugs are addressed in the patches sent out in comp.sources.bugs
also.  The duplicate active entries should result in a non-fatal
warning message with those patches.  There are some other things you'll
want fixes for in that patch set, also.  Rich Salz indicates that the
source will eventually be coming out in comp.sources.unix - I sent him
an updated archive with patches, which I hope is what comes out.  Look
for version 1/88.  If that's the version, it already has the fixes.

The 1/88 patch set doesn't include any makefile changes for where to get
termcap and the regular expression library, however.  For certain versions
of SYS V you may have to change that, apparently.