=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt	2010-05-17 15:03:59 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt	2010-06-04 14:01:32 +0000
@@ -516,6 +516,29 @@
     ...
     LinkNotFoundError
 
+If the source package was created from a recipe build, link to it.
+
+    >>> login('foo.bar@canonical.com')
+    >>> product = factory.makeProduct(name='product')
+    >>> branch = factory.makeProductBranch(
+    ...     owner=cprov, product=product, name='mybranch')
+    >>> recipe = factory.makeSourcePackageRecipe(
+    ...     owner=cprov, name=u'myrecipe', branches=[branch])
+    >>> ppa_source.sourcepackagerelease.source_package_recipe_build = (
+    ...  factory.makeSourcePackageRecipeBuild(recipe=recipe,
+    ...  archive=cprov.archive))
+    >>> logout()
+    >>> anon_browser.open(ppa_build_url)
+    >>> print extract_text(find_tag_by_id(anon_browser.contents, 'details'))
+    Build details
+    ...
+    Source package recipe build:
+    ~cprov/product/mybranch recipe build [cprov/ppa]
+    ...
+
+    >>> print anon_browser.getLink('~cprov/product/mybranch recipe build').url
+    http://code.launchpad.dev/~cprov/+recipe/myrecipe/+build/1
+
 Finally, the 'Build files' section is identical for PPA builds.
 
     >>> print extract_text(

=== modified file 'lib/lp/soyuz/templates/build-index.pt'
--- lib/lp/soyuz/templates/build-index.pt	2010-05-14 08:45:43 +0000
+++ lib/lp/soyuz/templates/build-index.pt	2010-06-04 14:01:32 +0000
@@ -78,6 +78,13 @@
                tal:attributes="href dspr/fmt:url">firefox - 1.0</a>
           </dd>
       </dl>
+      <dl
+          tal:define="spr context/sourcepackagerelease"
+          tal:condition="spr/source_package_recipe_build">
+        <dt>Source package recipe build:</dt>
+        <dd tal:content="structure spr/source_package_recipe_build/fmt:link">
+        </dd>
+      </dl>
       <dl>
         <dt>Archive:</dt>
           <dd>

