--- Portfile.old	2008-07-26 21:59:02.000000000 +0900
+++ Portfile	2008-07-26 21:13:19.000000000 +0900
@@ -1,41 +1,44 @@
 # $Id: Portfile 29068 2007-09-14 12:53:38Z nox@macports.org $
 
-PortSystem      1.0
+PortSystem			1.0
 
-name			unalz
-version         0.61
-categories		archivers
-platforms		darwin
-maintainers		minskim@bawi.org
-description		unarchiver for the AlZip format
+name				unalz
+version				0.62
+categories			archivers
+platforms			darwin
+maintainers			minskim@bawi.org
+description			unarchiver for the AlZip format
 
 long_description	Unalz is a BSD-licensed unarchiver for AlZip format which \
-				requires proprietary and win32-only software but widely used \
-				in Korea.
+					requires proprietary and win32-only software but widely used \
+					in Korea.
 
-homepage		http://www.kipple.pe.kr/win/unalz/
-master_sites	${homepage}
-extract.suffix	.tgz
+homepage			http://www.kipple.pe.kr/win/unalz/
+master_sites		${homepage}
+extract.suffix		.tgz
 
-depends_lib     port:libiconv
+depends_lib			port:libiconv
 
-checksums       md5 f3ee5bad439f10e06b089b8db38b7566 \
-                sha1 a6cab2a02b7f44957211e694b7d8d144840b2255 \
-                rmd160 68cb957aeacfc8452e01637f7e0a50939d515ab6
+checksums			md5 564bf1dc61bb443faf7e8be1d1b5efc8 \
+					sha1 ddacadcb98235eba40bd8c1a2f120e1052a045dc \
+					rmd160 3fcbbb7ef903c417f06769be9d88f6f8faac42dc
 
-worksrcdir		unalz
+worksrcdir			unalz
+
+patchfiles			UnAlz.cpp.patch
 
 post-patch {
     reinplace "s|/usr/local|\$(DESTDIR)${prefix}|" ${worksrcpath}/Makefile
 }
 
-configure {
-    set CFLAGS [join ${configure.cflags} " "]
-    reinplace -E "/^CFLAGS/s|\$|${CFLAGS}\\\nCPPFLAGS=${CFLAGS}|" ${worksrcpath}/Makefile
+use_configure		no
+
+post-configure {
+    reinplace -E "/^CFLAGS/s|\$|[join [list ${configure.cflags} ${configure.cppflags} ${configure.cxxflags}] " "]|" ${worksrcpath}/Makefile
     reinplace -E "/^LDFLAGS/s|\$|[join ${configure.ldflags} " "]|" ${worksrcpath}/Makefile
 }
 
-build.target	posix-utf8
+build.target		posix-utf8
 
 post-destroot {
     set docdir ${prefix}/share/doc/${name}-${version}
@@ -43,7 +46,6 @@
     xinstall -m 0644 ${worksrcpath}/readme.txt ${destroot}${docdir}
 }
 
-livecheck.check regex
-livecheck.url   ${homepage}
-livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)
-
+livecheck.check		regex
+livecheck.url		${homepage}
+livecheck.regex		${name}-(\\d+(?:\\.\\d+)*)

