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

TARBALL=eudev-$PKGVER.tar.gz
MD5SUM=80649a0350ff9620fc2da9562d9f2a6a
BUNDLE=fatdog-base-8.2.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$BUNDLE

SLACKREQ=kmod32
SLACKDESC="eudev32: eudev32 $PKGVER (Device management)
eudev32: 
eudev32: The Eudev package contains programs for dynamic creation of device 
eudev32: nodes.
eudev32: 
eudev32: This package contains 32-bit version of the libraries.
eudev32: 
eudev32: 
eudev32: 
eudev32: 
eudev32: 
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/eudev* &&
	patch -Np1 -i ../pkg/eudev-1.7-gcc7-glib2.25.patch
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share etc lib/udev lib64/udev
}

### build
pkg_build() {
	cd /tmp/eudev*
	
	sed -i -e 's|udevlibexecdir=${rootprefix}/lib/udev|udevlibexecdir=${rootprefix}/lib64/udev|' configure	&&
	PKG_CONFIG_PATH=${PKG_CONFIG_PATH32} \
	CC="gcc ${BUILD32}" ./configure --prefix=/usr --sysconfdir=/etc \
		--with-rootprefix="" --libexecdir=/lib --enable-split-usr \
		--libdir=/usr/lib --with-rootlibdir=/lib --sbindir=/sbin --bindir=/sbin \
		--enable-rule_generator --disable-introspection --disable-keymap \
		--disable-gudev --disable-gtk-doc-html --enable-libkmod &&
	
	make $MAKEFLAGS && make install &&
	pkg_build_slackdesc
}


