Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
c086ccda
Commit
c086ccda
authored
9 years ago
by
Todd Gamblin
Committed by
GitHub
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1200 from glennpj/lowpackname
Have ``spack create`` default to lower case name for package
parents
3338fcf0
33d0660a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/docs/packaging_guide.rst
+19
-13
19 additions, 13 deletions
lib/spack/docs/packaging_guide.rst
lib/spack/spack/cmd/create.py
+1
-1
1 addition, 1 deletion
lib/spack/spack/cmd/create.py
with
20 additions
and
14 deletions
lib/spack/docs/packaging_guide.rst
+
19
−
13
View file @
c086ccda
...
@@ -36,10 +36,11 @@ Creating & editing packages
...
@@ -36,10 +36,11 @@ Creating & editing packages
``spack create``
``spack create``
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
The ``spack create`` command generates a boilerplate package template
The ``spack create`` command creates a directory with the package name and
from a URL. The URL should point to a tarball or other software
generates a ``package.py`` file with a boilerplate package template from a URL.
archive. In most cases, ``spack create`` plus a few modifications is
The URL should point to a tarball or other software archive. In most cases,
all you need to get a package working.
``spack create`` plus a few modifications is all you need to get a package
working.
Here's an example:
Here's an example:
...
@@ -47,12 +48,16 @@ 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 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
Spack examines the tarball URL and tries to figure out the name of the package
package to be created. It also tries to determine what version strings
to be created. Once the name is determined a directory in the appropriate
look like for this package. Using this information, it will try to
repository is created with that name. Spack prefers, but does not require, that
find *additional* versions by spidering the package's webpage. If it
names be lower case so the directory name will be lower case when ``spack
finds multiple versions, Spack prompts you to tell it how many
create`` generates it. In cases where it is desired to have mixed case or upper
versions you want to download and checksum:
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
.. code-block:: sh
...
@@ -297,9 +302,10 @@ directories or files (like patches) that it needs to build.
...
@@ -297,9 +302,10 @@ directories or files (like patches) that it needs to build.
Package Names
Package Names
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
Packages are named after the directory containing ``package.py``. So,
Packages are named after the directory containing ``package.py``. It is
``libelf``'s ``package.py`` lives in a directory called ``libelf``.
preferred, but not required, that the directory, and thus the package name, are
The ``package.py`` file defines a class called ``Libelf``, which
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
extends Spack's ``Package`` class. for example, here is
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/cmd/create.py
+
1
−
1
View file @
c086ccda
...
@@ -325,7 +325,7 @@ def create(parser, args):
...
@@ -325,7 +325,7 @@ def create(parser, args):
# Figure out a name and repo for the package.
# Figure out a name and repo for the package.
name
,
version
=
guess_name_and_version
(
url
,
args
)
name
,
version
=
guess_name_and_version
(
url
,
args
)
spec
=
Spec
(
name
)
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
)
repo
=
find_repository
(
spec
,
args
)
tty
.
msg
(
"
This looks like a URL for %s version %s
"
%
(
name
,
version
))
tty
.
msg
(
"
This looks like a URL for %s version %s
"
%
(
name
,
version
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment