Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2002 12:26:14 -0700 (PDT)
From:      Adam Weinberger <adam@vectors.cx>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/42333: update port: emulators/hercules
Message-ID:  <200209021926.g82JQEvT058397@vectors.cx>

next in thread | raw e-mail | index | archive | help

>Number:         42333
>Category:       ports
>Synopsis:       update port: emulators/hercules
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 02 12:30:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Adam Weinberger
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD smacky.vectors.cx 4.6-STABLE FreeBSD 4.6-STABLE #6: Sun Sep 1 21:17:14 PDT 2002 root@smacky.vectors.cx:/usr/src/sys/compile/smacky i386


	
>Description:
	these patches update emulators/hercules to 2.16.5
	
>How-To-Repeat:
	
>Fix:

	

	below are patches for Makefile and distinfo, and patches for the files/
	dir. pelase remove all files from files/ and then put these files in
	files/. files files files.

--- makefile.patch begins here ---
--- Makefile.orig	Mon Sep  2 10:40:58 2002
+++ Makefile	Mon Sep  2 12:15:02 2002
@@ -6,35 +6,34 @@
 #
 
 PORTNAME=	hercules
-PORTVERSION=	2.15
-PORTREVISION=	1
+PORTVERSION=	2.16.5
 CATEGORIES=	emulators
 MASTER_SITES=	http://www.conmicro.cx/hercules/
 
 MAINTAINER=	adam@vectors.cx
 
 GNU_CONFIGURE=	yes
+USE_REINPLACE=	yes
 
 post-patch:
 
-	@${PERL} -pi -e 's@lpthread@pthread@g' ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's@lpthread@pthread@g' ${WRKSRC}/configure
 
 do-install:
 
-	@for i in hercules dasdinit dasdisup dasdload dasdls dasdpdsu \
-		tapecopy tapemap tapesplt cckd2ckd cckdcdsk ckd2cckd \
-		cckdcomp cckdswap hetget hetinit hetmap hetupd dmap2hrc; \
-	do \
-		${INSTALL_PROGRAM} ${WRKSRC}/$$i ${PREFIX}/bin; \
-	done
+.for i in hercules dasdinit dasdisup dasdload dasdls dasdpdsu \
+	tapecopy tapemap tapesplt cckd2ckd cckdcdsk ckd2cckd \
+	cckdcomp cckdswap hetget hetinit hetmap hetupd dmap2hrc
+	${INSTALL_PROGRAM} ${WRKSRC}/$i ${PREFIX}/bin
+.endfor
 
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${PREFIX}/share/doc/hercules
-	@${RM} -f ${WRKSRC}/html/Makefile*
-	@for i in ${WRKSRC}/hercules.cnf ${WRKSRC}/html/* ; \
-	do \
-		${INSTALL_DATA} $$i ${PREFIX}/share/doc/hercules; \
-	done
+	@${MKDIR} ${DOCSDIR}
+.for i in ../hercules.cnf cckddasd.html hercconf.html hercfaq.html \
+	hercinst.html herclic.html hercload.html hercnew.html herctcp.html \
+	hercules.css index.html
+	${INSTALL_DATA} ${WRKSRC}/html/$i ${DOCSDIR}
+.endfor
 .endif
 	@${CAT} pkg-message
 
--- makefile.patch ends here ---

--- distinfo.patch begins here ---
--- distinfo.orig	Mon Sep  2 10:47:09 2002
+++ distinfo	Mon Sep  2 10:49:14 2002
@@ -1 +1 @@
-MD5 (hercules-2.15.tar.gz) = 8eb98b2b5663607fda075fc57f019172
+MD5 (hercules-2.16.5.tar.gz) = 5c23268223e2e74a08fd7d148a159834
--- distinfo.patch ends here ---

--- patch-feature.h begins here ---
--- feature.h.orig	Mon Sep  2 11:36:09 2002
+++ feature.h	Mon Sep  2 11:36:55 2002
@@ -479,4 +479,9 @@
  #define XSTORE_PAGEMASK	0x7FFFF000
 #endif
 
+#if defined(__FreeBSD__)
+ #define HAVE_MTIO_H
+#else
+ #define GNU_MTIO_SUPPORT
+#endif
 /* end of FEATURES.H */
--- patch-feature.h ends here ---

--- patch-hercules.h begins here ---
--- hercules.h.orig	Mon Sep  2 11:43:46 2002
+++ hercules.h	Mon Sep  2 11:44:56 2002
@@ -333,6 +333,9 @@
         BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual);
 typedef int DEVCF (struct _DEVBLK *dev);
 
+#if defined(HAVE_MTIO_H)
+ #include <sys/mtio.h>
+#endif
 
 /*-------------------------------------------------------------------*/
 /* Structure definition for the Vector Facility                      */
--- patch-hercules.h ends here ---

--- patch-tapecopy.c begins here ---
--- tapecopy.c.orig	Mon Sep  2 11:00:59 2002
+++ tapecopy.c	Mon Sep  2 11:03:21 2002
@@ -32,6 +32,7 @@
 static BYTE hdrlbl[] = "\xC8\xC4\xD9";  /* EBCDIC characters "HDR"   */
 static BYTE eoflbl[] = "\xC5\xD6\xC6";  /* EBCDIC characters "EOF"   */
 static BYTE eovlbl[] = "\xC5\xD6\xE5";  /* EBCDIC characters "EOV"   */
+#ifdef GNU_MTIO_SUPPORT
 static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO;
 static struct mt_tape_info densinfo[] = {
     {0x01, "NRZI (800 bpi)"},
@@ -59,6 +60,7 @@
     {0x8C, "EXB-8505 compressed"},
     {0x90, "EXB-8205 compressed"},
     {0, NULL}};
+#endif
 static BYTE buf[65500];
 
 /*-------------------------------------------------------------------*/
@@ -71,6 +73,7 @@
 /*-------------------------------------------------------------------*/
 static void print_status (BYTE *devname, long stat)
 {
+#ifdef GNU_MTIO_SUPPORT
     printf ("%s status: %8.8lX", devname, stat);
     if (GMT_EOF(stat)) printf (" EOF");
     if (GMT_BOT(stat)) printf (" BOT");
@@ -84,6 +87,7 @@
     if (GMT_D_800(stat)) printf (" 800");
     if (GMT_DR_OPEN(stat)) printf (" NOTAPE");
     printf ("\n");
+#endif
 
 } /* end function print_status */
 
@@ -104,10 +108,12 @@
         return -1;
     }
 
+#ifdef GNU_MTIO_SUPPORT
     print_status (devname, stblk.mt_gstat);
 
     if (GMT_EOD(stblk.mt_gstat)) return 1;
     if (GMT_EOT(stblk.mt_gstat)) return 1;
+#endif
 
     return 0;
 } /* end function print_status */
@@ -188,6 +194,7 @@
         exit (7);
     }
 
+#ifdef GNU_MTIO_SUPPORT
     /* Display tape status information */
     for (i = 0; tapeinfo[i].t_type != 0
                 && tapeinfo[i].t_type != stblk.mt_type; i++);
@@ -215,6 +222,7 @@
 
     /* Set the tape device to process variable length blocks */
     opblk.mt_op = MTSETBLK;
+#endif
     opblk.mt_count = 0;
     rc = ioctl (devfd, MTIOCTOP, (char*)&opblk);
     if (rc < 0)
--- patch-tapecopy.c ends here ---

--- patch-tapedev.c begins here ---
--- tapedev.c.orig	Wed Jul  3 13:21:52 2002
+++ tapedev.c	Mon Sep  2 11:43:24 2002
@@ -195,6 +195,7 @@
 /*-------------------------------------------------------------------*/
 /* Static data areas                                                 */
 /*-------------------------------------------------------------------*/
+#ifdef GNU_MTIO_SUPPORT
 static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO;
 static struct mt_tape_info densinfo[] = {
     {0x01, "NRZI (800 bpi)"},
@@ -222,6 +223,7 @@
     {0x8C, "EXB-8505 compressed"},
     {0x90, "EXB-8205 compressed"},
     {0, NULL}};
+#endif
 
 static PARSER ptab[] =
 {
@@ -1143,6 +1145,7 @@
 /*-------------------------------------------------------------------*/
 static U32 status_scsitape (DEVBLK *dev)
 {
+#ifdef HAVE_MTIO_H
 U32             stat;                   /* Tape status bits          */
 int             rc;                     /* Return code               */
 struct mtget    stblk;                  /* Area for MTIOCGET ioctl   */
@@ -1159,6 +1162,7 @@
                 dev->filename, strerror(errno));
         return 0;
     }
+#ifdef GNU_MTIO_SUPPORT
     stat = stblk.mt_gstat;
 
     /* Display tape status */
@@ -1191,10 +1195,14 @@
         dev->prvblkpos = -1;
         dev->blockid = 0;
     }
+#else
+	 stat = 0;
+#endif
 
     /* Return tape status */
     return stat;
 
+#endif
 } /* end function status_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1205,6 +1213,7 @@
 /*-------------------------------------------------------------------*/
 static int open_scsitape (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 int             i;                      /* Array subscript           */
 struct mtop     opblk;                  /* Area for MTIOCTOP ioctl   */
@@ -1249,6 +1258,7 @@
         return -1;
     }
 
+#ifdef GNU_MTIO_SUPPORT
     /* Intervention required if no tape is mounted */
     if (GMT_DR_OPEN(stblk.mt_gstat))
     {
@@ -1284,6 +1294,7 @@
 
     /* Set the tape device to process variable length blocks */
     opblk.mt_op = MTSETBLK;
+#endif
     opblk.mt_count = 0;
     rc = ioctl (dev->fd, MTIOCTOP, (char*)&opblk);
     if (rc < 0)
@@ -1312,6 +1323,12 @@
 
     return 0;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1
+
+#endif
 } /* end function open_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1324,6 +1341,7 @@
 /*-------------------------------------------------------------------*/
 static int read_scsitape (DEVBLK *dev, BYTE *buf, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 
     /* Read data block from SCSI tape device */
@@ -1347,6 +1365,12 @@
     /* Return block length or zero if tapemark  */
     return rc;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function read_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1358,6 +1382,7 @@
 static int write_scsitape (DEVBLK *dev, BYTE *buf, U16 len,
                         BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 
     /* Write data block to SCSI tape device */
@@ -1377,6 +1402,12 @@
     /* Return normal status */
     return 0;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function write_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1387,6 +1418,7 @@
 /*-------------------------------------------------------------------*/
 static int write_scsimark (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 struct mtop     opblk;                  /* Area for MTIOCTOP ioctl   */
 
@@ -1409,6 +1441,12 @@
     /* Return normal status */
     return 0;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function write_scsimark */
 
 /*-------------------------------------------------------------------*/
@@ -1421,6 +1459,7 @@
 /*-------------------------------------------------------------------*/
 static int fsb_scsitape (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 int             fsrerrno;               /* Value of errno after MTFSR*/
 U32             stat;                   /* Tape status bits          */
@@ -1435,6 +1474,7 @@
     /* Obtain tape status after forward space */
     stat = status_scsitape (dev);
 
+#ifdef GNU_MTIO_SUPPORT
     /* If I/O error and status indicates EOF, then a tapemark
        was detected, so increment the file number and return 0 */
     if (rc < 0 && fsrerrno == EIO && GMT_EOF(stat))
@@ -1443,6 +1483,7 @@
         dev->blockid++;
         return 0;
     }
+#endif
 
     /* Handle MTFSR error condition */
     if (rc < 0)
@@ -1461,6 +1502,12 @@
     /* Return +1 to indicate forward space successful */
     return +1;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function fsb_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1473,6 +1520,7 @@
 /*-------------------------------------------------------------------*/
 static int bsb_scsitape (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 int             bsrerrno;               /* Value of errno after MTBSR*/
 U32             stat;                   /* Tape status bits          */
@@ -1481,6 +1529,7 @@
     /* Obtain tape status before backward space */
     stat = status_scsitape (dev);
 
+#ifdef GNU_MTIO_SUPPORT
     /* Unit check if already at start of tape */
     if (GMT_BOT(stat))
     {
@@ -1489,6 +1538,7 @@
         *unitstat = CSW_CE | CSW_DE | CSW_UC;
         return -1;
     }
+#endif
 
     /* Backspace block on SCSI tape */
     opblk.mt_op = MTBSR;
@@ -1527,6 +1577,12 @@
     /* Return +1 to indicate backspace successful */
     return +1;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function bsb_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1538,6 +1594,7 @@
 /*-------------------------------------------------------------------*/
 static int fsf_scsitape (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 struct mtop     opblk;                  /* Area for MTIOCTOP ioctl   */
 
@@ -1563,6 +1620,12 @@
     /* Return normal status */
     return 0;
 
+#else
+
+	 logmsg ("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function fsf_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -1574,6 +1637,7 @@
 /*-------------------------------------------------------------------*/
 static int bsf_scsitape (DEVBLK *dev, BYTE *unitstat)
 {
+#ifdef HAVE_MTIO_H
 int             rc;                     /* Return code               */
 struct mtop     opblk;                  /* Area for MTIOCTOP ioctl   */
 
@@ -1600,6 +1664,12 @@
     /* Return normal status */
     return 0;
 
+#else
+
+	 logmsg("HHC286I SCSI Support is disabled\n");
+	 return -1;
+
+#endif
 } /* end function bsf_scsitape */
 
 /*-------------------------------------------------------------------*/
@@ -2726,7 +2796,9 @@
 
         case TAPEDEVT_SCSITAPE:
             stat = status_scsitape (dev);
+#ifdef GNU_MTIO_SUPPORT
             if (GMT_BOT(stat)) dev->sense[1] |= SENSE1_TAPE_LOADPT;
+#endif
             break;
 
         case TAPEDEVT_OMATAPE:
--- patch-tapedev.c ends here ---

--- patch-version.c begins here ---
--- version.c.orig	Mon Sep  2 11:15:53 2002
+++ version.c	Mon Sep  2 11:17:51 2002
@@ -106,6 +106,14 @@
     "No HET BZIP2 support",
 #endif
 
+#if defined(GNU_MTIO_SUPPORT)
+	 "Using GNU tape handling",
+#elif defined(HAVE_MTIO_H)
+	 "Using generic Unix tape handling",
+#else
+	 "No SCSI tape support",
+#endif
+
   " "
 
 };
--- patch-version.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209021926.g82JQEvT058397>