Setting up kdebluetooth on Fedora Core 5

Author Charles-Edouard Ruault, 04/28/2006 V1.2

Here's my receipt to compile & install kdebluetooth from scratch on Fedora Core 5.
I don't know why but this set of utilities are not shipped with kde on FC5.

If you have any questions or comments, feel free to email me: ce at ruault dot com

The first thing to do is to decide which installation method you want.
There are two options:

  1. Install prebuild rpms
  2. Fetch the sources and compile everything yourself
Then you need to decide which pin helper utility you want to use and install the corresponding selinux policy module

1) Installing using prebuild rpms

Pre-build rpms are available ( for i386 only ) here.
Just download the latest build of kdebluetooth-xxx.fc5.i386.rpm and issue (as root) the usual rpm -i package.rpm command. Once this is done, you can jump to the pin helper configuration section.

Note: I have nothing to do with these packages, and i have not tested them ( i've used the doit yourself method #2 ), so please direct your questions to the packager.

2) Installing using sources

This has been tested on i386 and ppc architectures.

You need to ensure that you have the following packages installed:
  • openobex
  • openobex-apps
  • openobex-devel
  • bluez-libs
  • bluez-libs-devel
  • bluez-pin
  • bluez-utils
Then you need this little trick ( i know it's dirty but i did not feel like doing the full blown solution, if anyone want to contribute, feel free to do so ! ):
Install openobex-config into /usr/bin, and make it executable ( chmod +x /usr/bin/openobex-config ).
Then you can checkout the latest kdebluetooth from the kde svn server:

svn co svn://

Once this is done you need to download and apply the following patch. See description of the problem it fixes here.

cd pim/kdebluetooth
patch -p0 < /location_where_you_saved_the_patch/kdebluetooth.patch

Then you can configure , compile & install:

cd ..
make -f Makefile.cvs
./configure --with-gnu-ld --enable-irmcsynckonnector
cd kdebluetooth
(as root) make install

Hopefully, everything will go smoothly and after a while you'll have everyhthing ready the last step !

3) Setup the pin helper

The pin helper is the application that will prompt you when you are about to pair with a new device. You have two options, either use the default bluez-pin application or use the one provided by the kdebluetooth package you've just installed.

If you're using kbluepin, then you need to change it's security context. Run the following command:
chcon system_u:object_r:bluetooth_helper_exec_t /usr/lib/kdebluetooth/kbluepin
To make this change persistant over relabelings, run this command:
semanage fcontext -a -f -- -s system_u -t bluetooth_helper_exec_t /usr/lib/kdebluetooth/kbluepin

In any case you need to edit the following file /etc/bluetooth/hcid.conf, locate the line dbus_pin_helper and add a # in front of it ( i.e comment it out ).
Then you can

  1. uncomment ( remove the leading # ) the line with #pin_helper /usr/bin/bluez-pin; to use the bluez-pin helper
  2. add the following line pin_helper /usr/lib/kdebluetooth/kbluepin; (after the # PIN helper comment) to use the kdebluetooth pin helper.
Save the file and restart the bluetooth services: /etc/init.d/bluetooth restart.
Start the kbluetooth daemon :kbluetoothd.

4) Configure selinux You need to download and install one of the following policy modules, depending on the pin helper you're going to use:

Save the policy module file (policyname.pp) and then as root, load it using the following command:semodule -i policyname.pp

If you want to recompile the policy yourself ( you need to have installed the packages policycoreutils and checkpolicy ), grab the source ( link above ) and compile it using the following commands:
checkmodule -M -m -o policyname.mod policyname.te
semodule_package -o policyname.pp -m policyname.mod

and load it with: semodule -i policyname.pp

You should now be able to browse and see other bluetooth devices and to pair with them. You'll still see a few avc denied messages in the logs but as far as i know they're not causing any trouble....