Request for help with port organisation: how to install several versions of data files

Bradley Giesbrecht pixilla at macports.org
Mon Jul 1 14:40:14 PDT 2013


How about something like this?

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                geant4-data
version             1.0
categories          science
platforms           darwin
license             Geant4
maintainers         mojca openmaintainer
description         Data files for Geant4
long_description    ${description}
homepage            http://geant4.web.cern.ch/
master_sites        http://geant4.cern.ch/support/source/
supported_archs     noarch

set geant.data_versions {
    NDL                 4.3     55493e74cba90e6cb167a5008e138cd7
    NDL                 4.2     2302d7ffeef1a450955302f027ee1cf4
    EMLOW               6.33    0002a1c16c9b1fb5e8d49dfbce12a576
    EMLOW               6.32    9d3302072ba694b1d4505c330ed89d89
    PhotonEvaporation   2.1     d1ee8ac49515109c34ae3714c22d59dd
    RadioactiveDecay    3.7     039e5f64b0e451eb5c095bf81552cb42
    RadioactiveDecay    3.6     9566ff1614bea7455343328cb66abd6f
    NEUTRONXS           1.3     ede7c4b3e99cbe1773b672a7404fe0f6
    NEUTRONXS           1.2     092634b9258c7bc387cb83557ff1df81
    PII                 1.3     05f2471dbcdf1a2b17cbff84e8e83b37
    RealSurface         1.0     0dde95e00fcd3bcd745804f870bb6884
    SAIDDATA            1.1     d88a31218fdf28455e5c5a3609f7216f
}
foreach {data.name data.version data.md5} ${geant.data_versions} {

    subport ${name}-${data.name}-${data.version} {

        version             ${data.version}
        description         ${data.name} v${data.version} data files for Geant4
        long_description    ${description}
        distfiles           G4${data.name}.${data.version}${extract.suffix}
        checksums           md5 ${data.md5}
        distname            ${data.name}${data.version}
        extract.dir         ${destroot}${prefix}/share/Geant4/Data
        pre-extract {

            xinstall -m 755 -d ${destroot}${prefix}/share/Geant4/Data
        }
        use_configure       no
        build               {}
        destroot            {}
    }
}

if {$subport == $name || $subport == ""} {
    fetch {}
    checksum {}
    extract {}
    patch {}
    use_configure       no
    build {}
    destroot {

        xinstall -m 755 -d ${destroot}${prefix}/share/Geant4/Data/${name}
        system "echo $name is a stub port > ${destroot}${prefix}/share/Geant4/Data/${name}/README"
    }
    livecheck.type  none
}

Regards,
Bradley Giesbrecht (pixilla)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Portfile
Type: application/octet-stream
Size: 2459 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130701/df23f598/attachment.obj>
-------------- next part --------------




More information about the macports-dev mailing list