#!/bin/bash
#
# Copyright 2004,2007,2008 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Copyright 2005, 2006, 2007 Scott Harmon
# Available under the terms of the GNU GPL 2.0
#

NAME="glib2"
VERSION="2.34.0"
REVISION="2"

PKG_SOURCEURL='ftp://ftp.gnome.org/mirror/gnome.org/sources/glib/$VER_MAJ.$VER_MIN/glib-$VERSION.tar.xz'
PKG_SANIFYNOTOUCH="oh yes"

PKG_PATCH[0]='libglib2.sh'
PKG_PATCH[1]='libglib2.csh'
# One test fails and I have no clue why. I tried to compile glib in another distribution and
# get the same error. It isn't a "slackware issue". Let's skip this one test. --Eugene Wissner
PKG_PATCH[2]='glib-2.32-skip-thread4-test.patch'

. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

PKG_DOCDIR="$DLG_DOCDIR/glib-$VERSION"

cflags
cxxflags
prepare

applypatch 2 1

analyzesource
configure
make
makecheck
makeinstall install-strip

createdir $PKG_STAGEROOT$PKG_SYSCONFDIR/profile.d
findpatch filename ${PKG_PATCH[0]}
spewdo "install -m 755 -o root -g root $filename $PKG_STAGEROOT$PKG_SYSCONFDIR/profile.d/libglib2.sh"
configfile $PKG_SYSCONFDIR/profile.d/libglib2.sh
findpatch filename ${PKG_PATCH[1]}
spewdo "install -m 755 -o root -g root $filename $PKG_STAGEROOT$PKG_SYSCONFDIR/profile.d/libglib2.csh"
configfile $PKG_SYSCONFDIR/profile.d/libglib2.csh
# Set executable bit for /etc/bash_completion.d/*
spewdo "chmod 755 $PKG_STAGEROOT$PKG_SYSCONFDIR/bash_completion.d/*"

tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
