Remove leading "./" from filenames in mtree file

A properly formatted mtree file may stick a leading "./" in front
of file names in the root directory.  Strip this if present.

Signed-off-by: Allan McRae <allan@archlinux.org>
configure.ac: cleanup duplication in --enable-git-version

Avoid adding our own messaging, as autoconf will add this for us with
the result of the AC_CHECK_FILE test. Reuse the cache variable from
autoconf to set our local variable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
buildsys: eschew use of DEFS, prefer AM_CPPFLAGS

This is redundant, and any usage of -D should belong to CPPFLAGS.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
etc/Makefile: simplify build rule for conf files

This lets us define the build rule and the dependency all at once, and
additionally removes the need for an intermediate temp file.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Remove Darwin support

Signed-off-by: Allan McRae <allan@archlinux.org>
Remove Cygwin support

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: always run tidy_install on repackaging

When using "makepkg -R" without a packge function, we should still
run tidy_install as the user might have added other packaging options
such as (e.g.) '!emptydir' to remove empty directories on repackaging.
Of course we can not revert some options when repackaging without a
package function.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: add option to include debugging compiler flags

Add a "debug" option that appends the compiler flags specified in the
variables DEBUG_CFLAGS and DEBUG_CXXFLAGS in makepkg.conf to their
counterpart buildflags.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: move debug symbol stripping to separate function

Move stripping of files to a spearate function that will be expanded
for the handling of creating debug symbol packages.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: always use pkg/$pkgname as $pkgdir

Unify split and single packages to always use a folder within pkg/
as thier $pkgdir.  This will allow a folder for storing a package with
stripped debug symbols to be added within pkg/ too.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: strip debugging symbols into separate folder

When using the "debug" option in combination with "strip", move the
debugging symbols into a separate directory ($pkgdir-debug/usr/lib/debug)
suitable for creating a package from.

Create hardlinks between debugging symbols of hardlinked files and add
symlinks in the .build_id directory if the binary has a build ID.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: output the name of the package being created

Although it should be currently quite obvious what package is being
created when "Creating package..." is printed, it will not be in the
future when a debug package is potentially created too.  Also, given
$pkgname is always correctly set when split packaging now, we no
longer need to pass that around.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: create package from stripped debug symbols

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: deprecate PKGBUILDs without a package() function

The package() function has been around since pacman-3.3 and has
significant advantages including limited fakeroot usage and correct
repackaging.  The ability to use PKGBUILDs without a package function
will be removed in a future release.

Signed-off-by: Allan McRae <allan@archlinux.org>
repo-add: quote filename for consistent output style

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: allow debug package suffix to be configurable

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: assign debugging symbol directory to a variable

Simplifies the stripping of files a lot.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: install debug symbol packages if requested

When using "makepkg -i", install the debugging symbol packages too
if present.

Signed-off-by: Allan McRae <allan@archlinux.org>
Split common utility functions for libalpm and pacman

There is duplicated code in the util.c files in the libalpm and
pacman source code.  Split this into a separate file so that it
can be shared via a symlink. This prevents code divergence between
the two code bases.
util-common: Merge mbasename and mdirname

Move mbasename and mdirname from pacman/util.c into util-common.c
in preparation for the following patch that uses them to add an
extension to pacsave files.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>

Use util-common.c rather than duplicating functions in pacman and
libalpm. Adapted original commit message/subject.
Signed-off-by: Florian Pritz <bluewind@xinu.at>