Enable the unused macro warning again, now without performance penalty

- Track non-global macro definitions in a helper variable, this
  eliminates the need for costly macro table walking at end of each
  expansion cycle as we only bother doing it if non-global macros
  were defined during a given expansion cycle.
Add utf-8 validation to librpmbuild, take 1 (ticket #30, RhBug:948712, ...)

- This adds brutally simple utf-8 validation to spec parse & package
  construction: all string-class tags in headers are checked regardless
  of other tag semantics.
- Parse-time validation is optional via RPMSPEC_NOUTF8
  flag, but package construction time is required as we want to
  stomp RPMTAG_ENCODING to all packages that pass. What is always
  optional is whether non-valid utf-8 strings fail the build, defaulting
  to off (but distros probably want to enable it)
- Note we dont give a damn about the spec itself, only what ends up in
  packages: strings can come from numerous other sources than spec
  directly, and OTOH who cares if eg spec comments are non-utf?
Regression the 13th: The Final Friday

- Yet another regression from the recent dependency refactoring and
  ensuing patches-on-patches-on-patches work: some rpmlib() dependencies
  (payload, tilde) are added as late as writeRPM(), those have been going
  to /dev/null recently.
- The fix actually removing code is probably a good sign...
Use rpmRC return type in checkSep
Refactor dependency checking code into checkDep()
Clean up dependency relation parsing

Fix indenting and simplify control flow.
Add back comment lost with commit #e2ce4c21
Simplify tilde-dependency checking

- Now that all our dependencies are in per-package rpmds arrays this
  is far easier (and faster as well)
Drop fsize parameter from rpmCharCheck()

Everybody calls it with the length of the string and the
strstr it uses ignores the fsize parameter anyway.
Refactor dependency comparison parsing into rpmds

The function will be used by the rich dependency parser
as well.
Use correct type in rpmSanitizeDSFlags and rpmParseDSFlags
Add RPMSENSE_RICH for rich dependencies

Rich dependencies will be stored as a string with no EVR and the
RICH flag set. This unfortunately means that we have to parse
them again when checking dependencies.

Also add a rpmlib() marker when a rich dependency is used as
conflicts or requires dependency.
Add a parser for rich dependencies

The data is returned via a callback, this allows us to use it
for different purposes.

Rich dependencies are for the form "(arg)" or "(arg1 op arg2)",
the arguments can either be simple dependencies, or again
rich dependencies.

We don't want to enforce a space between the argument and the
closing ')', thus we check the number of parens when parsing
the argument and stop when we encounter an unbalanced ')'
character.
Parse rich dependencies in spec files

We use the callback to normalize the rich dependency (i.e. strip
spaces, canonicalize op names).
Add rich dependencies to requires/conflicts index database

We use the parser to break up rich dependencies into parts, adding
'!' as prefix for negated dependencies (e.g. the right part of
IF dependencies).
Add rpmdsParseRichDep() function for rich dependency splitting

This function splits up a rich dependency into an operation and
two sub-dependencies. Chained dependencies like (A & B & C & D)
are split into A & (B & C & D).
Support rich dependencies in rpmtsCheck

We use rpmdsParseRichDep() to split the rich dependency and then
recursively call unsatisfiedDepend() on the sub-dependencies.

We also need to deal with "negated" dependencies, a requires
with an IF dependency produces conflict like subdependencies.
Those subdependencies are prefixed with a '!' character in the
requires index database. We currently do not support this for
conflict dependencies, this is enforced by the spec file parser.

Fortunately we already read all conflicts/requires from the
index databases, so we can setup hash tables which results in
almost no extra costs.
Support rich dependencies in rpmtsOrder

We use rpmdsParseRichDep to split rich dependencies and then
simply recursivly call addRelation for the sub-dependencies.
Ensure that rpmlib() parts in rich dependencies have RPMSENSE_RPMLIB set
Dependency refactor whack-a-mole, aka One More Time...

- Commit 0bda2faa4de368a87f85084856a5fed701774acb fixed manual
  dependencies in rpmspec queryies, but missed automatic self-provides.
  Add the self-provides before the first round of header dependency
  population to fix. SIGH.
- Another sorta related side-effect is that the exact order of rpmspec
  output changes as things are now properly sorted, previously it
  was a mixed bag.