Date: Thu, 12 Dec 2013 16:27:04 +0000 (UTC) From: Christian Weisgerber <naddy@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r336277 - in head/editors/beav: . files Message-ID: <201312121627.rBCGR449082490@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: naddy Date: Thu Dec 12 16:27:03 2013 New Revision: 336277 URL: http://svnweb.freebsd.org/changeset/ports/336277 Log: Convert to staging, clean up the sgtty/termios mess, and generally overhaul the port. Added: head/editors/beav/files/patch-beav.1 (contents, props changed) head/editors/beav/files/patch-def.h (contents, props changed) Modified: head/editors/beav/Makefile head/editors/beav/files/patch-tcap.c head/editors/beav/files/patch-termio.c head/editors/beav/pkg-descr head/editors/beav/pkg-plist Modified: head/editors/beav/Makefile ============================================================================== --- head/editors/beav/Makefile Thu Dec 12 16:24:58 2013 (r336276) +++ head/editors/beav/Makefile Thu Dec 12 16:27:03 2013 (r336277) @@ -3,7 +3,7 @@ PORTNAME= beav PORTVERSION= 1.40.18 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= editors MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL} DISTNAME= ${PORTNAME}_${PORTVERSION:R}.orig @@ -18,23 +18,14 @@ COMMENT= Binary Editor And Viewer, a ful WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:R:S/.//} ALL_TARGET= beav - -MAN1= beav.1 - -NO_STAGE= yes -post-patch: - @${REINPLACE_CMD} -e 's|^CFLAGS=|CFLAGS+=-DUNIX -DBSD -DNOPROTO#|g ; \ - s|^CC=|CC?=|g ; \ - s|^(|\$$(|g' ${WRKSRC}/Makefile - @${REINPLACE_CMD} -e 's|/usr/share/doc/beav|${DOCSDIR}|g ; \ - s|beav140.txt.gz|beav.txt|' ${WRKSRC}/beav.1 +MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS} -DUNIX -DBSD -DNOPROTO" do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/beav ${PREFIX}/bin/beav - ${INSTALL_MAN} ${WRKSRC}/beav.1 ${MANPREFIX}/man/man1/beav.1 -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/beav140.txt ${DOCSDIR}/beav.txt -.endif + ${INSTALL_PROGRAM} ${WRKSRC}/beav ${STAGEDIR}${PREFIX}/bin/beav + ${INSTALL_MAN} ${WRKSRC}/beav.1 ${STAGEDIR}${PREFIX}/man/man1/beav.1 + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/beav140.txt ${STAGEDIR}${DOCSDIR}/beav.txt + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ + ${STAGEDIR}${PREFIX}/man/man1/beav.1 .include <bsd.port.mk> Added: head/editors/beav/files/patch-beav.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/beav/files/patch-beav.1 Thu Dec 12 16:27:03 2013 (r336277) @@ -0,0 +1,18 @@ +--- beav.1.orig 2013-12-12 17:16:34.000000000 +0100 ++++ beav.1 2013-12-12 17:17:40.000000000 +0100 +@@ -23,7 +23,7 @@ These commands can be used to navigate a + .br + \fImove-back-line\fB Ctl-P\fB moves up\fR + .br +-\fImove-forw-char\fb Ctl-F\fB moves right\fR ++\fImove-forw-char\fB Ctl-F\fB moves right\fR + .br + \fImove-forw-line\fB Ctl-N\fB moves down\fR + .br +@@ -59,5 +59,5 @@ The \fIquit-no-save\fR command,\fB Ctl-X + If there is any data that has not been saved you will be warned. + .PP + .SH FILES +-/usr/share/doc/beav/beav140.txt.gz ++%%PREFIX%%/share/doc/beav/beav.txt + Added: head/editors/beav/files/patch-def.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/beav/files/patch-def.h Thu Dec 12 16:27:03 2013 (r336277) @@ -0,0 +1,11 @@ +--- def.h.orig 2013-12-12 17:16:34.000000000 +0100 ++++ def.h 2013-12-12 17:17:40.000000000 +0100 +@@ -13,6 +13,8 @@ + #define DEF_DEF + #define LINT_ARGS 1 /* enable lint type checking */ + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + + #ifdef UNIX + #include <sys/types.h> Modified: head/editors/beav/files/patch-tcap.c ============================================================================== --- head/editors/beav/files/patch-tcap.c Thu Dec 12 16:24:58 2013 (r336276) +++ head/editors/beav/files/patch-tcap.c Thu Dec 12 16:27:03 2013 (r336277) @@ -1,11 +1,46 @@ ---- tcap.c -+++ tcap.c -@@ -89,7 +89,7 @@ +--- tcap.c.orig 2013-12-12 17:16:34.000000000 +0100 ++++ tcap.c 2013-12-12 17:17:40.000000000 +0100 +@@ -41,11 +41,12 @@ char *UP, PC, *CM, *CE, *CL, *SO, *SE, * + + #ifdef BSD + #include <sys/ioctl.h> ++#ifdef TIOCGWINSZ + struct winsize ttysize; +-#endif /* BSD */ +-#ifdef ULTRIX +-struct winsize ttysize; ++#else ++struct ttysize ttysize; + #endif ++#endif /* BSD */ + + void + putpad (str) +@@ -62,9 +63,6 @@ tcapopen () + char tcbuf[1024]; + char *tv_stype; + char err_str[NCOL]; +-#ifdef ULTRIX +- struct winsize ttysize; +-#endif + + nrow = NROW; + +@@ -89,7 +87,7 @@ tcapopen () #ifdef BSD -#ifdef ULTRIX -+#if 1 ++#ifdef TIOCGWINSZ if (ioctl (0, TIOCGWINSZ, &ttysize) == 0 && ttysize.ws_row > 0) { +@@ -103,7 +101,7 @@ tcapopen () + nrow = ttysize.ts_lines; + } + else +-#endif /* ULTRIX */ ++#endif /* TIOCGWINSZ */ + #endif /* BSD */ + + #ifndef OS2 Modified: head/editors/beav/files/patch-termio.c ============================================================================== --- head/editors/beav/files/patch-termio.c Thu Dec 12 16:24:58 2013 (r336276) +++ head/editors/beav/files/patch-termio.c Thu Dec 12 16:27:03 2013 (r336277) @@ -1,96 +1,130 @@ ---- termio.c -+++ termio.c -@@ -14,6 +14,9 @@ +--- termio.c.orig 2013-12-12 17:16:34.000000000 +0100 ++++ termio.c 2013-12-12 17:17:40.000000000 +0100 +@@ -8,11 +8,16 @@ + + #ifdef UNIX /* System V */ + ++#if defined(__GLIBC__) || \ ++ defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ++#define TERMIOS 1 ++#endif ++ + #include <unistd.h> + #include <errno.h> + #include <stdio.h> #include <signal.h> - #ifdef BSD +-#ifdef BSD ++#if defined(BSD) && !defined(TERMIOS) #include <sys/ioctl.h> -+#if defined(__OpenBSD__) || defined(__NetBSD__) -+#include <sys/ioctl_compat.h> -+#endif #else #ifdef OS2 - #ifndef __EMX__ -@@ -44,7 +47,7 @@ +@@ -28,7 +33,8 @@ + #include <sgtty.h> + #define O_NDELAY O_NONBLOCK + #else +-#ifdef __GLIBC__ ++#ifdef TERMIOS ++#include <sys/ioctl.h> + #include <termios.h> + #else + #include <termio.h> +@@ -44,7 +50,7 @@ int kbdpoll; /* in O_NDELAY mode int kbdqp; /* there is a char in kbdq */ char kbdq; /* char we've already read */ -#ifdef BSD -+#if 0 ++#if defined(BSD) && !defined(TERMIOS) struct sgttyb otermb; struct sgttyb ntermb; #else -@@ -58,8 +61,8 @@ +@@ -58,7 +64,7 @@ struct sgttyb otermio; /* original term struct sgttyb ntermio; /* charactoristics to use inside */ struct tchars tchars, tcharsorig; #else -#ifdef __GLIBC__ --#include <sys/ioctl.h> -+#if 1 -+#include <termios.h> ++#ifdef TERMIOS + #include <sys/ioctl.h> struct termios otermio; struct termios ntermio; - #else -@@ -86,7 +89,7 @@ +@@ -86,8 +92,8 @@ int ncol; /* Terminal size, columns. void ttopen () { -#ifdef BSD -+#if 0 - #ifdef ULTRIX +-#ifdef ULTRIX ++#if defined(BSD) && !defined(TERMIOS) ++#ifdef TIOCGWINSZ struct winsize ttysize; #else -@@ -137,7 +140,9 @@ + struct ttysize ttysize; +@@ -104,7 +110,7 @@ ttopen () + of the cursor */ + ttrow = 999; + ttcol = 999; +-#ifdef ULTRIX ++#ifdef TIOCGWINSZ + if (ioctl (0, TIOCGWINSZ, &ttysize) == 0) + { + nrow = ttysize.ws_row; +@@ -137,8 +143,13 @@ ttopen () tchars.t_stopc = tchars.t_eofc = tchars.t_brkc = -1; ioctl (0, TIOCSETC, &tchars); #else -#ifdef __GLIBC__ ++#ifdef TERMIOS ++#ifdef TIOCGWINSZ + struct winsize ttysize; -+ -+#if 1 ++#endif tcgetattr(0,&otermio); ++ ntermio.c_ispeed = otermio.c_ispeed; ++ ntermio.c_ospeed = otermio.c_ospeed; #else ioctl (0, TCGETA, &otermio);/* save old settings */ -@@ -149,7 +154,7 @@ + ntermio.c_line = otermio.c_line; +@@ -149,7 +160,7 @@ ttopen () ntermio.c_lflag = 0; ntermio.c_cc[VMIN] = 1; ntermio.c_cc[VTIME] = 0; -#ifdef __GLIBC__ -+#if 1 ++#ifdef TERMIOS tcsetattr(0,TCSANOW,&ntermio); #else ioctl (0, TCSETAW, &ntermio); /* and activate them */ -@@ -161,8 +166,14 @@ +@@ -161,8 +172,17 @@ ttopen () /* on all screens we are not sure of the initial position of the cursor */ ttrow = 999; ttcol = 999; - nrow = NROW; - ncol = NCOL; ++#if defined(TERMIOS) && defined(TIOCGWINSZ) + if (ioctl (0, TIOCGWINSZ, &ttysize) == 0) + { + nrow = ttysize.ws_row; + ncol = ttysize.ws_col; -+ } else { ++ } else ++#endif ++ { + nrow = NROW; + ncol = NCOL; + } #endif /* BSD */ } -@@ -174,7 +185,7 @@ +@@ -174,7 +194,7 @@ ttopen () void ttclose () { -#ifdef BSD -+#if 0 ++#if defined(BSD) && !defined(TERMIOS) if (ioctl (0, TIOCSETP, &otermb) == -1) /* restore terminal settings */ printf ("closing ioctl on dev 0 failure, error = %d\n", errno); #else -@@ -186,7 +197,7 @@ +@@ -186,7 +206,7 @@ ttclose () ioctl (0, TIOCSETC, &tcharsorig) == -1) printf ("closing ioctl on dev 0 failure, error = %d\n", errno); #else -#ifdef __GLIBC__ -+#if 1 ++#ifdef TERMIOS if( tcsetattr(0,TCSANOW,&otermio) == -1) #else if (ioctl (0, TCSETAW, &otermio) == -1) /* restore terminal settings */ Modified: head/editors/beav/pkg-descr ============================================================================== --- head/editors/beav/pkg-descr Thu Dec 12 16:24:58 2013 (r336276) +++ head/editors/beav/pkg-descr Thu Dec 12 16:27:03 2013 (r336277) @@ -1,9 +1,11 @@ -BEAV (Binary Editor And Viewer), is a full featured binary file -editor. Just about any operation that you could want to do to a binary -file is possible with BEAV. You can insert or delete in the middle of -a file thereby changing it's size. You can edit multiple files in -multiple windows and cut and paste between them. You can display and -edit data in hex, octal, decimal, binary, ascii, or ebcdic formats. You -can display data in byte, word, or long word formats in either Intel or -Motorola byte ordering. You can send the formatted display mode to a -file or printer. +beav (Binary Editor And Viewer) is an editor for binary files +containing arbitrary data. With beav, you can edit a file in HEX, +ASCII, EBCDIC, OCTAL, DECIMAL, and BINARY. You can display but not +edit data in FLOAT mode. You can search or search and replace in +any of these modes. Data can be displayed in BYTE, WORD, or DOUBLE +WORD formats. While displaying WORDS or DOUBLE WORDS the data can +be displayed in INTEL's or MOTOROLA's byte ordering. Data of any +length can be inserted at any point in the file. The source of this +data can be the keyboard, another buffer, or a file. Any data that +is being displayed can be sent to a printer in the displayed format. +Files that are bigger than memory can be handled. Modified: head/editors/beav/pkg-plist ============================================================================== --- head/editors/beav/pkg-plist Thu Dec 12 16:24:58 2013 (r336276) +++ head/editors/beav/pkg-plist Thu Dec 12 16:27:03 2013 (r336277) @@ -1,3 +1,4 @@ bin/beav +man/man1/beav.1.gz %%PORTDOCS%%%%DOCSDIR%%/beav.txt %%PORTDOCS%%@dirrm %%DOCSDIR%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312121627.rBCGR449082490>