# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 86987 2011-11-07 20:45:39Z dports@macports.org $

PortSystem              1.0

name                    php-mode.el
version                 1.5.0
categories              lang editors
license                 GPL-3+
maintainers             billitch openmaintainer
description             PHP mode for Emacs
long_description        An Emacs major mode for editing PHP code. \
                        Features: Syntax coloring and indenting\; \
                        Documentation browse and search functions\; \
                        Support for Imenu and SpeedBar\; \
                        Customization options

homepage                http://php-mode.sourceforge.net/
platforms               darwin
master_sites            sourceforge:php-mode
distname                php-mode-${version}
checksums               md5     6ddad6d150c946846a65bcecfb2cc1a0 \
                        sha1    e559396eb0e4e47c1de8022612e820ee3e86892e \
                        rmd160  012155b894cb8eedf83aa5f7a061c2377bb574c5

# We want emacs from MacPorts since this will install stuff in emacs' site-lisp and we want
# it to go into ${prefix}'s site-lisp.
depends_lib             path:${prefix}/bin/emacs:emacs

use_configure           no

build {
    system "cd ${worksrcpath} && \
            emacs --batch --eval \
              '(progn (setq load-path (cons \".\" load-path)) \
                      (byte-compile-file \"php-mode.el\"))'"
}

destroot {
    file mkdir ${destroot}${prefix}/share/emacs/site-lisp
    xinstall ${worksrcpath}/php-mode.el ${destroot}${prefix}/share/emacs/site-lisp/
    xinstall ${worksrcpath}/php-mode.elc ${destroot}${prefix}/share/emacs/site-lisp/
}

post-install {
        ui_msg "To use this, put the following into your ~/.emacs:"
        ui_msg "(setq auto-mode-alist"
        ui_msg "  (cons '(\"\\\\.php\\\\w?\" . php-mode) auto-mode-alist))"
        ui_msg "(autoload 'php-mode \"php-mode\" \"PHP mode.\" t)"
}
