Fixed `test` portability

The `-a`, `-o`, `(`, and `)` operands are not portable and should be avoided.
Fixed `expr` portability

When performing arithmetic, use `expr 0 + $var` if `$var` might be a negative
number, to keep expr from interpreting it as an option.

No expr keyword starts with X, so use expr X"word" : 'Xregex' to keep expr from
misinterpreting word.
Added MAKEFLAGS to sub-make invocations

Posix requires make to use MAKEFLAGS to affect the current and recursive
invocations of make, but allows implementations several formats for the variable.
Fixed SHELL variable protection

Posix-compliant make should never acquire the value of `$(SHELL)` from the
environment, even when `make -e` is used.
Fixed sub-make behaviour for export variable
Use -C flag to to call a sub-make to another directory
Removed useless exit call because the `-e` shell flags imply
Replaced from `$(srcdir)/..` to `$(top_srcdir)`
Added CYGPATH_W to convert proper path
Fixed string quoting on the postintall script
Added GPG macro to custumize gpg program
Fixed `sys.path`
Fixed VERSION regeneration
Fixed WS
Fixed installcheck target
Fixed when DESTDIR is empty it install python lib to the current path
Moved cyg-apt python lib from pythondir to libdir/PACKAGE
Fixed backslash escaping in sed expression
Fixed quoting strategy by simple quote only file path
Fixed cyg-apt program path on appveyor