|
|
25431e |
#!/bin/sh
|
|
|
25431e |
|
|
|
b3423c |
|
|
|
b3423c |
# this file is covered by COPYING.SOFORT.
|
|
|
b3423c |
|
|
|
ac70fd |
set -eu
|
|
|
ac70fd |
|
|
|
25431e |
# prefix, exec_prefix
|
|
|
25431e |
if [ "$PKGCONF_PREFIX" = "$PKGCONF_EXEC_PREFIX" ]; then
|
|
|
9afe04 |
pkgconf_prefix="${PKGCONF_PREFIX}"
|
|
|
9afe04 |
pkgconf_exec_prefix='${prefix}'
|
|
|
25431e |
else
|
|
|
9afe04 |
pkgconf_prefix="${PKGCONF_PREFIX}"
|
|
|
9afe04 |
pkgconf_exec_prefix="${PKGCONF_EXEC_PREFIX}"
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
25431e |
|
|
|
25431e |
# (relative) includedir
|
|
|
9afe04 |
if [ -z "$PKGCONF_INCLUDEDIR" ]; then
|
|
|
9afe04 |
pkgconf_includedir=
|
|
|
9afe04 |
pkgconf_cflags=
|
|
|
25431e |
else
|
|
|
9afe04 |
prefix=$(dirname "$PKGCONF_INCLUDEDIR")
|
|
|
9afe04 |
base=$(basename "$PKGCONF_INCLUDEDIR")
|
|
|
9afe04 |
|
|
|
7e95c5 |
if [ "$prefix" = '/' ]; then
|
|
|
7e95c5 |
prefix=
|
|
|
7e95c5 |
fi
|
|
|
7e95c5 |
|
|
|
9afe04 |
if [ "$prefix/$base" = "$PKGCONF_PREFIX/$base" ]; then
|
|
|
9afe04 |
pkgconf_includedir='${prefix}/'"${base}"
|
|
|
9afe04 |
pkgconf_cflags='-I${includedir}'
|
|
|
9afe04 |
else
|
|
|
9afe04 |
pkgconf_includedir="${PKGCONF_INCLUDEDIR}"
|
|
|
9afe04 |
pkgconf_cflags='-I${includedir}'
|
|
|
9afe04 |
fi
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
25431e |
|
|
|
9afe04 |
# (relative) libdir (blank unless needed)
|
|
|
9afe04 |
if [ -z "$PKGCONF_LIBDIR" ]; then
|
|
|
9afe04 |
pkgconf_libdir=
|
|
|
25431e |
else
|
|
|
9afe04 |
prefix=$(dirname "$PKGCONF_LIBDIR")
|
|
|
9afe04 |
base=$(basename "$PKGCONF_LIBDIR")
|
|
|
9afe04 |
|
|
|
7e95c5 |
if [ "$prefix" = '/' ]; then
|
|
|
7e95c5 |
prefix=
|
|
|
7e95c5 |
fi
|
|
|
7e95c5 |
|
|
|
9afe04 |
if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/$base" ]; then
|
|
|
9afe04 |
pkgconf_libdir='${exec_prefix}/'"${base}"
|
|
|
9afe04 |
else
|
|
|
9afe04 |
pkgconf_libdir='${prefix}/'"${PKGCONF_LIBDIR}"
|
|
|
9afe04 |
fi
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
9afe04 |
|
|
|
9afe04 |
# ldflags (--libs)
|
|
|
9afe04 |
if [ -n "$pkgconf_libdir" ] && [ -n "${PKGCONF_NAME}" ]; then
|
|
|
964b9c |
pkgconf_ldflags='-L${libdir}'" -l${PKGCONF_NAME}"
|
|
|
9afe04 |
elif [ -n "${PKGCONF_NAME}" ]; then
|
|
|
9afe04 |
pkgconf_ldflags="-l${PKGCONF_NAME}"
|
|
|
25431e |
else
|
|
|
964b9c |
pkgconf_ldflags='-L${libdir}'
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
25431e |
|
|
|
9afe04 |
# cflags
|
|
|
9afe04 |
if [ -n "$pkgconf_cflags" ] || [ -n "${PKGCONF_DEFS}" ]; then
|
|
|
664c54 |
pkgconf_cflags="$pkgconf_cflags ${PKGCONF_DEFS}"
|
|
|
9afe04 |
pkgconf_cflags=$(printf '%s' "$pkgconf_cflags" | sed -e 's/^[ \t]*//g')
|
|
|
9afe04 |
fi
|
|
|
25431e |
|
|
|
25431e |
|
|
|
25431e |
# repo (optional)
|
|
|
9afe04 |
if [ -z "${PKGCONF_REPO}" ]; then
|
|
|
9afe04 |
pkgconf_repo='#'
|
|
|
9afe04 |
else
|
|
|
9afe04 |
pkgconf_repo="Repo: ${PKGCONF_REPO}"
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
25431e |
# patches (optional)
|
|
|
9afe04 |
if [ -z "${PKGCONF_PSRC}" ]; then
|
|
|
9afe04 |
pkgconf_psrc='#'
|
|
|
9afe04 |
else
|
|
|
9afe04 |
pkgconf_psrc="Patches: ${PKGCONF_PSRC}"
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
9afe04 |
# distro (optional)
|
|
|
9afe04 |
if [ -z "${PKGCONF_DURL}" ]; then
|
|
|
9afe04 |
pkgconf_durl='#'
|
|
|
25431e |
else
|
|
|
9afe04 |
pkgconf_durl="Distro: ${PKGCONF_DURL}"
|
|
|
25431e |
fi
|
|
|
25431e |
|
|
|
027b66 |
# bug reports (optional)
|
|
|
027b66 |
if [ -z "${PKGCONF_BUGS}" ]; then
|
|
|
027b66 |
pkgconf_bugs='#'
|
|
|
027b66 |
else
|
|
|
027b66 |
pkgconf_bugs="Bug reports: ${PKGCONF_BUGS}"
|
|
|
027b66 |
fi
|
|
|
027b66 |
|
|
|
027b66 |
# project home page (optional)
|
|
|
027b66 |
if [ -z "${PKGCONF_HOME}" ]; then
|
|
|
027b66 |
pkgconf_home='#'
|
|
|
027b66 |
else
|
|
|
027b66 |
pkgconf_home="Home page: ${PKGCONF_HOME}"
|
|
|
027b66 |
fi
|
|
|
027b66 |
|
|
|
25431e |
|
|
|
9afe04 |
# output (without trailing spaces)
|
|
|
9afe04 |
cat << _EOF | grep -v '^#' | sed 's/[ \t]*$//'
|
|
|
9afe04 |
#
|
|
|
9afe04 |
prefix=$pkgconf_prefix
|
|
|
9afe04 |
exec_prefix=$pkgconf_exec_prefix
|
|
|
9afe04 |
includedir=$pkgconf_includedir
|
|
|
9afe04 |
libdir=$pkgconf_libdir
|
|
|
9afe04 |
|
|
|
9afe04 |
Name: ${PKGCONF_NAME}
|
|
|
9afe04 |
Description: ${PKGCONF_DESC}
|
|
|
9afe04 |
URL: ${PKGCONF_USRC}
|
|
|
9afe04 |
Version: ${PKGCONF_VERSION}
|
|
|
9afe04 |
$pkgconf_repo
|
|
|
9afe04 |
$pkgconf_psrc
|
|
|
9afe04 |
$pkgconf_durl
|
|
|
027b66 |
$pkgconf_bugs
|
|
|
027b66 |
$pkgconf_home
|
|
|
9afe04 |
|
|
|
9afe04 |
Cflags: $pkgconf_cflags
|
|
|
9afe04 |
Libs: $pkgconf_ldflags
|
|
|
9afe04 |
#
|
|
|
9afe04 |
_EOF
|
|
|
9afe04 |
|
|
|
9afe04 |
# all done
|
|
|
9afe04 |
exit 0
|