--- mkpkgconfig 11 Nov 2004 14:48:53 -0000 1.1 +++ mkpkgconfig 11 Nov 2004 21:25:19 -0000 @@ -1,5 +1,7 @@ #!/bin/bash +## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags) + ## Make sure we were called from Makefile if [ "x$ASTERISKVERSIONNUM" == "x" ]; then @@ -7,12 +9,19 @@ exit fi -## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags) +## check we actually have pkg-config installed -if [ ! -d /usr/lib/pkgconfig ]; then +if ! pkg-config --version > /dev/null 2>&1; then + echo "Can't locate pkg-config - skipping asterisk.pc installation" exit fi +if [ "x${PKG_CONFIG_PATH}" == "x" ]; then + PKG_CONFIG_PATH="$DESTDIR/usr/lib/pkgconfig" +fi + +mkdir -p $PKG_CONFIG_PATH + ## Clean out CFLAGS for the spec file. LOCAL_CFLAGS=$(echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \ @@ -22,7 +31,7 @@ sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g' ) -cat < /usr/lib/pkgconfig/asterisk.pc +cat < $PKG_CONFIG_PATH/asterisk.pc install_prefix=$INSTALL_PREFIX version_number=$ASTERISKVERSIONNUM etcdir=$ASTETCDIR