Blueman is the default bluetooth manager in binaries are available for Ubuntu, which seems to have an impressive list of features. The runtime dependencies and build dependencies (Requires and BuildRequires in RPM terminology) are listed in the download page, which makes writing a proper SPEC file much easier. I decided to build RPM for blueman locally and try it out.
Unfortunately, the BuildRequires listed in the blueman page are not exhaustive, and I had to do a lot of manual dependency resolving before I finally manage to get them all right. I was able to build it in one of the test machines (fully updated F10 system), but that machine didn’t have bluetooth hardware to test it.
So I copied to SPEC file to another (fully updated F10, only difference is it uses DeltaRPMs to update regularly). That is where to trouble starts. RPMBUILD mysteriously fails with error on ‘pygtk’ requirement – see the build log:
checking for pyrexc... /usr/bin/pyrexc
checking for pyrexc executable... /usr/bin/pyrexc
checking for python module gtk... yes
checking if pygtk is >= 2.12... no
configure: error: pygtk must be version 2.12 or higher
error: Bad exit status from /var/tmp/rpm-tmp.BO3Mzo (%build)
But I do have pygtk2-2.13! So I decided to check if blueman builds locally - unzipped the tar ball, and did a ./configure (with all the parameters that RPMBUILD passes to it), which succeeds the 'pygtk is >= 2.12' check and builds perfectly ! WTH??
I've been sitting on the issue for couple of days, and this morning I gave it a closer look. The only difference between local build and RPMBUILD is that, RPMBUILD sets the environment variables LANG, CFLAGS, CXXFLAGS, FFLAGS; unsets DISPLAY and exports them all.
So, I set/unset and exported all the env variables accordingly on the local build also, and doh - the "./configure" fails with the same 'pygtk2' error! To narrow down the issue, I eliminated the env vars one by one, and managed to zero in on "unset DISPLAY".
If I don't unset DISPLAY, blueman builds perfectly. Any idea what's going on?
OK, I confirmed that un-setting DISPLAY is the culprit. The configure script checks for pygtk version as follows:
python -c '
import gtk, sys
(maj, mid, min) = gtk.pygtk_version
if maj != 2 or mid < 12:
On un-setting the DISPLAY, it generates the following dump:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/usr/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 79, in <module>
File "/usr/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 67, in _init
RuntimeError: could not open display
But why the heck doesn't it show up in my other test box?
The other test box doesn't do either "LANG=C; export LANG" or "unset DISPLAY" ! And that is why it is not failing. Once I do a local './configure' with DISPLAY unset, it fails there as well.
What puzzles me is that both machines have the same RPM/RPMBUILD version - 4.6.0-1.
There is an upstream bug for this at https://bugs.edge.launchpad.net/blueman/+bug/337877, which is fixed now. The proper way to check pygtk dependency is to use pkg-config. I've adapted another hack directly to the configure script, now Blueman is built on my system and happily using it. A big boquet of thanks to Nushio !