fix .gitignore to work for Eclipse on MacOS X

The intention being to exclude (ignore) all Eclipse generated files,
simply specifying the name of the file in the .gitignore file is
sufficient (it will be excluded from any and all directories).

The directory + glob + name seems to work on Linux, but does not
on my Mac OS X.9 laptop. The solution adopted here works on both.

You may want to check if something similar can be done for IntelliJ
and Maven.

Target: master
Patch: https://rb.dcache.org/r/7132/
Acked-by: Tigran
Require-notes: no
Require-book: no