ncurses: optimize for size and smaller static linkage
nano: debloat binary size
make it possible for the user to define custom CFLAGS and LDFLAGS

the build template now sources a file which can define
optcflags and optldflags, which can then be used by packages.

it also cares about the DEBUGBUILD logic, so using those flags
we can automatically support the DEBUGBUILD env var.

TODO:
- add those flags to all packages, unless they break something.
- remove separate DEBUGBUILD logic from build scripts, unless
  they do more than just setting CFLAGS (for example busybox).
put some stage0 logic for copying /etc etc to prepare instead of finish script

this is needed so we can take advantage of custom CFLAGS and LDFLAGS during
stage0 build.
make some packages pick up the new custom optflags
gdb: fix regression and re-add threaddb patch

due to testing with android's libthread_db i've done, the patch
appeared to be unneeded; however that's untrue.

this time the patch is done in a proper way though, so it could even
go upstream.
add "core" metapackage

it's planned to ship future sabotage images in a core and a full variant.
this is a first draft of what the core install will contain.
it should offer an environment that contains anything to get started
setting up network access and feature a complete development toolchain,
as well as a decent editor and a terminal-mode web browser, and maybe
some terminal irc client (but not irssi due to glib bloat).

so far, it's 440 MB uncompressed, which should be further optimized,
maybe by making curl use an alternate crypto library and other tweaks like
removing unneeded files, such as documentation in gnu info format.
bump butch to 0.3.0 and simplify build process

it's no longer needed to source the config before building stage0,
nor is it needed inside the rootfs before invoking butch.

butch is now being installed as "butch-core" and butch is a wrapper
script that sources the config.

that makes it easy to migrate the config into /etc/butch.conf at
some point.

an additional change of butch is that the package db, previously
/src/pkg/installed.dat, is now installed into /var/lib/butch.db
instead. that way /src/pkg/ can be removed without deleting the
package db by accident.
a reason why one may want to do that is to symlink pkg and KEEP
to a sabotage git checkout, so you automatically have fresh
packages after a git pull.

these changes require that $H is set to $PWD before the
stage0 config is sourced (automatically done by build-stage),
and that the config is aware of $H.
unfortunately this requires existing checkouts to update their config,
if they want to omit the ". config" step.