Erm, actually mark the special %license files as RPMFILE_LICENSE

- Somehow I thought this already got done somewhere... the new special
  %license files need to be marked as RPMFILE_LICENSE for easy querying.
(cherry picked from commit 5998b02665c30a5b560f8fe899c19235f9299bd0)
Add cli-switch to query for license files
(cherry picked from commit 4b19c17f53f56c841903e5d6a09efdb10b2ca400)
Add $RPM_CONFIGDIR/macros.d/ directory to default macro path (RhBug:846679)

- There of course already is a drop-in directory for macro config bits
  in $(sysconfdir)/rpm/ but as /etc is supposed to be per-host admin
  territory, having another place for system package provided rpm config
  doesn't seem unreasonable.
- Whether this early in the path is the best possible or even reasonable
  position for this remains to be seen... but this way it could be used
  for "factory default" config bits by rpm itself as well, while still
  permitting vendor/host/user override.
(cherry picked from commit dcd261b9fe1e61e8ac3e99dbb443145bbf896886)
Account for temporary disk-space requirements on updates (ticket #175)

- When updating packages, we first create them with a temporary names
  and only after all files from payload have been created this way,
  the files are renamed to the final target. This means that performing
  an update temporarily requires roughly twice the disk space (and inodes)
  compared to the final result on per-package level. Which matters
  when space is tight, such as presumably in RhBug:872314.
- Simulate what happens on upgrades by adding block and inode delta
  to the equation: installing a file always consumes an inode and
  the specified amount of disk space. But when replacing files,
  reduce the size-delta from disk consumption *after* checking for
  problems in a given DSI.
- Also fixes inode accounting which has been broken for forever (since
  commit a9a1fd866c573f41287e6ad256ce64b3970a1eaa more exactly)
(cherry picked from commit 85df102165fdbe64978f2019d757d400e7448218)
Remove ancient, no longer relevant comment

- Since commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e, only the first
  instance of shared files is created, the rest are FA_SKIP which
  consume no disk space and are not counted either.
(cherry picked from commit f8da4f613680b4da4ee191f8b7451de9b36bfcbd)
Account for temporary disk-space requirement on forced replace too

- Similar to commit 85df102165fdbe64978f2019d757d400e7448218, but
  for forced file replacements.
(cherry picked from commit b1d3f21a54eb1f23a08e9e2d943a6438502b0e47)
Add --undefine cli switch for undefining macros (related to RhBug:876308)
(cherry picked from commit 644f080a4868208bf61f28103b7b676c094129a0)
Fix double-free on %caps in spec (RhBug:877512)

- Fixes regression caused by dumb refactoring mistake in commit
  807ba93a6cf168410e3801347898949f356fcd6c
(cherry picked from commit 6bdd34c451dbf69792c59704e06f1ccb045ae743)
Avoid locale issues in rpm2cpio.sh (RhBug:878363)

- In gawk >= 4.0.x printf() "adjusts" things according to current locale,
  but we need the data as it is. Forcing C locale prevents gawk from
  getting funny ideas about character conversions...
(cherry picked from commit c0e95f1cedefd6d7522ef2cf7a2ada7c83821596)
Add missing <errno.h> include

- Should've been in commit cbd6ef58bbc122e6adf2138679915bd3845d6756,
  this breaks build when selinux-support is not compiled in
(cherry picked from commit ebba1c7b58ba089bb9e1ded147c789d9ca067b6c)
Avoid deprecation warnings from NSS >= 3.14

- NSS >= 3.14 introduces support for DSA2 and marks DSA_SUBPRIME_LEN
  as deprecated. Use explicit DSA1_SUBPRIME_LEN (we only support DSA1
  for now) instead where available, add compatibility define for
  older versions.
- Also directly include <blapit.h> where its defined - blabit.h gets
  included via cryptohi.h but being explicit about it avoids having
  to redefine it again "just in case".
(cherry picked from commit 73be0fc7d9faab9f1120e2979f2ca1feed522195)
Use NSS-defined constants for DSA q-bits and signature length too

- No functional changes here (either), but using the proper constants
  simply makes things that little bit clearer.
(cherry picked from commit 604da18bc267f89568081c1ab163c7fc45207220)
Remove extra ',' in NSS configure checks, whoops
(cherry picked from commit e1c67173d38016a88989f5b09e0934f90094fe85)
Get rid of long since deprecated VFY_VerifyDigest() uses

- VFY_VerifyDigest() has been deprecated since NSS >= 3.12 and for
  a good reason too: with VFY_VerifyDigest() caller needs to painfully
  enumerate every possible supported enc + hash combination, only for
  NSS to revert the process. Use the saner VFY_VerifyDigestDirect()
  interface instead and test for its presence in configure.
- This means we now require NSS >= 3.12 but as that's already 4.5 years
  old and included in ancient beasts like RHEL-4, this doesn't seem
  exactly unreasonable requirement. And then there's always beecrypt...
(cherry picked from commit 9b995a7674adba08248fac79ae8b23ecbecc13de)
Unbreak --setperms (RhBug:881835)

- Fixes a regression introduced in rpm >= 4.10 caused by query format
  simplification (loss of zero padding support), in commit
  1f1e5e88a1f6c60cf2d11014d809000e97a63aad.
- 'chmod' command doesn't need zero padding, just remove the formatting.
  In fact we shouldn't be passing the entire mode to it but just the
  permission bits, but fortunately chmod isn't too picky here.
(cherry picked from commit 4c90c79e3f3c178189ad3bd89dfd87cd3a2290ab)
Condence NSS getHashType() a bit, handle SHA224 too

- Not much point in enumurating unsupported cases, or with switch-breaks
  after returns.
- Recognize SHA224 too
(cherry picked from commit 466a6b554e7f7ded9f1c59646e6b64243ce16812)
Fix build with older NSS versions that dont support SHA224

- SHA224-support was added around NSS 3.13, dont break compilation
  with older versions just for this rarely used hash.
- HASH_AlgSHA224 is an enum so test for SHA224_LENGTH define instead
(cherry picked from commit e15e29823451663e27a5bec6c865b37901f1c315)
Handle allocation failure in NSS DSA signature initialization
(cherry picked from commit 2d39f13064f6e6ff1a1633b708e7ba5622a7e8eb)
Ensure correct return code on malformed signature in packages

- rpmpkgRead() starts with assumed failure, but there are a number
  of places assigning the return code, and by the time we get
  to the parsePGPSig() calls its likely to be RPMRC_OK, so the
  jumps to exit result in "all is well" return code on a signature
  we couldn't even parse. Oops.
- Set the failure status explicitly to fix this fairly nasty regression
  introduced in commit e8bc3ff5d780f4ee6656c24464402723e5fb04f4, ie
  rpm >= 4.10.
(cherry picked from commit 96a616c6aed4c516789a154af188f005caf23f14)
Preparing for 4.11.0-beta1