# $Id: Portfile 48708 2009-03-27 08:23:28Z toby@macports.org $

PortSystem 1.0
name             ne
version          2.0.3
categories       editors
maintainers      toby
description      ne - nice editor
long_description \
    ne is a free text editor that runs on (hopefully almost) any \
    UN*X machine. ne is easy to use for the beginner, but powerful \
    and fully configurable for the wizard, and most sparing in its \
    resource usage.
homepage         http://ne.dsi.unimi.it/
platforms        darwin

master_sites     ${homepage}
checksums        md5 16ed5c974adb8255a693f8a3b6e91071 \
                 sha1 9dd848041b9c719659182b2cf8b03b6753b99291 \
                 rmd160 4ee477a8bac1a2c47983d7cfc6f698ecac76d887

patchfiles       patch-src__makefile

configure.cflags-append -Wno-pointer-sign
configure {
    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/makefile
    reinplace "s|__CC__|${configure.cc}|" ${worksrcpath}/src/makefile
    reinplace "s|__CFLAGS__|${configure.cflags}|" ${worksrcpath}/src/makefile
    reinplace "s|__LDFLAGS__|${configure.ldflags}|" ${worksrcpath}/src/makefile
}

build.dir        ${worksrcpath}/src
build.target

destroot {
    xinstall -m 555 ${worksrcpath}/src/ne ${destroot}${prefix}/bin

    xinstall -d ${destroot}${prefix}/lib/ne
    file copy ${worksrcpath}/syntax ${destroot}${prefix}/lib/ne

    xinstall -m 444 ${worksrcpath}/doc/ne.1 ${destroot}${prefix}/share/man/man1

    xinstall -d ${destroot}${prefix}/share/doc/ne
    file copy ${worksrcpath}/doc/ne ${destroot}${prefix}/share/doc/ne
    xinstall -m 444 \
        ${worksrcpath}/doc/ne.pdf \
        ${worksrcpath}/doc/ne.txt \
        ${worksrcpath}/doc/default.keys \
        ${worksrcpath}/doc/default.menus \
        ${worksrcpath}/README \
        ${worksrcpath}/COPYING \
        ${worksrcpath}/CHANGES \
        ${destroot}${prefix}/share/doc/ne
}

livecheck.check  regex
livecheck.regex  HREF=\"ne-(.*)\\.tar\\.gz\">general
