Repository: spack/spack

Issue:
spack find : always prompt 0 installed packages
On a clean `develop` checkout : 

```
$ git clone https://github.com/LLNL/spack.git
Cloning into 'spack'...
remote: Counting objects: 25613, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 25613 (delta 12), reused 3 (delta 3), pack-reused 25557
Receiving objects: 100% (25613/25613), 6.65 MiB | 6.46 MiB/s, done.
Resolving deltas: 100% (13031/13031), done.
Checking connectivity... done.

$ cd spack
$ . share/spack/setup-env.sh 
$ spack compilers
==> Available compilers
-- gcc ----------------------------------------------------------
gcc@4.8

$ spack install zlib
==> Installing zlib
==> Trying to fetch from file:///home/mculpo/production/spack-mirror/zlib/zlib-1.2.8.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix/zlib-1.2.8.tar.gz
==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix
==> No patches needed for zlib
==> Building zlib
==> Successfully installed zlib
  Fetch: 0.01s.  Build: 3.69s.  Total: 3.70s.
[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix

$ spack find
==> 0 installed packages.

$ spack install szip
==> Installing szip
==> Trying to fetch from file:///home/mculpo/production/spack-mirror/szip/szip-2.1.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq/szip-2.1.tar.gz
==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq
==> No patches needed for szip
==> Building szip
==> Successfully installed szip
  Fetch: 0.01s.  Build: 8.09s.  Total: 8.10s.
[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq

$ spack find 
==> 0 installed packages.
```

The db seems to be written correctly : 

```
database:
  installs:
    d6pdl6xvnvap6ihrqcqtgvweghbszmix:
      explicit: true
      installed: true
      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix
      ref_count: 0
      spec:
        zlib:
          arch: linux-x86_64
          compiler:
            name: gcc
            version: '4.8'
          dependencies: {}
          namespace: builtin
          parameters:
            cflags: []
            cppflags: []
            cxxflags: []
            fflags: []
            ldflags: []
            ldlibs: []
          version: 1.2.8
    esfmhl54wbdb7nnnip6y6jbxlbmxs2jq:
      explicit: true
      installed: true
      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq
      ref_count: 0
      spec:
        szip:
          arch: linux-x86_64
          compiler:
            name: gcc
            version: '4.8'
          dependencies: {}
          namespace: builtin
          parameters:
            cflags: []
            cppflags: []
            cxxflags: []
            fflags: []
            ldflags: []
            ldlibs: []
          version: '2.1'
  version: 0.9.1
```



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/zfp/package.py b/var/spack/repos/builtin/packages/zfp/package.py
--- a/var/spack/repos/builtin/packages/zfp/package.py
+++ b/var/spack/repos/builtin/packages/zfp/package.py
@@ -35,8 +35,8 @@ class Zfp(MakefilePackage):
        of zfp 0.5.1 or newer also support compression of integer data.
     """
 
-    homepage = "http://computation.llnl.gov/projects/floating-point-compression"
-    url      = "http://computation.llnl.gov/projects/floating-point-compression/download/zfp-0.5.1.tar.gz"
+    homepage = 'http://computation.llnl.gov/projects/floating-point-compression'
+    url      = 'http://computation.llnl.gov/projects/floating-point-compression/download/zfp-0.5.1.tar.gz'
 
     version('0.5.1', '0ed7059a9b480635e0dd33745e213d17')
     version('0.5.0', '2ab29a852e65ad85aae38925c5003654')
@@ -45,8 +45,11 @@ class Zfp(MakefilePackage):
         default='64',
         values=('8', '16', '32', '64'),
         multi=False,
-        description='Bit stream word size: use smaller for finer \
-            rate granularity. Use 8 for H5Z-ZFP filter.')
+        description='Bit stream word size: use smaller for finer ' \
+            'rate granularity. Use 8 for H5Z-ZFP filter.')
+
+    variant('shared', default=True,
+            description='Build shared versions of the library')
 
     def edit(self, spec, prefix):
         config_file = FileFilter('Config')
@@ -56,15 +59,23 @@ def edit(self, spec, prefix):
             spec.variants['bsws'].value)
 
     def build(self, spec, prefix):
-        make("shared")
+        with working_dir('src'):
+            if '~shared' in spec:
+                make('static')
+            else:
+                make('shared')
 
     def install(self, spec, prefix):
         incdir = 'include' if spec.satisfies('@0.5.1:') else 'inc'
 
-        # No install provided
+        # Note: ZFP package does not provide an install target
         mkdirp(prefix.lib)
         mkdirp(prefix.include)
-        install('lib/libzfp.so', prefix.lib)
+        # Note: ZFP package builds .so files even on OSX
+        if '~shared' in spec:
+            install('lib/libzfp.a', prefix.lib)
+        else:
+            install('lib/libzfp.so', prefix.lib)
         install('%s/zfp.h' % incdir, prefix.include)
         install('%s/bitstream.h' % incdir, prefix.include)
         if spec.satisfies('@0.5.1:'):


Test patch: