Index: trunk/dports/lang/logtalk/Portfile
===================================================================
--- trunk/dports/lang/logtalk/Portfile	(revision 4444)
+++ trunk/dports/lang/logtalk/Portfile	(revision 4445)
@@ -1,7 +1,7 @@
-# $Id: Portfile,v 1.1 2003/09/23 13:51:52 gwright Exp $
+# $Id: Portfile,v 1.2 2004/01/04 00:10:20 gwright Exp $
 
 PortSystem	1.0
 name		logtalk
-version		2.15.4
+version		2.15.5
 
 categories	lang
@@ -19,16 +19,16 @@
 		
 
-homepage		http://www.logtalk.org/
+homepage	http://www.logtalk.org/
 master_sites	http://www.logtalk.org/files/
 
-checksums		md5 762f606b7d29480d720e37da9ed40a66
+checksums	md5 dd4d3819e139f52b18f2062eb4dec6ee
 
-distname		lgt2154
+distname	lgt2155
 
-configure		{}
+configure	{}
 
-build			{}
+build		{}
 
-destroot		{
+destroot	{
 	system "mkdir ${destroot}${prefix}/share/${distname}"
 	cd ${destroot}${prefix}/share/${distname}
@@ -41,4 +41,5 @@
 	system "cp -R ${workpath}/${worksrcdir}/manuals ."
 	system "cp -R ${workpath}/${worksrcdir}/examples ."
+	system "chmod -R g+w examples"
 
 	system "mkdir ${destroot}${prefix}/lib/${distname}"
@@ -50,7 +51,8 @@
 	system "cp -R ${workpath}/${worksrcdir}/wenv ."
 	system "cp -R ${workpath}/${worksrcdir}/xml ."
+	system "chmod -R g+w library"
 
 	if {[variant_isset gprolog]} {
-		system "mkdir ${destroot}${prefix}/lib/${distname}/bin"
+		system "mkdir -p ${destroot}${prefix}/lib/${distname}/bin"
 		cd ${destroot}${prefix}/lib/${distname}/bin
 		system "cp ${workpath}/${worksrcdir}/gplgt ."
@@ -58,8 +60,16 @@
 
 	if {[variant_isset swi-prolog]} {
-		system "mkdir ${destroot}${prefix}/lib/${distname}/bin"
+		system "mkdir -p ${destroot}${prefix}/lib/${distname}/bin"
 		cd ${destroot}${prefix}/lib/${distname}/bin
-		system "cp ${workpath}/${worksrcdir}/logtalk.rc ."
+		system "cp ${workpath}/${worksrcdir}/logtalkswi.rc ."
 		system "cp ${workpath}/${worksrcdir}/swilgt ."
+		system "mv ${workpath}/${worksrcdir}/logtalkswi.pl ."
+	}
+
+	if {[variant_isset yap]} {
+		system "mkdir -p ${destroot}${prefix}/lib/${distname}/bin"
+		cd ${destroot}${prefix}/lib/${distname}/bin
+		system "cp ${workpath}/${worksrcdir}/logtalkyap.rc ."
+		system "cp ${workpath}/${worksrcdir}/yaplgt ."
 	}
 }
@@ -81,35 +91,60 @@
 		system "ln -s ../lib/${distname}/bin/swilgt swilgt"
 	}
+
+	if {[variant_isset yap]} {
+		cd ../bin
+		system "ln -s ../lib/${distname}/bin/yaplgt yaplgt"
+	}
 }
 
 variant	gprolog	{
-	depends_lib bin:gplc:gprolog
+	depends_lib-append bin:gplc:gprolog
 	
-	build {
+	post-build {
 		cd ${workpath}/${worksrcdir}
 
 		system "cp configs/gnu.config configs/gnu.pl"
-		system "echo ':- built_in.' > compiler/gp"
-		system "cat compiler/gp compiler/logtalk.pl > compiler/logtalkgp.pl"
+		system "echo ':- built_in.' > compiler/logtalkgp.pl"
+		system "cat compiler/logtalk.pl >> compiler/logtalkgp.pl"
 		system "gplc -o gplgt configs/gnu.pl compiler/logtalkgp.pl"
 		system "rm configs/gnu.pl"
-		system "rm compiler/gp"
+		system "rm compiler/logtalkgp.pl"
 	}
 }
 
 variant	swi-prolog	{
-	depends_lib bin:swipl:swi-prolog
+	depends_lib-append bin:swipl:swi-prolog
 	
-	build {
+	post-build {
 		cd ${workpath}/${worksrcdir}
 
-		system "echo ':- consult(${prefix}/lib/logtalk/configs/swi.config).' > logtalk.rc"
-		system "echo ':- consult(${prefix}/lib/logtalk/compiler/logtalk.pl).' >> logtalk.rc"
-		reinplace "s|\(|('|g" logtalk.rc
-		reinplace "s|\)|')|g" logtalk.rc
+		system "echo ':- system_module.' > logtalkswi.pl"
+		system "cat compiler/logtalk.pl >> logtalkswi.pl"
+		system "echo ':- consult(${prefix}/lib/logtalk/configs/swi.config).' > logtalkswi.rc"
+		system "echo ':- consult(${prefix}/lib/logtalk/configs/swihook.pl).' >> logtalkswi.rc"
+		system "echo ':- consult(${prefix}/lib/logtalk/bin/logtalkswi.pl).' >> logtalkswi.rc"
+		reinplace "s|\(|('|g" logtalkswi.rc
+		reinplace "s|\)|')|g" logtalkswi.rc
 
 		system "echo '#/bin/sh' > swilgt"
-		system "echo 'swipl -f ${prefix}/lib/logtalk/bin/logtalk.rc' >> swilgt"
+		system "echo 'swipl -f ${prefix}/lib/logtalk/bin/logtalkswi.rc' >> swilgt"
 		system "chmod a+x swilgt"
 	}
 }
+
+variant	yap	{
+	depends_lib-append bin:yap:yap
+	
+	post-build {
+		cd ${workpath}/${worksrcdir}
+
+		system "echo ':- reconsult(${prefix}/lib/logtalk/configs/yap430.config).' > logtalkyap.rc"
+		system "echo ':- reconsult(${prefix}/lib/logtalk/compiler/logtalk.pl).' >> logtalkyap.rc"
+		reinplace "s|\(|('|g" logtalkyap.rc
+		reinplace "s|\)|')|g" logtalkyap.rc
+
+		system "echo '#/bin/sh' > yaplgt"
+		system "echo 'yap -l ${prefix}/lib/logtalk/bin/logtalkyap.rc' >> yaplgt"
+		system "chmod a+x yaplgt"
+	}
+}
