# $Id: Portfile 34642 2008-03-01 07:19:17Z jmr@macports.org $

PortSystem       1.0

name             xephem
version          3.7.2
categories       science
maintainers      nomaintainer
description      interactive astronomical ephemeris program
long_description \
    Xephem is an interactive astronomical ephemeris program for X Windows \
    systems. It computes heliocentric, geocentric and topocentric \
    information for fixed celestial objects and objects in heliocentric \
    and geocentric orbits\; has built-in support for all planet positions\; \
    the moons of Jupiter, Saturn and Earth\; Mars' and Jupiter's central \
    meridian longitude\; Saturn's rings\; and Jupiter's Great Red Spot
homepage         http://www.clearskyinstitute.com/xephem/
platforms        darwin
master_sites     ${homepage}
checksums        md5 1074e04b9a89302d9f2bad7107674311 \
                 sha1 8027f73e934e257316d15c474c88d435241c521d
depends_lib      lib:libXm:lesstif
worksrcdir       ${distname}/GUI/xephem
use_configure    no
build.args       MOTIF=../../libXm/osx
build.target

destroot {
    set share ${prefix}/share/xephem
    set appdefaults ${x11prefix}/lib/X11/app-defaults
    set bin ${prefix}/bin
    set man1 ${prefix}/share/man/man1

    xinstall -m 755 ${worksrcpath}/xephem ${destroot}${bin}

    xinstall -m 755 -d ${destroot}${man1}
    xinstall -m 644 ${worksrcpath}/xephem.man ${destroot}${man1}/xephem.1

    file mkdir ${destroot}${share}
    file copy \
        ${worksrcpath}/auxil \
        ${worksrcpath}/catalogs \
        ${worksrcpath}/fifos \
        ${worksrcpath}/fits \
        ${worksrcpath}/gallery \
        ${worksrcpath}/help \
        ${worksrcpath}/lo \
        ${destroot}${share}

    file mkdir ${destroot}${appdefaults}
    system "echo XEphem.ShareDir: ${share} > ${destroot}${appdefaults}/XEphem"
}
