#!/bin/sh
#
# Copyright 2005, 2006 Scott Harmon
# Available under the terms of the GNU GPL.
#

NAME="libunique"
VERSION="1.1.2"
REVISION="1"

PKG_SOURCEURL='http://download.gnome.org/sources/$NAME/$VER_MAJ.$VER_MIN/$NAME-$VERSION.tar.gz'

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

cflags
cxxflags
prepare
analyzesource
if [ "$DLG_ARCH" == "x86-64" ]; then
	export LIB_DIR="/usr/lib64"
else
	export LIB_DIR="/usr/lib"
fi

configure --with-x --enable-introspection --enable-gtk-doc

# For some reason this package requires the pkgconfig file unique-1.0.pc to
# build properly, and that .pc file is provided by the package itself. Setting
# the PKG_CONFIG_PATH variable through DBS is doing no good, so unfortunately
# we might have to polute the file system a little in case that file isn't
# already there.

if [ ! -e $LIB_DIR/pkgconfig/unique-1.0.pc ]
then
	make "unique-1.0.pc"
	spewdo "cp $PKG_WORKROOT/$NAME-$VERSION/unique-1.0.pc $LIB_DIR/pkgconfig/"
	COPIED_UNIQUE_PKGCONFIG="true"
fi

make

# Let's try to make sure things a LITTLE cleaner. This "cleaning" won't work
# if the build process was interrupted though.
if [ "$COPIED_UNIQUE_PKGCONFIG" != "" ]
then
	rm $LIB_DIR/pkgconfig/unique-1.0.pc
fi

makeinstall install-strip
tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
