# $Id: Portfile,v 1.47 2006/02/15 16:13:38 olegb Exp $

PortSystem 1.0
name		emacs
version		21.4a
revision	1
categories	editors
maintainers	darwinports@opendarwin.org
description	The GNU Emacs text editor
long_description	GNU Emacs is a self-documenting, customizable, extensible real-time display editor. \
			Users new to Emacs will be able to use basic features fairly rapidly \
			by studying the tutorial and using the self-documentation features. \
			Emacs also has an extensive interactive manual browser.	 It is easily \
			extensible since its editing commands are written in Lisp.
platforms	darwin freebsd
homepage	http://www.gnu.org/software/emacs/emacs.html
master_sites	gnu
checksums	md5 8f9d97cbd126121bd5d97e5e31168a87
configure.args	--without-x --without-carbon
destroot.args	prefix=${destroot}/${prefix}

worksrcdir	emacs-21.4

patch.pre_args	-p1
patchfiles	patch-src-xterm.c apple-patches ange-ftp.el.diff

configure.env	\
	LDFLAGS="-L${prefix}/lib" \
	CFLAGS="-I${prefix}/include" \
	CPPFLAGS="-I${prefix}/include"

post-destroot {
	cd ${destroot}${prefix}
	file delete info/dir
	file delete share/info
	file rename info share/info
	system "rm -rf share/man"
	file rename man share/man
	file mkdir share/emacs/$version/leim
	if {[variant_isset carbon]} {
		global destroot prefix version

		file delete bin/emacs
		file delete bin/emacs-$version
	}
}

platform darwin 8 {
	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}

platform darwin 7 {
	depends_build-append	port:autoconf
}

