LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-04-2014, 01:14 PM   #1
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Slackware64 14.1: bluez package missing gatttool due to readline test failing


This is an extension of something bartgymnast reported back in October.

I'm attempting to do some work with Bluetooth LE, which (as far as I can tell) requires me to use gatttool to communicate with the LE device. I noticed that the bluez package doesn't have that tool, even though the source is available in bluez 4.99.

The bluez source uses the AC_PATH_READLINE autoconf macro to test for the readline library. That's a macro the bluez team added to the source tarball (acinclude.m4).

If that test is fixed to include the ncurses library (and, sadly, the automake/autoconf files regenerated), the missing gatttool binary is built. You can also add LIBS=" -lncurses " to the .configure and make command lines in the slackbuild, which doesn't require running autoreconf.

I'd prefer to attach these as files, but oh well:

Code:
#!/bin/sh

# Slackware build script for bluez - http://www.bluez.org

# Copyright 2009, 2010, 2011, 2012, 2013  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PKGNAM=bluez
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-3}

NUMJOBS=${NUMJOBS:-" -j7 "}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/${PKGNAM}-${VERSION}.tar.xz || exit 1
cd $PKGNAM-$VERSION

chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

# Start bluetoothd via a wrapper script to check rc.bluetooth's +/-x first
zcat $CWD/bluez-run_udev_helper.patch.gz | patch -p1 --verbose || exit 1

# Enable the audio socket in audio.conf:
zcat $CWD/bluez.enable.audio.socket.diff.gz | patch -p1 --verbose || exit 1

# Fix the readline test to also link against ncurses
zcat $CWD/bluez_readline_test_fix.patch.gz | patch -p0 --verbose || exit 1
# ...and you'll have to run autoreconf to really build the test.
autoreconf --verbose --install

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --localstatedir=/var \
  --enable-datafiles \
  --enable-audio \
  --enable-gstreamer \
  --enable-alsa \
  --enable-usb \
  --enable-tools\
  --enable-input \
  --enable-bccmd \
  --enable-hid2hci \
  --enable-dfutool \
  --enable-hidd \
  --enable-pand \
  --enable-dund \
  --enable-cups \
  --enable-service \
  --enable-network \
  --enable-serial \
  --enable-health \
  --enable-pnat \
  --enable-maemo6 \
  --enable-wiimote \
  --enable-test \
  --enable-dbusoob \
  --with-ouifile=/usr/share/hwdata/oui.txt \
  --disable-silent-rules \
  --build=$ARCH-slackware-linux 

make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1

cp scripts/bluetooth-serial.rules $PKG/lib/udev/rules.d/97-bluetooth-serial.rules || exit 1
cp -a scripts/bluetooth_serial $PKG/lib/udev/bluetooth_serial || exit 1
chmod 0755 $PKG/lib/udev/bluetooth_serial

mkdir -p $PKG/etc/bluetooth
cp -a audio/audio.conf $PKG/etc/bluetooth
cp -a input/input.conf $PKG/etc/bluetooth
cp -a network/network.conf $PKG/etc/bluetooth
cp -a serial/serial.conf $PKG/etc/bluetooth
chmod 644 $PKG/etc/bluetooth/*.conf

mkdir -p $PKG/etc/alsa
mv $PKG/usr/share/alsa/bluetooth.conf $PKG/etc/alsa
( cd $PKG/usr/share/alsa ; ln -s ../../../etc/alsa/bluetooth.conf . )

# Do not overwrite configuration
# Well, let the dbus file be overwritten, as it is not usually user-edited.
( cd $PKG
  for file in \
    etc/alsa/bluetooth.conf \
    etc/bluetooth/audio.conf \
    etc/bluetooth/input.conf \
    etc/bluetooth/network.conf \
    etc/bluetooth/serial.conf \
    etc/bluetooth/rfcomm.conf \
    etc/bluetooth/main.conf \
    etc/modprobe.d/bluetooth.conf ; do 
      mv ${file} ${file}.new
  done
)

# Add the wrapper script
cat $CWD/config/bluetooth.sh > $PKG/lib/udev/bluetooth.sh
chmod 0755 $PKG/lib/udev/bluetooth.sh

# Add an init script
mkdir -p $PKG/etc/rc.d
cat $CWD/config/rc.bluetooth > $PKG/etc/rc.d/rc.bluetooth.new

# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
  ( cd $PKG/usr/man
    for manpagedir in $(find . -type d -name "man*") ; do
      ( cd $manpagedir
        for eachpage in $( find . -type l -maxdepth 1) ; do
          ln -s $( readlink $eachpage ).gz $eachpage.gz
          rm $eachpage
        done
        gzip -9 *.?
      )
    done
  )
fi

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
  AUTHORS COPYING* INSTALL NEWS README* \
  $PKG/usr/doc/$PKGNAM-$VERSION

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
  touch -r ChangeLog $DOCSDIR/ChangeLog
fi

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Here's bluez_readline_test_fix.patch (which you'll have to gzip yourself or change the Slackbuild):
Code:
--- acinclude.m4	2012-03-05 03:03:57.000000000 -0600
+++ acinclude.m4.new	2014-07-04 12:52:01.487364332 -0500
@@ -162,8 +162,8 @@
 	AC_CHECK_HEADER(readline/readline.h,
 		AC_CHECK_LIB(readline, main,
 			[ readline_found=yes
-			AC_SUBST(READLINE_LIBS, "-lreadline")
-			], readline_found=no),
+			AC_SUBST(READLINE_LIBS, "-lreadline -lncurses")
+			], readline_found=no,"-lncurses"),
 		[])
 ])
I had toyed with updating to bluez-5.20, but they are on the systemd bandwagon. You can compile it with "--disable-systemd", but you'd have to manage the udev rules yourself. And you still have to fix the readline test.
 
Old 07-04-2014, 02:15 PM   #2
linuxtinker
Member
 
Registered: Dec 2013
Location: NJ / USA
Distribution: Slackware 64 -Current
Posts: 232

Rep: Reputation: 99
Not sure but this might help you with getting bluez-5.20 without systemd working :http://www.linuxfromscratch.org/blfs...ral/bluez.html
 
Old 07-04-2014, 10:07 PM   #3
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
That patch works, but as Richard said there are still some ongoing issues but the good part is it works for now.

Although a test program can often fail for any number of reasons including the test program not being maintained properly, so your guess is as good as mine.

Last edited by ReaperX7; 07-04-2014 at 10:09 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Missing package in Slackware64? kikinovak Slackware 2 02-02-2013 02:40 AM
failing to build Empathy due to missing glib-compile-schemas bullet_ Fedora 3 11-04-2010 02:43 AM
[SOLVED] bluez.Slackbuild fix for Slackware64-13.0 drumz Slackware 5 05-04-2010 11:30 PM
Unable to read package metadata. This may be due to missing repodata directory tebeber Fedora - Installation 0 10-29-2009 08:13 PM
[SOLVED] Slackware64 13 and BlueZ woes part 2 ... maybe issues with main.conf btncix Slackware 2 10-23-2009 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration