# $Id: Portfile 67659 2010-05-15 16:50:59Z blair@macports.org $

PortSystem 1.0

name			proguard
version			4.4
categories		java
platforms		darwin
maintainers		blair

description		Java bytecode shrinker, optimizer, and obfuscator.
long_description	ProGuard is a free Java class file shrinker, \
			optimizer, obfuscator, and preverifier.  It detects \
			and removes unused classes, fields, methods, and \
			attributes.  It optimizes bytecode and removes \
			unused instructions.  It renames the remaining \
			classes, fields, and methods using short \
			meaningless names.  Finally, it preverifies the \
			processed code for Java 6 or for Java Micro Edition.
homepage		http://proguard.sourceforge.net/

master_sites		sourceforge
distname		${name}${version}
checksums		md5 18b8d00951be8d9f85a813c67a46b8ec \
			sha1 4454e29e849eae82de29ff5af444e65801ea0953 \
			rmd160 e69291ae1423bc3bb30e1073d9920f4499be6696

depends_lib		bin:java:kaffe

use_configure		no

build.cmd		true

destroot {
	set javadir ${destroot}${prefix}/share/java
	set docdir ${destroot}${prefix}/share/doc/${name}

	xinstall -d -m 755 ${javadir}
	xinstall -d -m 755 ${docdir}

	foreach f [glob -directory ${worksrcpath}/lib *.jar] {
		file copy ${f} ${javadir}/
	}
	foreach f {README docs examples} {
		file copy ${worksrcpath}/${f} ${docdir}/
	}

	# Some of the unziped files and directories are not readable
	# by everyone, so fix that.
	system "find ${destroot} -type d -print0 | xargs -0 chmod a+rx"
	system "find ${destroot} -type f -print0 | xargs -0 chmod a+r"
}
