ports/100181: [PATCH] math/calctool: add tty support, remove unused files, take maintainership

Stanislav Sedov ssedov at mbsd.msk.ru
Wed Jul 12 22:00:46 UTC 2006


>Number:         100181
>Category:       ports
>Synopsis:       [PATCH] math/calctool: add tty support, remove unused files, take maintainership
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 12 22:00:33 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Stanislav Sedov
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
MBSD labs, Inc.
>Environment:
System: FreeBSD fonon.realnet 7.0-CURRENT FreeBSD 7.0-CURRENT #7: Sun Jun 18 20:51:36 MSD 2006
>Description:
- Add support for tty version, available versions could be selected via options
- Use shared library instead of static one
- don't install calctool.ps for it's intended for NeWS version
- update info (GUI's currently available is X11 and tty, but not
	NeWS, SunView etc.
- install supplimentary files in $DATADIR
- don't use X prefix, since there is tty version also ans it has no to do with X
- Take maintainership

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- calctool-2.4.13_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/math/calctool/Makefile /work/src/ports/calctool/Makefile
--- /usr/ports/math/calctool/Makefile	Sun Dec 21 03:21:55 2003
+++ /work/src/ports/calctool/Makefile	Thu Jul 13 01:46:34 2006
@@ -7,17 +7,59 @@
 
 PORTNAME=	calctool
 PORTVERSION=	2.4.13
+PORTREVISION=	1
 CATEGORIES=	math
 MASTER_SITES=	${MASTER_SITE_LOCAL}
-DISTNAME=	calctool-2.4pl13
 MASTER_SITE_SUBDIR=	nsayer
+DISTNAME=	calctool-2.4pl13
 
-MAINTAINER=	ports at FreeBSD.org
-COMMENT=	A multi-GUI (text, X, xview, NeWS, sunview) calculator program
+MAINTAINER=	ssedov at mbsd.msk.ru
+COMMENT=	A multi-GUI (terminal, X) calculator program
+
+USE_LDCONFIG=	yes
+OPTIONS=	X11 "Build X11 version of calctool" on \
+		TTY "Build tty version of calctool" on
 
-USE_X_PREFIX=	yes
 MAN1=		calctool.1
 
-ALL_TARGET=	x11
+.include <bsd.port.pre.mk>
+
+.if !defined(WITHOUT_X11)
+USE_XLIB=	yes
+BINARIES+=	xcalctool
+PLIST_SUB+=	X11=""
+.else
+PLIST_SUB+=	X11="@comment "
+.endif
+
+.if !defined(WITHOUT_TTY)
+BINARIES+=	tty_calctool
+PLIST_SUB+=	TTY=""
+.else
+PLIST_SUB+=	TTY="@comment "
+.endif
+
+.if ${ARCH} == "sparc64"
+FPIC=	-fPIC
+.else
+FPIC=	-fpic
+.endif
+
+post-patch:
+	@${REINPLACE_CMD}	-e "s#%%FPIC%%#${FPIC}#g" \
+				-e "s#%%X11BASE%%#${X11BASE}#g" \
+				-e "s#%%BINARIES%%#${BINARIES}#g" \
+				-e "s#%%DATADIR%%#${DATADIR}#g" \
+				${WRKSRC}/Makefile
+
+do-install:
+	${MKDIR} ${DATADIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/libcalctool.so.1 ${PREFIX}/lib
+	@(cd ${PREFIX}/lib; ${LN} -sf libcalctool.so.1 libcalctool.so)
+.for BIN in ${BINARIES}
+	${INSTALL_PROGRAM} ${WRKSRC}/${BIN} ${PREFIX}/bin
+.endfor
+	${INSTALL_MAN} ${WRKSRC}/calctool.1 ${PREFIX}/man/man1
+	${INSTALL_DATA} ${WRKSRC}/calctool.help ${DATADIR}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN --exclude=CVS /usr/ports/math/calctool/files/patch-ab /work/src/ports/calctool/files/patch-ab
--- /usr/ports/math/calctool/files/patch-ab	Fri Mar  9 21:25:08 2001
+++ /work/src/ports/calctool/files/patch-ab	Thu Jul 13 01:33:05 2006
@@ -1,17 +1,52 @@
---- Makefile.orig	Sat May 29 09:35:43 1993
-+++ Makefile	Fri Mar  9 10:17:33 2001
-@@ -116,8 +116,8 @@
+--- Makefile.orig	Sat May 29 20:35:43 1993
++++ Makefile	Thu Jul 13 01:33:02 2006
+@@ -28,7 +28,7 @@
+ #  It can also be specified here by uncommenting the following
+ #  macro definition and setting appropriately.
+ #
+-HELPNAME        = -DHELPNAME=\"$(LIBDIR)/calctool.help\"
++HELPNAME        = -DHELPNAME=\"%%DATADIR%%/calctool.help\"
+ #-----------------------------------------------------------------------
+ #  An attempt is now made at using a portable math library. You should
+ #  carefully setup the following three definitions.
+@@ -85,13 +85,13 @@
+ #  uncomment the other three definitions below, commented out the initial
+ #  two.
+ #
+-LIBNAME         = libcalctool.a
+-CALCLIB	        = $(LIBNAME)
++#LIBNAME         = libcalctool.a
++#CALCLIB	        = $(LIBNAME)
+ #
+ # Shared library definitions. Uncomment if required.
+-#LIBNAME         = libcalctool.so.1.1
+-#CALCLIB         = -L. -lcalctool
+-#SHLIB           = -pic
++LIBNAME         = libcalctool.so.1
++CALCLIB         = -L . -lcalctool
++SHLIB           = %%FPIC%%
+ #-----------------------------------------------------------------------
+ #  If you are not running under a BSD4.3 derived system, then the
+ #  second parameter to a select call is a pointer to an integer function,
+@@ -116,38 +116,37 @@
  #  library files are not in a standard place, then the following
  #  two lines should be uncommented, and set appropriately.
  #
 -#X11INCDIR         = -I$(OPENWINHOME)/include
 -#X11LIBDIR         = -L$(OPENWINHOME)/lib
-+X11INCDIR         = -I${X11BASE}/include
-+X11LIBDIR         = -L${X11BASE}/lib
++X11INCDIR         = -I%%X11BASE%%/include
++X11LIBDIR         = -L%%X11BASE%%/lib
  #-------------------------------------------------------------------------
  #  If you are compiling the XView version, then the following two lines
  #  should be uncommented.
-@@ -130,14 +130,14 @@
+ #
+-XVIEWINCDIR      = -I$(OPENWINHOME)/include
+-XVIEWLIBDIR      = -L$(OPENWINHOME)/lib
++#XVIEWINCDIR      = -I$(OPENWINHOME)/include
++#XVIEWLIBDIR      = -L$(OPENWINHOME)/lib
+ #
+ #=========================================================================
+ #
  #  Default locations where calctool files will be installed.
  #  You might wish to alter these values.
  #
@@ -19,34 +54,53 @@
 -LIBDIR          = /usr/local/lib
 -MANDIR          = /usr/man/man$(MANSECT)
 -MANSECT         = l
-+BINDIR          = ${PREFIX}/bin
-+LIBDIR          = ${PREFIX}/lib/X11
-+MANDIR          = ${PREFIX}/man/man$(MANSECT)
++BINDIR          = $(PREFIX)/bin
++LIBDIR          = $(PREFIX)/lib
++MANDIR          = $(PREFIX)/man/man$(MANSECT)
 +MANSECT         = 1
  #
  #  Compilation flags and standard macro definitions.
  #
 -CFLAGS		= -g $(HELPNAME) $(NEWSFILE) $(STUPID_FPE) $(NOIEEE) \
-+CFLAGS		+= $(HELPNAME) $(NEWSFILE) $(STUPID_FPE) $(NOIEEE) \
++CFLAGS		+=   $(HELPNAME) $(NEWSFILE) $(STUPID_FPE) $(NOIEEE) \
  		     $(NOINDEX) $(RCNAME) $(SELTYPE) $(SHLIB) $(SIGRET) \
  		     $(SUN4_KEYBOARD) $(TTEXT) $(MGRPARAM) $(MGRINCDIR) \
  		     $(X11INCDIR) $(XVIEWINCDIR)
-@@ -147,7 +147,7 @@
- BINARIES        = mgr_calctool ps_calctool sv_calctool \
- 		  tty_calctool xcalctool xv_calctool
+ #
+ #=========================================================================
+ 
+-BINARIES        = mgr_calctool ps_calctool sv_calctool \
+-		  tty_calctool xcalctool xv_calctool
++BINARIES        = %%BINARIES%%
  
 -CC		= cc
 +#CC		= cc
  
  LIBSRCS         = graphics.c display.c functions.c get.c
  LIBOBJS         = graphics.o display.o functions.o get.o
-@@ -233,8 +233,7 @@
- 			ld -o libcalctool.so.1.1 -assert pure-text $?
+@@ -208,11 +207,10 @@
+ 		$(CC) -o sv_calctool $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
+ 		-cp sv_calctool calctool
+ 
+-tty:            $(OBJS) tty.o
++tty_calctool:   $(OBJS) tty.o
+ 		$(CC) -o tty_calctool $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
+-		-cp tty_calctool calctool
+ 
+-x11:            $(OBJS) x11.o
++xcalctool:      $(OBJS) x11.o
+ 		$(CC) -o xcalctool $(X11LIBDIR) $(CFLAGS) $(STDOBJS) x11.o \
+ 				$(X11LIBS)
+ 		-cp xcalctool calctool
+@@ -229,8 +227,9 @@
+ #  These are the library creation rules for making the shared calctool
+ #  library (available with SunOS v4.x).
+  
+-libcalctool.so.1.1:     $(LIBOBJS)
+-			ld -o libcalctool.so.1.1 -assert pure-text $?
++libcalctool.so.1:	$(LIBOBJS)
++			$(CC) -shared -o ${LIBNAME} $?
++			ln -sf ${LIBNAME} libcalctool.so
  
  install:
--		install -c -m 644 $(LIBNAME) $(LIBDIR)
--		install -s -m 751 calctool $(BINDIR)
-+		install -c -s -m 751 calctool $(BINDIR)
- 		install -c -m 644 calctool.help $(LIBDIR)
- 		install -c -m 644 calctool.ps $(LIBDIR)
- 		install -c -m 644 calctool.1 $(MANDIR)/calctool.$(MANSECT)
+ 		install -c -m 644 $(LIBNAME) $(LIBDIR)
diff -ruN --exclude=CVS /usr/ports/math/calctool/pkg-descr /work/src/ports/calctool/pkg-descr
--- /usr/ports/math/calctool/pkg-descr	Thu Dec 12 06:46:31 1996
+++ /work/src/ports/calctool/pkg-descr	Thu Jul 13 01:45:49 2006
@@ -3,8 +3,7 @@
 calctool  -  README  -  November 1989.
 
 This is V2.4 of a simple desktop calculator.
-This version works under SunView, XView, X11, NeWS, MGR and for
-dumb tty terminals.
+This version works under X11 and dumb tty terminals.
 
 It is almost visually identical to V2.1 which was released in August
 1988, but internally most of the code has been reworked to include a
@@ -20,4 +19,4 @@
 which can define upto ten new values for constants, and ten function
 definitions which are used in conjunction with the FUN key.
 
-(port maintained by nsayer at quack.kfu.com)
+(port maintained by ssedov at mbsd.msk.ru)
diff -ruN --exclude=CVS /usr/ports/math/calctool/pkg-plist /work/src/ports/calctool/pkg-plist
--- /usr/ports/math/calctool/pkg-plist	Mon Aug 17 04:50:19 1998
+++ /work/src/ports/calctool/pkg-plist	Thu Jul 13 01:35:26 2006
@@ -1,3 +1,6 @@
-bin/calctool
-lib/X11/calctool.help
-lib/X11/calctool.ps
+%%TTY%%bin/tty_calctool
+%%X11%%bin/xcalctool
+lib/libcalctool.so
+lib/libcalctool.so.1
+%%DATADIR%%/calctool.help
+ at dirrm %%DATADIR%%
--- calctool-2.4.13_1.patch ends here ---

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



More information about the freebsd-ports-bugs mailing list