### this file is sourced not run
PKGVER=1.1.6
PKGBUILD=1
PKGARCH=i686

# source: BLFS 7.5 & 8.2 & 11.3
TARBALL=libunique-$PKGVER.tar.bz2
MD5SUM=7955769ef31f1bc4f83446dbb3625e6d 
SRC_URL=http://ftp.gnome.org/pub/gnome/sources/libunique/1.1/$TARBALL
BUNDLE=

SLACKREQ=gtk2_32
SLACKDESC="libunique32: libunique32 $PKGVER (Single-instance library)  
libunique32:  
libunique32: The libunique package contains a library for writing single 
libunique32: instance applications.  
libunique32: 
libunique32: This contains 32-bit version of the library.
libunique32: 
libunique32: 
libunique32: 
libunique32: 
libunique32:
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/libunique* &&
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/libunique-1.1.6-upstream_fixes-1.patch
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share &&
	mkdir -p usr/share &&
	if [ -d tmp/gir-*-32 ]; then 
		mv tmp/gir-*-32 usr/share
	fi
}

### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-dbus --disable-static"
	cd /tmp/libunique*
	autoreconf -fi &&
	pkg_build_autoconf && pkg_build_slackdesc &&

	# multilib	
	if [ -d /usr/share/gir-1.0-32 ]; then # if we build with introspection
		mv -v /usr/share/gir-1.0/* /usr/share/gir-1.0-32 &&
		rm -r /usr/share/gir-1.0/
	fi
}
