aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authoritetcu <itetcu@FreeBSD.org>2006-07-13 06:23:35 +0800
committeritetcu <itetcu@FreeBSD.org>2006-07-13 06:23:35 +0800
commita3e5de44fffd2ba487e47eabe07711c4698acc80 (patch)
tree847e1f3797dedde776c7aa2e43ee9511e98a477c /math
parentf765609fbb72da8e6418b841cb872580cb61b5f0 (diff)
downloadfreebsd-ports-gnome-a3e5de44fffd2ba487e47eabe07711c4698acc80.tar.gz
freebsd-ports-gnome-a3e5de44fffd2ba487e47eabe07711c4698acc80.tar.zst
freebsd-ports-gnome-a3e5de44fffd2ba487e47eabe07711c4698acc80.zip
- 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 (the GUI is 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 - Pass maintainership to submitter PR: 100181 Submitted by: Stanislav Sedov
Diffstat (limited to 'math')
-rw-r--r--math/calctool/Makefile55
-rw-r--r--math/calctool/files/patch-ab96
-rw-r--r--math/calctool/pkg-descr5
-rw-r--r--math/calctool/pkg-plist9
4 files changed, 132 insertions, 33 deletions
diff --git a/math/calctool/Makefile b/math/calctool/Makefile
index e9415d80de97..c1064a9648e6 100644
--- a/math/calctool/Makefile
+++ b/math/calctool/Makefile
@@ -7,17 +7,60 @@
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= ssedov@mbsd.msk.ru
+COMMENT= A multi-GUI (terminal, X) calculator program
-MAINTAINER= ports@FreeBSD.org
-COMMENT= A multi-GUI (text, X, xview, NeWS, sunview) 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 --git a/math/calctool/files/patch-ab b/math/calctool/files/patch-ab
index fd22b93a54cd..6a7709c0853d 100644
--- a/math/calctool/files/patch-ab
+++ b/math/calctool/files/patch-ab
@@ -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 --git a/math/calctool/pkg-descr b/math/calctool/pkg-descr
index 281d41c57fe0..28b7e219d090 100644
--- a/math/calctool/pkg-descr
+++ b/math/calctool/pkg-descr
@@ -3,8 +3,7 @@ From the README:
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 @@ notation. You can also have a .calctoolrc file in your home directory,
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@quack.kfu.com)
+(port maintained by ssedov@mbsd.msk.ru)
diff --git a/math/calctool/pkg-plist b/math/calctool/pkg-plist
index 0586e59a71de..7410150ae47e 100644
--- a/math/calctool/pkg-plist
+++ b/math/calctool/pkg-plist
@@ -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
+@dirrm %%DATADIR%%