# $Id: Portfile 75164 2011-01-17 03:18:24Z jmr@macports.org $

PortSystem       1.0

name             xephem
version          3.7.4
revision         1
categories       science
maintainers      nomaintainer
license          Restrictive/Distributable
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     http://97.74.56.125/free/
checksums        md5 4e9290609f36df469a2ba5a1b4fffd46 \
                 sha1 ea5859614381099ca3e9bc28930fd913dfd44926 \
                 rmd160 96684e4b3afc445389ace82cbb200a0b7095852a
depends_lib      lib:libXm:openmotif
worksrcdir       ${distname}/GUI/xephem

patchfiles       patch-Makefile.diff

use_configure    no
build.args       MOTIFI=${prefix}/include MOTIFL=${prefix}/lib \
                 CC=${configure.cc}
build.target

destroot {
    set share ${prefix}/share/xephem
    set appdefaults ${prefix}/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"
}
