Repository: spack/spack

Issue:
./spack install libelf

I am getting following error while installing the application
spack/bin$ ./spack install libelf
==> Installing libelf
==> Searching for binary cache of libelf
==> Warning: No Spack mirrors are currently configured
==> No binary for libelf found: installing from source
==> Fetching http://www.mr511.de/software/libelf-0.8.13.tar.gz
######################################################################### 100.0%
curl: (6) Could not resolve host: leere.seite
==> Fetching from http://www.mr511.de/software/libelf-0.8.13.tar.gz failed.
==> Error: FetchError: All fetchers failed for libelf-0.8.13-rblqbdguqwodihmkricvfsli2yzolkot

/home/arun/Documents/spack/lib/spack/spack/package.py:961, in do_fetch:
        958                raise FetchError("Will not fetch %s" %
        959                                 self.spec.format('$_$@'), ck_msg)
        960
  >>    961        self.stage.create()
        962        self.stage.fetch(mirror_only)
        963        self._fetch_time = time.time() - start_time
        964

---

### Steps to reproduce the issue

```console
$ spack install <spec> # Fill in the exact spec you are using
... # and the relevant part of the error message
```

### Platform and user environment

Please report your OS here:
```commandline
$ uname -a 
Linux nuvolari 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -d
Description:	Ubuntu 18.04.1 LTS
``` 
and, if relevant, post or attach:

- `packages.yaml`
- `compilers.yaml`

to the issue

### Additional information

Sometimes the issue benefits from additional details. In these cases there are
a few things we can suggest doing. First of all, you can post the full output of:
```console
$ spack spec --install-status <spec>
...
```
to show people whether Spack installed a faulty software or if it was not able to
build it at all. 

If your build didn't make it past the configure stage, Spack as also commands to parse 
logs and report error and warning messages:
```console
$ spack log-parse --show=errors,warnings <file-to-parse>
```
You might want to run this command on the `config.log` or any other similar file
found in the stage directory: 
```console
$ spack location -s <spec>
```
In case in `config.log` there are other settings that you think might be the cause 
of the build failure, you can consider attaching the file to this issue.

Rebuilding the package with the following options:
```console
$ spack -d install -j 1 <spec>
...
```
will provide additional debug information. After the failure you will find two files in the current directory:

1. `spack-cc-<spec>.in`, which contains details on the command given in input 
    to Spack's compiler wrapper  
1. `spack-cc-<spec>.out`, which contains the command used to compile / link the 
    failed object after Spack's compiler wrapper did its processing 

You can post or attach those files to provide maintainers with more information on what
is causing the failure.



Discussion:
I have the same error and would really like to know, what is wrong and how to fix it.
@ClmnsRck Thelibelf download is broken. Try manually downloading from here to see that:
https://directory.fsf.org/wiki/Libelf

The solution in these cases is usually to find the same tarball from a well-known Linux distro source, and change the package.py file to use it. As long as the checksum is the same, it's all OK.

Maybe try slackware:
http://ftp.slackware.com/pub/gsb/gsb64-2.30_slackware64-13.1/source/l/libelf/

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/libelf/package.py b/var/spack/repos/builtin/packages/libelf/package.py
--- a/var/spack/repos/builtin/packages/libelf/package.py
+++ b/var/spack/repos/builtin/packages/libelf/package.py
@@ -10,13 +10,19 @@ class Libelf(AutotoolsPackage):
     """libelf lets you read, modify or create ELF object files in an
        architecture-independent way. The library takes care of size
        and endian issues, e.g. you can process a file for SPARC
-       processors on an Intel-based system."""
+       processors on an Intel-based system. Note: libelf is no longer
+       maintained and packages that depend on libelf should migrate to
+       elfutils."""
 
-    homepage = "http://www.mr511.de/software/english.html"
-    url      = "http://www.mr511.de/software/libelf-0.8.13.tar.gz"
+    # The original homepage no longer exists, but the tar file is
+    # archived at fossies.org.
+    # homepage = "http://www.mr511.de/software/english.html"
+
+    homepage = "https://directory.fsf.org/wiki/Libelf"
+    url      = "https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz"
 
     version('0.8.13', '4136d7b4c04df68b686570afa26988ac')
-    version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7')
+    # version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7')
 
     provides('elf@0')
 


Test patch: