aboutsummaryrefslogtreecommitdiff
path: root/lang/tcl-wrapper
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-03-27 10:52:18 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-03-27 10:52:18 +0000
commit8e204ccbd0d85817a8dbd3af183f5b18931e65e1 (patch)
treeacc582ec3bbe34b397eeac97b39339ad642510c1 /lang/tcl-wrapper
parent8f6e2300a30e779bfd1c43cb545f67492d3ffdae (diff)
downloadports-8e204ccbd0d85817a8dbd3af183f5b18931e65e1.tar.gz
ports-8e204ccbd0d85817a8dbd3af183f5b18931e65e1.zip
Notes
Diffstat (limited to 'lang/tcl-wrapper')
-rw-r--r--lang/tcl-wrapper/Makefile71
-rw-r--r--lang/tcl-wrapper/files/conf.sample.in6
-rw-r--r--lang/tcl-wrapper/files/pkg-deinstall.in17
-rw-r--r--lang/tcl-wrapper/files/pkg-install.in12
-rw-r--r--lang/tcl-wrapper/files/pkg-message.in7
-rw-r--r--lang/tcl-wrapper/files/wrapper.in28
-rw-r--r--lang/tcl-wrapper/pkg-descr6
7 files changed, 147 insertions, 0 deletions
diff --git a/lang/tcl-wrapper/Makefile b/lang/tcl-wrapper/Makefile
new file mode 100644
index 000000000000..5254e1e0648e
--- /dev/null
+++ b/lang/tcl-wrapper/Makefile
@@ -0,0 +1,71 @@
+# Ports collection makefile for: tcl-wrapper
+# Date created: 4 March 2007
+# Whom: martin@matuska.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= wrapper
+PORTVERSION= 1.0
+CATEGORIES= lang tcl84 tk84
+MASTER_SITES= # empty
+PKGNAMEPREFIX= ${TX_PORT}-
+DISTFILES= # none
+EXTRACT_ONLY= # empty
+
+MAINTAINER= martin@matuska.org
+COMMENT= Shell wrapper for ${TX_SHELL} (${TX_PORT_U})
+
+NO_BUILD= yes
+
+SUB_FILES= wrapper conf.sample pkg-message pkg-install pkg-deinstall
+
+PKGINSTALL= ${WRKDIR}/pkg-install
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+
+TX_SHELL= tclsh
+TX_PORT= tcl
+TX_PORT_U= Tcl
+TX_CAT= lang
+
+.if defined(BUILDING_TK_WRAPPER)
+TX_SHELL= wish
+TX_PORT= tk
+TX_PORT_U= Tk
+TX_CAT= x11-toolkits
+USE_TK= yes
+.else
+USE_TCL= yes
+.endif
+
+TX_CONF= ${TX_SHELL}.conf
+TX_CONF_FULL= ${PREFIX}/etc/${TX_CONF}
+
+PLIST_FILES= bin/${TX_SHELL} etc/${TX_CONF}.sample
+
+.include <bsd.port.pre.mk>
+
+.if defined(TK_VER)
+TX_VER=${TK_VER}
+.else
+TX_VER=${TCL_VER}
+.endif
+
+SUB_LIST+= ECHO_CMD="${ECHO_CMD}" GREP="${GREP}" LS="${LS}" \
+ CP="${CP}" RM="${RM}" MD5="${MD5} -q" \
+ TX_SHELL="${TX_SHELL}" TX_SHELL_U="${TX_SHELL:U}" \
+ TX_PORT="${TX_PORT}" TX_PORT_U="${TX_PORT_U}" \
+ TX_CAT="${TX_CAT}" TX_VER="${TX_VER}" TX_CONF="${TX_CONF}" \
+ TX_CONF_FULL="${TX_CONF_FULL}"
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/wrapper ${PREFIX}/bin/${TX_SHELL}
+ ${INSTALL_DATA} ${WRKDIR}/conf.sample ${PREFIX}/etc/${TX_CONF}.sample
+
+post-install:
+ @MD5SUM=`${MD5} -q ${WRKDIR}/conf.sample` && \
+ ${REINPLACE_CMD} -e "s|^MD5SUM=.*$$|MD5SUM=$${MD5SUM}|g" ${WRKDIR}/pkg-deinstall
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/lang/tcl-wrapper/files/conf.sample.in b/lang/tcl-wrapper/files/conf.sample.in
new file mode 100644
index 000000000000..657ae09aa97e
--- /dev/null
+++ b/lang/tcl-wrapper/files/conf.sample.in
@@ -0,0 +1,6 @@
+# This is a sample configuration file for %%TX_CONF%%
+# Target for the "%%TX_SHELL%%" wrapper is configured here.
+#
+# %%TX_SHELL_U%%= full path to your %%TX_SHELL%% shell
+%%TX_SHELL_U%%=%%PREFIX%%/bin/%%TX_SHELL%%%%TX_VER%%
+#%%TX_SHELL_U%%=%%PREFIX%%/bin/%%TX_SHELL%%%%TX_VER%%-threads
diff --git a/lang/tcl-wrapper/files/pkg-deinstall.in b/lang/tcl-wrapper/files/pkg-deinstall.in
new file mode 100644
index 000000000000..15e26bb3c31a
--- /dev/null
+++ b/lang/tcl-wrapper/files/pkg-deinstall.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $FreeBSD$
+#
+MD5="%%MD5%%"
+MD5SUM=
+RM="%%RM%%"
+TX_CONF="%%TX_CONF_FULL%%"
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+
+ if [ -f ${TX_CONF} ]; then
+ MD5CHECK=`${MD5} ${TX_CONF}`
+ if [ "x${MD5CHECK}" = "x${MD5SUM}" ]; then
+ ${RM} ${TX_CONF}
+ fi
+ fi
+fi
diff --git a/lang/tcl-wrapper/files/pkg-install.in b/lang/tcl-wrapper/files/pkg-install.in
new file mode 100644
index 000000000000..394220ba2c2d
--- /dev/null
+++ b/lang/tcl-wrapper/files/pkg-install.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+# $FreeBSD$
+#
+CP="%%CP%%"
+TX_CONF="%%TX_CONF_FULL%%"
+
+if [ "$2" = "POST-INSTALL" ]; then
+
+ if [ ! -f "${TX_CONF}" ]; then
+ ${CP} "${TX_CONF}.sample" "${TX_CONF}"
+ fi
+fi
diff --git a/lang/tcl-wrapper/files/pkg-message.in b/lang/tcl-wrapper/files/pkg-message.in
new file mode 100644
index 000000000000..101285118745
--- /dev/null
+++ b/lang/tcl-wrapper/files/pkg-message.in
@@ -0,0 +1,7 @@
+*******************************************************************
+You may wish to modify (or create) the configuration file:
+%%TX_CONF_FULL%%
+
+Sample configuration file is located at:
+%%TX_CONF_FULL%%.sample
+*******************************************************************
diff --git a/lang/tcl-wrapper/files/wrapper.in b/lang/tcl-wrapper/files/wrapper.in
new file mode 100644
index 000000000000..1fec088f54d0
--- /dev/null
+++ b/lang/tcl-wrapper/files/wrapper.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+# $FreeBSD: /tmp/pcvs/ports/lang/tcl-wrapper/files/wrapper.in,v 1.1 2007-03-27 10:52:18 miwi Exp $
+#
+# Wrapper for the %%TX_PORT%% shell "%%TX_SHELL%%"
+
+%%TX_SHELL_U%%=
+%%TX_SHELL_U%%_CONF=%%TX_CONF_FULL%%
+
+if [ -f "${%%TX_SHELL_U%%_CONF}" ]; then
+ . ${%%TX_SHELL_U%%_CONF}
+ if [ -n "${%%TX_SHELL_U%%}" ]; then
+ if [ -x "${%%TX_SHELL_U%%}" ]; then
+ exec ${%%TX_SHELL_U%%} "$@"
+ else
+ %%ECHO_CMD%% "File not found or not executable: ${%%TX_SHELL_U%%}"
+ %%ECHO_CMD%% "Please check variable %%TX_SHELL_U%% in: ${%%TX_SHELL_U%%_CONF}"
+ fi
+ else
+ %%ECHO_CMD%% "You do not have set path to default %%TX_SHELL%% in the configuration file:"
+ %%ECHO_CMD%% "%%TX_CONF%%"
+ %%ECHO_CMD%% "Please see the sample configuration file for details:"
+ %%ECHO_CMD%% "%%TX_CONF%%.sample"
+ fi
+else
+ %%ECHO_CMD%% "Configuration file not found: %%TX_CONF%%"
+ %%ECHO_CMD%% "Please see the sample configuration file for details:"
+ %%ECHO_CMD%% "%%TX_CONF%%.sample"
+fi
diff --git a/lang/tcl-wrapper/pkg-descr b/lang/tcl-wrapper/pkg-descr
new file mode 100644
index 000000000000..18e16822a3d2
--- /dev/null
+++ b/lang/tcl-wrapper/pkg-descr
@@ -0,0 +1,6 @@
+Tcl-wrapper installs a shell wrapper for the "tclsh" command that
+comes with different versions of Tcl. Users can define in a configuration file
+which version of the Tcl shell should be called.
+
+- Martin Matuska
+martin@matuska.org