Portfile for GEANT4
Cristiano Fontana
cristiano.fontana at gmail.com
Sat Jan 16 15:45:00 PST 2010
Thank you again!
I am working on the destroot phase now but I could not get xinstall to install full directory trees.
Since xinstall complains if asked to install a directory I can not use it.
Is there a simple way to do it?
I tried with the suggestion of the guide:
eval xinstall [glob ${workpath}/G4NDL${G4NDL_v}/*] ${destroot}${prefix}/share/geant4/data/G4NDL${G4NDL_v}
But it did not work:
Error: Target org.macports.destroot returned: xinstall: Inappropriate file type: /opt/local/var/macports/build/_Users_fontana_ports_science_geant4/work/G4NDL3.13/Capture
because that capture is a directory.
So I tried with some loops:
foreach data {G4NDL${G4NDL_v} \
G4EMLOW${G4EMLOW_v} \
PhotonEvaporation${PhotonEvaporation_v} \
RadioactiveDecay${RadioactiveDecay_v} \
G4ABLA${G4ABLA_v} \
RealSurface${RealSurface_v}} {
puts "-> Installing ${data}"
foreach directory [exec find ${workpath}/${data}/ -type d ] {
puts "--> Creating ${prefix}/share/geant4/data/${directory}"
xinstall -d ${destroot}${prefix}/share/geant4/data/${directory}
foreach file [glob -nocomplain -type f ${directory}/*] {
puts "---> Installing ${file} to ${prefix}/share/geant4/data/${directory}"
xinstall ${file} ${destroot}${prefix}/share/geant4/data/${directory}"
}
}
}
but this works only if the current directory is the one that contains the directories: G4NDL${G4NDL_v} G4EMLOW${G4EMLOW_v} ...
Besides, the interpreter does not substitute the variables ${G4NDL_v} with their values:
Error: Target org.macports.destroot returned: find: /opt/local/var/macports/build/_Users_fontana_ports_science_geant4/work/G4NDL${G4NDL_v}/: No such file or directory
But if I put a line like:
puts "G4NDL${G4NDL_v} G4EMLOW${G4EMLOW_v} PhotonEvaporation${PhotonEvaporation_v} RadioactiveDecay${RadioactiveDecay_v} G4ABLA${G4ABLA_v} RealSurface${RealSurface_v}"
it gives the expected result:
G4NDL3.13 G4EMLOW6.9 PhotonEvaporation2.0 RadioactiveDecay3.2 G4ABLA3.0 RealSurface1.0
I am sorry for all these questions but it is kinda hard to get my grip on MacPorts scripts...
Il giorno 16/gen/2010, alle ore 19.57, Ryan Schmidt ha scritto:
>
> On Jan 16, 2010, at 07:16, Cristiano Fontana wrote:
>
>> What are notes how can I use them?
>
> Just like the description or long_description. Put the word "notes" followed by your notes, using backslash to continue onto additional lines if desired.
>
>
>> Another question:
>> I have a bunch of data files that geant needs. Each of those files has a version number on it so I wanted to use a variable to define the version.
>> I tried with:
>> # Data files versions
>> G4NDL_v 3.13
>> G4EMLOW_v 6.9
>> PhotonEvaporation_v 2.0
>> RadioactiveDecay_v 3.2
>> G4ABLA_v 3.0
>> RealSurface_v 1.0
>>
>> distfiles geant${version}.tar.gz \
>> G4NDL.${G4NDL_v}.tar.gz \
>> G4EMLOW.${G4EMLOW_v}.tar.gz \
>> PhotonEvaporation.${PhotonEvaporation_v}.tar.gz \
>> G4RadioactiveDecay.${RadioactiveDecay_v}.tar.gz \
>> G4ABLA.${G4ABLA_v}.tar.gz \
>> RealSurface.${RealSurface_v}.tar.gz
>>
>> but i get the error:
>> invalid command name "G4NDL_v"
>
> Non-built-in variables must be set with the "set" command.
>
> set G4NDL_v 3.13
> set G4EMLOW_v 6.9
> set PhotonEvaporation_v 2.0
>
> etc.
>
More information about the macports-dev
mailing list