{"action":"created","comment":{"url":"https://api.github.com/repos/LLNL/spack/pulls/comments/87702817","pull_request_review_id":8306399,"id":87702817,"diff_hunk":"@@ -0,0 +1,463 @@\n+.. _package_tutorial:\n+\n+=========================\n+Package Creation Tutorial\n+=========================\n+\n+This tutorial will walk you through the steps behind building a simple\n+package installation script.  We'll focus building an mpileaks package,\n+which is a MPI debugging tool.  By creating a package file we're\n+essentially giving Spack a recipe for how to build a particular piece of\n+software.  We're describing some of the software's dependencies, where to\n+find the package, what commands and options are used to build the package\n+from source, and more.  Once we've specified a package's recipe, we can\n+ask Spack to build that package in many different ways.\n+\n+This tutorial assumes you have a basic familiarity with some of the Spack\n+commands, and that you have a working version of Spack installed.  If\n+not, we suggest looking at Spack's *Getting Started* guide.  This\n+tutorial also assumes you have at least a beginner's-level familiarity\n+with Python.\n+\n+Also note that this document is a tutorial.  It can help you get started\n+with packaging, but is not intended to be complete.  See Spack's\n+:ref:`packaging-guide` for more complete documentation on this topic.\n+\n+---------------\n+Getting Started\n+---------------\n+\n+A few things before we get started:\n+\n+- We'll refer to the Spack installation location via the environment\n+  variable ``SPACK_ROOT``.  You should point ``SPACK_ROOT`` at wherever\n+  you have Spack installed.\n+- Add ``$SPACK_ROOT/bin`` to your ``PATH`` before you start.\n+- Make sure your ``EDITOR`` environment variable is set to some text\n+  editor you like.\n+- We'll be writting Python code as part of this tutorial.  You can find\n+  successive versions of the Python code in\n+  ``$SPACK_ROOT/lib/spack/docs/packaging_tutorial``.\n+\n+-------------------------\n+Creating the Package File\n+-------------------------\n+\n+Spack comes with a handy command to create a new package: ``spack create``\n+\n+This command is given the location of a package's source code, downloads\n+the code, and sets up some basic packaging infrastructure for you.  The\n+mpileaks source code can be found on github, and here's what happens when\n+we run ``spack create`` on it:\n+\n+.. code-block:: console\n+\n+  % spack create -f https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz\n+  ==> This looks like a URL for mpileaks version 1.0\n+  ==> Creating template for package mpileaks\n+  ==> Downloading...\n+  ==> Fetching https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz\n+  ###################################################################################### 100.0%\n+\n+And Spack should spawn a text editor with this file:\n+\n+.. literalinclude:: packaging_tutorial/0.package.py\n+   :start-after: # flake8: noqa\n+   :language: python","path":"lib/spack/docs/package_tutorial.rst","position":66,"original_position":66,"commit_id":"230b3bdb07457a92aeb86fa3949805716b798cd2","original_commit_id":"230b3bdb07457a92aeb86fa3949805716b798cd2","user":{"login":"adamjstewart","id":12021217,"avatar_url":"https://avatars.githubusercontent.com/u/12021217?v=3","gravatar_id":"","url":"https://api.github.com/users/adamjstewart","html_url":"https://github.com/adamjstewart","followers_url":"https://api.github.com/users/adamjstewart/followers","following_url":"https://api.github.com/users/adamjstewart/following{/other_user}","gists_url":"https://api.github.com/users/adamjstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjstewart/subscriptions","organizations_url":"https://api.github.com/users/adamjstewart/orgs","repos_url":"https://api.github.com/users/adamjstewart/repos","events_url":"https://api.github.com/users/adamjstewart/events{/privacy}","received_events_url":"https://api.github.com/users/adamjstewart/received_events","type":"User","site_admin":false},"body":"Oh, you mentioned it at the bottom. Nvm","created_at":"2016-11-13T00:06:50Z","updated_at":"2016-11-13T00:06:50Z","html_url":"https://github.com/LLNL/spack/pull/2315#discussion_r87702817","pull_request_url":"https://api.github.com/repos/LLNL/spack/pulls/2315","_links":{"self":{"href":"https://api.github.com/repos/LLNL/spack/pulls/comments/87702817"},"html":{"href":"https://github.com/LLNL/spack/pull/2315#discussion_r87702817"},"pull_request":{"href":"https://api.github.com/repos/LLNL/spack/pulls/2315"}}},"pull_request":{"url":"https://api.github.com/repos/LLNL/spack/pulls/2315","id":93428029,"html_url":"https://github.com/LLNL/spack/pull/2315","diff_url":"https://github.com/LLNL/spack/pull/2315.diff","patch_url":"https://github.com/LLNL/spack/pull/2315.patch","issue_url":"https://api.github.com/repos/LLNL/spack/issues/2315","number":2315,"state":"closed","locked":false,"title":"Add packaging tutorial to docs","user":{"login":"mplegendre","id":4440062,"avatar_url":"https://avatars.githubusercontent.com/u/4440062?v=3","gravatar_id":"","url":"https://api.github.com/users/mplegendre","html_url":"https://github.com/mplegendre","followers_url":"https://api.github.com/users/mplegendre/followers","following_url":"https://api.github.com/users/mplegendre/following{/other_user}","gists_url":"https://api.github.com/users/mplegendre/gists{/gist_id}","starred_url":"https://api.github.com/users/mplegendre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mplegendre/subscriptions","organizations_url":"https://api.github.com/users/mplegendre/orgs","repos_url":"https://api.github.com/users/mplegendre/repos","events_url":"https://api.github.com/users/mplegendre/events{/privacy}","received_events_url":"https://api.github.com/users/mplegendre/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-12T04:40:58Z","updated_at":"2016-11-13T00:13:31Z","closed_at":"2016-11-12T15:45:51Z","merged_at":"2016-11-12T15:45:51Z","merge_commit_sha":"216d269f1d85b9e3aba43009ceda11035ee57430","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/LLNL/spack/pulls/2315/commits","review_comments_url":"https://api.github.com/repos/LLNL/spack/pulls/2315/comments","review_comment_url":"https://api.github.com/repos/LLNL/spack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/2315/comments","statuses_url":"https://api.github.com/repos/LLNL/spack/statuses/230b3bdb07457a92aeb86fa3949805716b798cd2","head":{"label":"mplegendre:packaging_tutorial","ref":"packaging_tutorial","sha":"230b3bdb07457a92aeb86fa3949805716b798cd2","user":{"login":"mplegendre","id":4440062,"avatar_url":"https://avatars.githubusercontent.com/u/4440062?v=3","gravatar_id":"","url":"https://api.github.com/users/mplegendre","html_url":"https://github.com/mplegendre","followers_url":"https://api.github.com/users/mplegendre/followers","following_url":"https://api.github.com/users/mplegendre/following{/other_user}","gists_url":"https://api.github.com/users/mplegendre/gists{/gist_id}","starred_url":"https://api.github.com/users/mplegendre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mplegendre/subscriptions","organizations_url":"https://api.github.com/users/mplegendre/orgs","repos_url":"https://api.github.com/users/mplegendre/repos","events_url":"https://api.github.com/users/mplegendre/events{/privacy}","received_events_url":"https://api.github.com/users/mplegendre/received_events","type":"User","site_admin":false},"repo":{"id":32597016,"name":"spack","full_name":"mplegendre/spack","owner":{"login":"mplegendre","id":4440062,"avatar_url":"https://avatars.githubusercontent.com/u/4440062?v=3","gravatar_id":"","url":"https://api.github.com/users/mplegendre","html_url":"https://github.com/mplegendre","followers_url":"https://api.github.com/users/mplegendre/followers","following_url":"https://api.github.com/users/mplegendre/following{/other_user}","gists_url":"https://api.github.com/users/mplegendre/gists{/gist_id}","starred_url":"https://api.github.com/users/mplegendre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mplegendre/subscriptions","organizations_url":"https://api.github.com/users/mplegendre/orgs","repos_url":"https://api.github.com/users/mplegendre/repos","events_url":"https://api.github.com/users/mplegendre/events{/privacy}","received_events_url":"https://api.github.com/users/mplegendre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mplegendre/spack","description":"A flexible package manager designed to support multiple versions, configurations, platforms, and compilers.","fork":true,"url":"https://api.github.com/repos/mplegendre/spack","forks_url":"https://api.github.com/repos/mplegendre/spack/forks","keys_url":"https://api.github.com/repos/mplegendre/spack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mplegendre/spack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mplegendre/spack/teams","hooks_url":"https://api.github.com/repos/mplegendre/spack/hooks","issue_events_url":"https://api.github.com/repos/mplegendre/spack/issues/events{/number}","events_url":"https://api.github.com/repos/mplegendre/spack/events","assignees_url":"https://api.github.com/repos/mplegendre/spack/assignees{/user}","branches_url":"https://api.github.com/repos/mplegendre/spack/branches{/branch}","tags_url":"https://api.github.com/repos/mplegendre/spack/tags","blobs_url":"https://api.github.com/repos/mplegendre/spack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mplegendre/spack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mplegendre/spack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mplegendre/spack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mplegendre/spack/statuses/{sha}","languages_url":"https://api.github.com/repos/mplegendre/spack/languages","stargazers_url":"https://api.github.com/repos/mplegendre/spack/stargazers","contributors_url":"https://api.github.com/repos/mplegendre/spack/contributors","subscribers_url":"https://api.github.com/repos/mplegendre/spack/subscribers","subscription_url":"https://api.github.com/repos/mplegendre/spack/subscription","commits_url":"https://api.github.com/repos/mplegendre/spack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mplegendre/spack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mplegendre/spack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mplegendre/spack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mplegendre/spack/contents/{+path}","compare_url":"https://api.github.com/repos/mplegendre/spack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mplegendre/spack/merges","archive_url":"https://api.github.com/repos/mplegendre/spack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mplegendre/spack/downloads","issues_url":"https://api.github.com/repos/mplegendre/spack/issues{/number}","pulls_url":"https://api.github.com/repos/mplegendre/spack/pulls{/number}","milestones_url":"https://api.github.com/repos/mplegendre/spack/milestones{/number}","notifications_url":"https://api.github.com/repos/mplegendre/spack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mplegendre/spack/labels{/name}","releases_url":"https://api.github.com/repos/mplegendre/spack/releases{/id}","deployments_url":"https://api.github.com/repos/mplegendre/spack/deployments","created_at":"2015-03-20T17:17:40Z","updated_at":"2015-03-20T17:17:41Z","pushed_at":"2016-11-12T08:58:31Z","git_url":"git://github.com/mplegendre/spack.git","ssh_url":"git@github.com:mplegendre/spack.git","clone_url":"https://github.com/mplegendre/spack.git","svn_url":"https://github.com/mplegendre/spack","homepage":"http://scalability-llnl.github.io/spack","size":12083,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LLNL:develop","ref":"develop","sha":"09470ec672a27a87a75c127d0c13a9945861da4a","user":{"login":"LLNL","id":5921419,"avatar_url":"https://avatars.githubusercontent.com/u/5921419?v=3","gravatar_id":"","url":"https://api.github.com/users/LLNL","html_url":"https://github.com/LLNL","followers_url":"https://api.github.com/users/LLNL/followers","following_url":"https://api.github.com/users/LLNL/following{/other_user}","gists_url":"https://api.github.com/users/LLNL/gists{/gist_id}","starred_url":"https://api.github.com/users/LLNL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLNL/subscriptions","organizations_url":"https://api.github.com/users/LLNL/orgs","repos_url":"https://api.github.com/users/LLNL/repos","events_url":"https://api.github.com/users/LLNL/events{/privacy}","received_events_url":"https://api.github.com/users/LLNL/received_events","type":"Organization","site_admin":false},"repo":{"id":15730865,"name":"spack","full_name":"LLNL/spack","owner":{"login":"LLNL","id":5921419,"avatar_url":"https://avatars.githubusercontent.com/u/5921419?v=3","gravatar_id":"","url":"https://api.github.com/users/LLNL","html_url":"https://github.com/LLNL","followers_url":"https://api.github.com/users/LLNL/followers","following_url":"https://api.github.com/users/LLNL/following{/other_user}","gists_url":"https://api.github.com/users/LLNL/gists{/gist_id}","starred_url":"https://api.github.com/users/LLNL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLNL/subscriptions","organizations_url":"https://api.github.com/users/LLNL/orgs","repos_url":"https://api.github.com/users/LLNL/repos","events_url":"https://api.github.com/users/LLNL/events{/privacy}","received_events_url":"https://api.github.com/users/LLNL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LLNL/spack","description":"A flexible package manager designed to support multiple versions, configurations, platforms, and compilers.","fork":false,"url":"https://api.github.com/repos/LLNL/spack","forks_url":"https://api.github.com/repos/LLNL/spack/forks","keys_url":"https://api.github.com/repos/LLNL/spack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LLNL/spack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LLNL/spack/teams","hooks_url":"https://api.github.com/repos/LLNL/spack/hooks","issue_events_url":"https://api.github.com/repos/LLNL/spack/issues/events{/number}","events_url":"https://api.github.com/repos/LLNL/spack/events","assignees_url":"https://api.github.com/repos/LLNL/spack/assignees{/user}","branches_url":"https://api.github.com/repos/LLNL/spack/branches{/branch}","tags_url":"https://api.github.com/repos/LLNL/spack/tags","blobs_url":"https://api.github.com/repos/LLNL/spack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LLNL/spack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LLNL/spack/git/refs{/sha}","trees_url":"https://api.github.com/repos/LLNL/spack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LLNL/spack/statuses/{sha}","languages_url":"https://api.github.com/repos/LLNL/spack/languages","stargazers_url":"https://api.github.com/repos/LLNL/spack/stargazers","contributors_url":"https://api.github.com/repos/LLNL/spack/contributors","subscribers_url":"https://api.github.com/repos/LLNL/spack/subscribers","subscription_url":"https://api.github.com/repos/LLNL/spack/subscription","commits_url":"https://api.github.com/repos/LLNL/spack/commits{/sha}","git_commits_url":"https://api.github.com/repos/LLNL/spack/git/commits{/sha}","comments_url":"https://api.github.com/repos/LLNL/spack/comments{/number}","issue_comment_url":"https://api.github.com/repos/LLNL/spack/issues/comments{/number}","contents_url":"https://api.github.com/repos/LLNL/spack/contents/{+path}","compare_url":"https://api.github.com/repos/LLNL/spack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LLNL/spack/merges","archive_url":"https://api.github.com/repos/LLNL/spack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LLNL/spack/downloads","issues_url":"https://api.github.com/repos/LLNL/spack/issues{/number}","pulls_url":"https://api.github.com/repos/LLNL/spack/pulls{/number}","milestones_url":"https://api.github.com/repos/LLNL/spack/milestones{/number}","notifications_url":"https://api.github.com/repos/LLNL/spack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LLNL/spack/labels{/name}","releases_url":"https://api.github.com/repos/LLNL/spack/releases{/id}","deployments_url":"https://api.github.com/repos/LLNL/spack/deployments","created_at":"2014-01-08T09:22:12Z","updated_at":"2016-11-11T20:24:23Z","pushed_at":"2016-11-13T00:06:13Z","git_url":"git://github.com/LLNL/spack.git","ssh_url":"git@github.com:LLNL/spack.git","clone_url":"https://github.com/LLNL/spack.git","svn_url":"https://github.com/LLNL/spack","homepage":"http://software.llnl.gov/spack","size":21805,"stargazers_count":172,"watchers_count":172,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":156,"mirror_url":null,"open_issues_count":406,"forks":156,"open_issues":406,"watchers":172,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/LLNL/spack/pulls/2315"},"html":{"href":"https://github.com/LLNL/spack/pull/2315"},"issue":{"href":"https://api.github.com/repos/LLNL/spack/issues/2315"},"comments":{"href":"https://api.github.com/repos/LLNL/spack/issues/2315/comments"},"review_comments":{"href":"https://api.github.com/repos/LLNL/spack/pulls/2315/comments"},"review_comment":{"href":"https://api.github.com/repos/LLNL/spack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LLNL/spack/pulls/2315/commits"},"statuses":{"href":"https://api.github.com/repos/LLNL/spack/statuses/230b3bdb07457a92aeb86fa3949805716b798cd2"}}}}
{"actor":{"display_login":"adamjstewart"}}