Delete trigger indexes too from header before adding again (RhBug:1131892)

- Fixes regression introduced in the regression-fix
  commit 0bda2faa4de368a87f85084856a5fed701774acb, *facepalm*
- Unlike other dependency types, trigger dependencies involve a fourth
  tag which we forgot to delete before adding again, causing duplicate
  trigger indexes

(cherry picked from commit 1566c18b6efbda7b4c367f4c0ee31b4d5be2d2fe)
Revised fix for RhBug:1131892

- Didn't realize there's rpmdsTagTi() now, which is fit for this
  purpose and doesn't look as much out of line with the others.
  No functional changes here though.

(cherry picked from commit 6ee2468934b45c1c9d1b84b1ba70fe44373425c9)
Fix triggerindex handling in rpmdsMerge

It always created a triggerindex array and also did not correctly
initialize it with -1.

(cherry picked from commit 1f22cc40518b3f671201803c5f937fae6b6afe63)
Resurrect dependency spew during build

- Since commit a357c99c58a5e1367160dfa692f26d14bd3a3df1 the dependencies
  are no longer in the header so there's little to print from there.
  As it happens things are much saner this way, we no longer need
  to create rpmds'es just to print stuff.

(cherry picked from commit 404f053f7829fa859209ded8399243dba851f263)
Resurrect rpmlib() dependencies on source rpms

- Commit 0bda2faa4de368a87f85084856a5fed701774acb caused a regression
  where rpmlib() dependencies are no longer added to src.rpm packages
  as the header is populated early, whereas rpmlib() dependencies
  get added late in the game. So nothing was pushing the rpmlib
  stuff to header. Sigh.

(cherry picked from commit 8b540fbf1bb77320772b87d40518d761f62752b3)
Dirty kludgery to fix rpmdeps segfault (RhBug:1131892)

- Another regression from the recent rpmfc work, in rpmdeps context
  there's no spec or packages from it. Allocate a dummy package so
  we have some place to store the dependencies. And yes its ugly.

(cherry picked from commit 49f2bb7d8fd91f2d8b22bf7128fd3defe4ed5434)
Fixed double dealocation of ei pointer (RhBug:1133885)

(cherry picked from commit 0ab486b8e169edbe66870f5ff43f9dd07ffd2655)
Dont try to close non-existent fdno's on Fclose()

- Commit 547a004b7e1e9e5a5d6cc04ce0539242bff5e592 introduced a regression
  on stacked io Fclose() return code, details at
  http://lists.rpm.org/pipermail/rpm-maint/2014-August/003731.html
- The original code seems fishy in other ways (missed errors), this
  hopefully fixes both cases by only attempting to close actually
  open fdno's and only considering actual closes for error codes.

(cherry picked from commit 0ffc0e29e949c63b897fb87bd705e0fb8d0990f9)
Preparing for rpm 4.12.0-rc1
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...

(cherry picked from commit cac311c2ddb43b62ad9dbdb5543d50848eb9fd65)
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.

(cherry picked from commit 4bc2900baee9ff289dabc47609059accc0f39983)
Ensure librpm doxygen stuff gets rebuilt when version changes

- configure.ac is where the version is defined, so...

(cherry picked from commit 297eb7ae2f792bf55f4a4d0674800b3ccb6b43af)
Preparing for rpm 4.12.0
Turn invalid double separator error into a warning

- As hysterical as it seems, people keep banging their heads into this:
  older distros have these invalid dependencies deployed etc and people
  do expect to create srpms and do test-builds on newer distros they're
  running themselves. Which, put that way, seems rather reasonable...
- For history reference, the sanity check was originally introduced in
  commit b2cf1471bbe2c35e3c36510a9e3f59919d8ed2c8 and
  67ccf8d99630f4edad0ea16dddaca0a3355fba00,
- Backported from commit 1b3f7547c532b1f5ad68228571f1716d5be5b455
Fix archive size tag missing cpio trailer size (RhBug:1142949)

- Fixes regression from commit 7f84a126ab43f2d0163911100b4432364d0952a6
  which causes archive size to be determined before closing the archive
  when closing actually writes the cpio trailer into the archive. Thus
  RPMTAG_ARCHIVESIZE (and RPMTAG_LONGARCHIVESIZE) are off by the
  cpio trailer size in all packages built with rpm 4.12.0 and
  pre-releases :(
- Move rpmcpioFree() to rpmfiFree() to allow Tell() on the archive
  after closing it, swap to original order of things on build-side.

(cherry picked from commit a655cee655f7a2b8b4c7ae214afceefa986378f5)