More docs.
This commit is contained in:
parent
dfd0440a7e
commit
99b05fd571
@ -79,24 +79,30 @@ in pure Python.
|
|||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ spack create http://scalability.llnl.gov/mpileaks/downloads/mpileaks-1.0.tar.gz
|
$ spack create http://www.mr511.de/software/libelf-0.8.13.tar.gz
|
||||||
|
|
||||||
Creates ``mpileaks.py``:
|
Creates ``libelf.py``:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
class Mpileaks(Package):
|
class Libelf(Package):
|
||||||
homepage = "http://www.example.com/"
|
homepage = "http://www.example.com/"
|
||||||
url = "http://scalability.llnl.gov/mpileaks/downloads/mpileaks-1.0.tar.gz"
|
url = "http://www.mr511.de/software/libelf-0.8.13.tar.gz"
|
||||||
md5 = "4136d7b4c04df68b686570afa26988ac"
|
|
||||||
|
versions = { '0.8.13' : '4136d7b4c04df68b686570afa26988ac' }
|
||||||
|
|
||||||
def install(self, prefix):
|
def install(self, prefix):
|
||||||
configure("--prefix=%s" % prefix)
|
configure("--prefix=%s" % prefix)
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
|
It typically doesn't take much python coding to get from there to a
|
||||||
|
working package file:
|
||||||
|
|
||||||
|
.. literalinclude:: ../spack/packages/libelf.py
|
||||||
|
|
||||||
Spack also provides wrapper functions around common commands like
|
Spack also provides wrapper functions around common commands like
|
||||||
``configure``, ``make``, and ``cmake`` to make writing packages
|
``configure``, ``make``, and ``cmake`` to make writing packages
|
||||||
simple.
|
simple.
|
||||||
|
@ -13,5 +13,5 @@ def install(self, prefix):
|
|||||||
"--disable-debug")
|
"--disable-debug")
|
||||||
make()
|
make()
|
||||||
|
|
||||||
# The mkdir commands in libelf's intsall can fail in parallel
|
# The mkdir commands in libelf's install can fail in parallel
|
||||||
make("install", parallel=False)
|
make("install", parallel=False)
|
||||||
|
@ -827,8 +827,9 @@ def format(self, format_string='$_$@$%@$+$=', **kwargs):
|
|||||||
$$ $
|
$$ $
|
||||||
|
|
||||||
Anything else is copied verbatim into the output stream.
|
Anything else is copied verbatim into the output stream.
|
||||||
Example: "$_$@$+" translates to the name, version, and options
|
|
||||||
of the package, but no dependencies, arch, or compiler.
|
*Example:* ``$_$@$+`` translates to the name, version, and options
|
||||||
|
of the package, but no dependencies, arch, or compiler.
|
||||||
"""
|
"""
|
||||||
color = kwargs.get('color', False)
|
color = kwargs.get('color', False)
|
||||||
length = len(format_string)
|
length = len(format_string)
|
||||||
|
Loading…
Reference in New Issue
Block a user