PDB-128: Support Oracle Java distribution.

On Debian it's possible to package releases from Oracle through
make-jpkg, a utility provided by the java-package package:
https://wiki.debian.org/JavaPackage

This commit adds support for:
 * Detecting Oracle Java 1.7 packaged RE or SDK
 * Satisfy the package requirement of Java by looking for the j2re1.7
   provides that the make-jpkg packages carry, both RE and SDK.

I've left out satisfying the dependency through j2re1.6 as @kbarber
and I agreed that we shouldn't promote the usage of Java 1.6 any
further.
Fixes an issue when using spyscope as a lein user profile
Merge branch 'maint/1.5.x/spyscope-lein-user-profile-fix' into 1.5.x

* maint/1.5.x/spyscope-lein-user-profile-fix:
  Fixes an issue when using spyscope as a lein user profile
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Fixes an issue when using spyscope as a lein user profile

Conflicts:
	project.clj
Merge pull request #793 from daenney/debian-java-1.6.x

PDB-128: Support Oracle Java distribution.
(PE-2675) Change the order that filters are applied for events

When using the `distinct-resources` flag of an event query, the
previous behavior was that we would do the filtering of the events
*before* we would eliminate duplicate resources.  This was not
the expected behavior in many cases in the UI; for example,
when filtering events based on event status, the desired behavior
was to find all of the most recent events for each resource *first*,
and then apply the filter to that set of resources.  If we did the
status filtering first, then we might end up in a state where we
found the most recent 'failed' event and showed it in the UI even
if there were 'success' events on that resource afterwards.

This commit changes the order that the filtering happens in.  We
now do the `distinct` portion of the query before we do the filtering.

However, in order to achieve reasonable performance, we need to
at least include timestamp filtering in the `distinct` query; otherwise
that portion of the query has to work against the entire table,
and becomes prohibitively expensive.

Since the existing timestamp filtering can be nested arbitrarily
inside of the query (inside of boolean logic, etc.), it was not
going to be possible to re-use that to handle the timestamp filtering
for the `distinct` part of the query; thus, we had to introduce
two new query parameters to go along with `distinct-resources`:
`distinct-start-time` and `distinct-end-time`.  These are now
required when using `distinct-resources`.

This functionality is fairly specific to PE and should probably
be separated into a PE-specific query endpoint in the future.
Add documentation for `distinct-resources` query parameter
Refactor `validate-distinct-options` into common events http ns
Merge pull request #823 from cprice404/bug/1.5.x/PE-2675-change-filter-order-for-distinct-resource-events

Bug/1.5.x/pe 2675 change filter order for distinct resource events
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Refactor `validate-distinct-options` into common events http ns
  Add documentation for `distinct-resources` query parameter
  (PE-2675) Change the order that filters are applied for events

Conflicts:
	src/com/puppetlabs/puppetdb/http/v3/aggregate_event_counts.clj
	src/com/puppetlabs/puppetdb/http/v3/event_counts.clj
	src/com/puppetlabs/puppetdb/http/v3/events.clj
PDB-341 Fix some API version crossover issues

This patch fixes the immediate bug provided with PDB-341:

* select-resources not working for file/line in v3 api

But as a consequence of solving this problem we've found other inconsistencies
with the API:

* v3 of the resources end-point was using the v2 of the 'not' operator
* v3 of the resources end-point was using the v2 fact operators for select-facts

In short, these bugs can be put down to copy & paste errors when we cut the v3
release. The facts end-point in particular still had a lot of code pointing at
v2 api stuff which was fine when these were backwards compatible but in some
cases this has caused problems as we have found.

The patch here breaks up the facts endpoints into their versioned counterparts
as you would expect to hopefully avoid this issue. In the future we should
find a better way to version and decompose this (for example, using a multi-method,
condp or other 'case' still look for version behaviour for all the operators).

I've also copied over the testing from the v1 and v2 endpoints that was missing
from v3. I've achieved this by combining the tests into a single file and simply
iterating over the v2 and v3 end-points.

Also, I've removed the use of custom 'get-request' functions all over the place
since this was making the development inconsistent. There was also a minor
variant known as 'make-request' which I've removed.

'endpoint' is now declared at the top of each test to be re-used again to reduce
any copy and paste errors in the future as well.

Any other changes include either modifying items to fix bugs from the above
changes or a general increase in coverage where I saw it needed it.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-341 Remove extra get-response and fix ordering issues in tests

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-341 Ensure body of response is drained after query

This avoids a deadlock issue whereby the query is still running, but the next
test is trying to wipe the database.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #818 from kbarber/ticket/1.6.x/PDB-341-select-resources-file-line

PDB-341 Fix some API version crossover issues
(PDB-377) Disabling JAR repacking when creating RPMS

The manipulation of the class files causes issues with AOT compiled
Clojure code, specifically around defrecords/deftypes. Disabling
repacking prevents the issue.
Merge pull request #827 from senior/ticket/1.6.x/pdb-377-fedora-jar-repacking-fix

(PDB-377) Disabling JAR repacking when creating RPMS
(maint) Remove Sid from package build defaults

Removing Sid to prevent package builds from wedging