aentos/aentos-lxc-builder — pull request #8 by ayosec (2012-10-07 02:08:16+00:00)
Title: Simplify installer

I tested it as a non-privileged user, with

```bash
$ rake install DESTDIR=/tmp/fake-root/ BINDIR=/usr/bin
```

My idea is to have a Debian-package-friendly installer

Summary of changes:

- Use the standard `DESTDIR`. Projects based on autotools use this variable
to modify (at install time) the directory where the files will be copied.
Debian packages use it install the files under a custom root, where the
hierarchy is duplicated, and can be added to a .deb file.

More info at http://www.gnu.org/prep/standards/html_node/DESTDIR.html

- Use `BINDDIR` to set the path where the binaries will be installed. We can
set `BINDDIR=/usr/bin` to use a standard path

- Generated files for the cookbooks will be under `.target`. This reduces
pollution in the working directory

- The cookbooks are kept between `rake` invocations. Instead of request a
clone in every call, we kept the repository and use a `git reset --hard`
to check out the desired revision.

- The `run_quiet` method checks if the command finished with an error. If so,
the script will be finished.

- Binaries are copied with standard `install` method.

- The root requirement was removed. We let the user to use the script with
a non-privileged user.

- All binaries are installed with `install:commands`. Previous version was
skipping the `lxc-builder`.

- The `template` task was removed in a previous. I removed it from the
`install:all` dependencies.