Index: Portfile
===================================================================
--- Portfile	(revision 103531)
+++ Portfile	(working copy)
@@ -1,50 +1,54 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup               github  1.0
 
+github.setup            carvalho numlua 0.3-1
+github.tarball_from     downloads
 name                    lua-numlua
-version                 0.2.1
-revision                1
 license                 MIT
 categories              devel
 platforms               darwin
-maintainers             bfulgham
+maintainers             bfulgham and.damore
 description             Numerical package for the Lua programming language.
-long_description        ${description} It includes support for complex \
-            numbers, multidimensional matrices, random generation \
-            and special functions.  Much of the routines are \
-            simple wrappers for the stable and well-known \
-            libraries from Netlib (http://www.netlib.org).
+long_description        ${description} It includes support for complex numbers, multidimensional \
+                        matrices, random generation and special functions. Much of the routines are \
+                        simple wrappers for the stable and well-known libraries from Netlib
 
-homepage                http://luaforge.net/projects/numlua
-set luaforge_release    2566
-master_sites            http://luaforge.net/frs/download.php/${luaforge_release}
-distname                numlua-${version}
-worksrcdir              numlua
-
 use_configure           no
 
-checksums               md5     c4d0ce508e7f2ec2754242f2816f4cfc \
-                        sha1    e7c5fb14ebaa92b1ae5bef4cbe303644b9fe5252 \
-                        rmd160  6238e6b79cd446c47a676c4bcb3afa8fd41c42a6
+checksums               md5     abc29945daadd1499c7596ebbfb0f88a \
+                        sha1    da37d2a1b6290f398ac8cd4e001a91bf0ac77194 \
+                        rmd160  4ba5c04922c30c1091117b11017a166e6f68c9ad
 
-depends_build-append    port:lua \
-                        port:gcc43
+# there used to be a dependency on a gccXX port due to the need for a fortran compiler
+# this has now been removed due to dependency on port atlas
 
-depends_lib-append      lib:fftw:fftw-3 
+depends_lib-append      port:lua \
+                        port:atlas \
+                        lib:fftw:fftw-3 \
+                        lib:hdf5:hdf5-18
 
-patchfiles              patch-Makefile.diff \
-                        patch-lib-config.diff \
-                        patch-lib-Makefile.diff \
-                        patch-src-Makefile.diff
+post-extract {
+    xinstall -m 644 ${filespath}/Makefile ${worksrcpath} }
 
-pre-build {
-	system "cd ${worksrcpath}/lib && make"
-}
-
 post-patch {
-    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile
-    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/lib/config
-    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/Makefile
-}
+    reinplace -W $worksrcpath "s|%%PREFIX%%|${prefix}|" Makefile }
 
+build.args-append       CC=${configure.cc} \
+                        CPP=${configure.cpp} \
+                        PREFIX=$prefix \
+                        CFLAGS="${configure.cflags} [get_canonical_archflags]" \
+                        CPPFLAGS=${configure.cppflags} \
+                        LDFLAGS=${configure.ldflags} \
+                        DEPLOYMENT_TARGET=${macosx_deployment_target}
+
+destroot.args-append    PREFIX=$prefix
+
+post-destroot {
+    xinstall -d -m 755 ${destroot}${prefix}/share/doc
+    xinstall -d -m 755 ${destroot}${prefix}/share/examples
+
+    file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
+    file copy ${worksrcpath}/examples ${destroot}${prefix}/share/examples/${name}
+    file copy ${worksrcpath}/lhp ${destroot}${prefix}/share/doc/${name}/lhp }
Index: files/Makefile
===================================================================
--- files/Makefile	(revision 0)
+++ files/Makefile	(working copy)
@@ -0,0 +1,41 @@
+# Makefile for numlua
+# $Id$
+
+CC ?= /usr/bin/clang
+CFLAGS ?= -O2 -arch x86_64
+CPPFLAGS ?= -I%%PREFIX%%/include
+LDFLAGS ?= -L%%PREFIX%%/lib
+DEPLOYMENT_TARGET ?= 10.5
+PREFIX ?= /tmp
+
+INSTALL_ROOT = $(DESTDIR)$(PREFIX)
+INSTALL_INC = $(INSTALL_ROOT)/include/lua5.1
+INSTALL_LUA = $(INSTALL_ROOT)/share/lua/5.1/numlua
+INSTALL_LIB = $(INSTALL_ROOT)/lib/lua/5.1
+TO_INC = amos.h blas.h cdflib.h lapack.h numlua.h rng.h
+TO_LUA = matrix.lua seeall.lua
+TO_LIB = numlua.so
+
+OBJECTS = numlua.o complex.o fft.o msort.o lmatrix.o mt.o ranlib.o rng.o dcdflib.o ipmpar.o stat.o amos.o mathx.o
+
+%.o : %.c
+	export MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET); $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+.PHONY : numlua
+numlua : numlua.so
+
+numlua.so : $(OBJECTS)
+	export MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET); $(CC) -bundle -undefined dynamic_lookup -all_load -o numlua.so $(LDFLAGS) $(OBJECTS) -Wl,-rpath,$(PREFIX)/lib: -lhdf5 -lfftw3 -llapack -lblas
+
+clean : 
+	-rm -f $(OBJECTS) numlua.so
+
+all : numlua
+
+install : all
+	mkdir -p "$(INSTALL_ROOT)"
+	mkdir -p $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_LUA)
+	cp $(TO_INC) $(INSTALL_INC)
+	cp $(TO_LIB) $(INSTALL_LIB)
+	cp $(TO_LUA) $(INSTALL_LUA)
+

Property changes on: files/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
