# Tanım: Linux için bluetooth istemci ve kütüphaneleri.
# URL: http://www.bluez.org/
# Paketçi: milisarge
# Gerekler: libical libvorbis alsa-lib libusb-compat libsndfile cups glib
# Grup: kütüphane

isim=bluez
surum=5.47
devir=3
kaynak=(http://www.kernel.org/pub/linux/bluetooth/$isim-$surum.tar.xz
        http://www.linuxfromscratch.org/patches/blfs/svn/bluez-$surum-obexd_without_systemd-1.patch
        bluetooth.modprobe)

derle() {
	cd $isim-$surum
	patch -Np1 -i ../$isim-$surum-obexd_without_systemd-1.patch
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--libexecdir=/usr/lib \
		--disable-systemd \
		--enable-gstreamer \
		--enable-alsa \
		--enable-usb \
		--enable-tools \
		--enable-bccmd \
		--enable-dfutool \
		--enable-hid2hci \
		--enable-hidd \
		--enable-pand \
		--enable-dund \
		--enable-cups \
		--disable-test \
		--enable-sixaxis \
		--enable-experimental \
		--enable-library \
		--without-systemdunitdir
	make
	make DESTDIR=${PKG} \
       install-libexecPROGRAMS \
       install-dbussessionbusDATA \
       install-dbussystembusDATA \
       install-dbusDATA 
	
	make DESTDIR=${PKG} install-binPROGRAMS
	
	make DESTDIR=${PKG} install-cupsPROGRAMS
	
	 make DESTDIR=${PKG} \
       install-udevPROGRAMS \
       install-rulesDATA
       
    make DESTDIR=${PKG} \
       install-pluginLTLIBRARIES
	install -dm755 ${PKG}/etc/bluetooth
	install -Dm644 ${SRC}/${isim}-${surum}/src/main.conf ${PKG}/etc/bluetooth/main.conf
	install -dm755 ${PKG}/etc/modprobe.d
	install -Dm644 ${SRC}/bluetooth.modprobe ${PKG}/etc/modprobe.d/bluetooth-usb.conf
	
	for files in `find tools/ -type f -perm -755`; do
		filename=$(basename $files)
		install -Dm755 ${SRC}/${isim}-${surum}/tools/$filename ${PKG}/usr/bin/$filename
	done
    mkdir -p "$PKG/usr/sbin"
    ln -sf /usr/lib/bluetooth/bluetoothd "$PKG/usr/sbin/bluetoothd"
    ln -sf /usr/lib/bluetooth/obexd "$PKG/usr/sbin/obexd"
	rm -rf ${PKG}/lib/udev/hid2hci
	cd /sources/milis.git/ayarlar/servisler
	make DESTDIR=$PKG kur-bluetooth    
}