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

Mojca Miklavec mojca at macports.org
Tue Jul 2 01:49:51 PDT 2013


On Mon, Jul 1, 2013 at 11:40 PM, Bradley Giesbrecht wrote:
> How about something like this?

Perfect, thank you! A few questions below.

> 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
>         }

Great! I like this.

>         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

May I ask for a quick explanation of when this is used (when is the
code executed)?

Also, I'm not too comfortable in polluting the data files with
READMEs. If README is really needed (is it?), it should better go to a
different place.

> }

Thanks again,
   Mojca


More information about the macports-dev mailing list