diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-07-08 13:29:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-08 13:29:52 -0700 |
commit | c086ccdab66be0443706b86f64e046965a76fe2c (patch) | |
tree | afdf8a62af03368430c1b95b00f2096f3cecd13b | |
parent | 3338fcf014ee38e9bdc9cb0b71c34ee30821505e (diff) | |
parent | 33d0660abc19d33c6e1b5fa21f97f9292a2008d7 (diff) | |
download | spack-c086ccdab66be0443706b86f64e046965a76fe2c.tar.gz spack-c086ccdab66be0443706b86f64e046965a76fe2c.tar.bz2 spack-c086ccdab66be0443706b86f64e046965a76fe2c.tar.xz spack-c086ccdab66be0443706b86f64e046965a76fe2c.zip |
Merge pull request #1200 from glennpj/lowpackname
Have ``spack create`` default to lower case name for package
-rw-r--r-- | lib/spack/docs/packaging_guide.rst | 32 | ||||
-rw-r--r-- | lib/spack/spack/cmd/create.py | 2 |
2 files changed, 20 insertions, 14 deletions
diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 563ecd8185..72559e47ce 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -36,10 +36,11 @@ Creating & editing packages ``spack create`` ~~~~~~~~~~~~~~~~~~~~~ -The ``spack create`` command generates a boilerplate package template -from a URL. The URL should point to a tarball or other software -archive. In most cases, ``spack create`` plus a few modifications is -all you need to get a package working. +The ``spack create`` command creates a directory with the package name and +generates a ``package.py`` file with a boilerplate package template from a URL. +The URL should point to a tarball or other software archive. In most cases, +``spack create`` plus a few modifications is all you need to get a package +working. Here's an example: @@ -47,12 +48,16 @@ Here's an example: $ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz -Spack examines the tarball URL and tries to figure out the name of the -package to be created. It also tries to determine what version strings -look like for this package. Using this information, it will try to -find *additional* versions by spidering the package's webpage. If it -finds multiple versions, Spack prompts you to tell it how many -versions you want to download and checksum: +Spack examines the tarball URL and tries to figure out the name of the package +to be created. Once the name is determined a directory in the appropriate +repository is created with that name. Spack prefers, but does not require, that +names be lower case so the directory name will be lower case when ``spack +create`` generates it. In cases where it is desired to have mixed case or upper +case simply rename the directory. Spack also tries to determine what version +strings look like for this package. Using this information, it will try to find +*additional* versions by spidering the package's webpage. If it finds multiple +versions, Spack prompts you to tell it how many versions you want to download +and checksum: .. code-block:: sh @@ -297,9 +302,10 @@ directories or files (like patches) that it needs to build. Package Names ~~~~~~~~~~~~~~~~~~ -Packages are named after the directory containing ``package.py``. So, -``libelf``'s ``package.py`` lives in a directory called ``libelf``. -The ``package.py`` file defines a class called ``Libelf``, which +Packages are named after the directory containing ``package.py``. It is +preferred, but not required, that the directory, and thus the package name, are +lower case. So, ``libelf``'s ``package.py`` lives in a directory called +``libelf``. The ``package.py`` file defines a class called ``Libelf``, which extends Spack's ``Package`` class. for example, here is ``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``: diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index f5f234d7a7..18c748e483 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -325,7 +325,7 @@ def create(parser, args): # Figure out a name and repo for the package. name, version = guess_name_and_version(url, args) spec = Spec(name) - name = spec.name # factors out namespace, if any + name = spec.name.lower() # factors out namespace, if any repo = find_repository(spec, args) tty.msg("This looks like a URL for %s version %s" % (name, version)) |