Repository: spack/spack

Issue:
Automake version mismatch in cryptsetup
### Spack version
Pulled e1238bae9053d3c283c1721f85af78f3539f473d (2020-03-27) without any additional configuration. 
```console
$ spack --version
fatal: No names found, cannot describe anything.
0.14.1
```

### Steps to reproduce the issue

```console
$ spack install cryptsetup
...
     219    ==> 32048: cryptsetup: Executing phase: 'build'
     220    ==> [2020-03-27-11:07:25.493154, 7479] 'make' '-j2'
     221     cd . && /bin/bash /tmp/ubuntu/spack-stage/spack-stage-cryptsetup-2.2.1-rsdkky2pjkptxrmbuckroajv
            tcz4qkl5/spack-src/missing automake-1.16 --gnu Makefile
  >> 222    configure.ac:19: error: version mismatch.  This is Automake 1.16.2,
     223    configure.ac:19: but the definition used by this AM_INIT_AUTOMAKE
     224    configure.ac:19: comes from Automake 1.16.1.  You should recreate
     225    configure.ac:19: aclocal.m4 with aclocal and run automake again.
...
```

### Platform and user environment
```commandline
$ uname -a 
Linux roman-spack-debug 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -d
Description:    Ubuntu 18.04.4 LTS
``` 

I do not have any experience with automake/autoconf. However, the [documentation](https://spack.readthedocs.io/en/latest/build_systems/autotoolspackage.html) states that the `autoreconf` phase includes running `aclocal`. The debug file shows that `autoreconf` did run but `aclocal.m4` is not updated (its timestamp is 2019-09-06). I cannot tell whether it is a bug in `autoreconf` phase or `aclocal` only runs when `aclocal.m4` is not present. If I add `force_autoreconf = True` to the recipe, `aclocal.m4` is updated and installation is successful.

If the `force_autoreconf` setting is indeed required, I can create a pull request to fix the issue.

### General information

- [x] I have run `spack --version` and reported the version of Spack
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
I can't reproduce this error on the latest `cryptsetup` versions added by #15823:
```console
$ spack install cryptsetup
[...]
==> 22285: cryptsetup: Successfully installed cryptsetup
  Fetch: 26.73s.  Build: 27.50s.  Total: 54.24s.
[+] /home/culpo/PycharmProjects/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.0.1/cryptsetup-2.3.1-hg7pd575zsz7zvlpeociapl5p7yz5g5z

$ uname -a
Linux nuvolari 5.3.0-45-generic #37~18.04.1-Ubuntu SMP Fri Mar 27 15:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -d
Description:    Ubuntu 18.04.4 LTS
```
The error remains instead with version 2.2.1:
```console
$ spack install cryptsetup@2.2.1
[...]
 >> 222    configure.ac:19: error: version mismatch.  This is Automake 1.16.2,
     223    configure.ac:19: but the definition used by this AM_INIT_AUTOMAKE
     224    configure.ac:19: comes from Automake 1.16.1.  You should recreate
     225    configure.ac:19: aclocal.m4 with aclocal and run automake again.
     226    WARNING: 'automake-1.16' is probably too old.
[...]
```
I'll submit a fix soon to restrict to restrict of `automake` in that case.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/cryptsetup/package.py b/var/spack/repos/builtin/packages/cryptsetup/package.py
--- a/var/spack/repos/builtin/packages/cryptsetup/package.py
+++ b/var/spack/repos/builtin/packages/cryptsetup/package.py
@@ -34,6 +34,8 @@ class Cryptsetup(AutotoolsPackage):
     depends_on('libtool',  type='build')
     depends_on('m4',       type='build')
 
+    depends_on('automake@:1.16.1', when='@2.2.1', type='build')
+
     # Upstream includes support for discovering the location of the libintl
     # library but is missing the bit in the Makefile.ac that includes it in
     # the LDFLAGS. See https://gitlab.com/cryptsetup/cryptsetup/issues/479


Test patch: