Ben Laurie blathering

More on Cardspace and Passport, or, A Day in the Life of an Open Source Developer

Dale Olds is surprised. It seems mean to leave him in this state, though it seems somewhat ironic that an open source project should be choosing a thoroughly closed phone as a prize. So closed you can’t even install closed source add-ons. I’d rather have an N95, to be honest.

So, the first thing I should say is that I used the word “consumer” rather ill-advisedly. I blame OAuth, which I have been working on recently – it uses “consumer” for one of the roles in the protocol, so the word is on my mind. What I should have said was that there are few relying parties for OpenID of any significance (at least that are prepared to rely on anyone but themselves).

But OK, that aside, let’s see if I can win this phone! First off, Dale says I should read a press release. Yep, OK, Novell want us to be more aware of information cards. They also want us to know that we can do the whole thing with open source. This is, of course, fantastic. So, let’s have at it.

First off, I’m sent to the “Bandit Cards” home page. Apparently I can win an iPhone by merely getting hold of a Bandit Card – I’ll be entered into a draw. Hmm, shame, means I’m relying on luck and not my ‘4337 h4×0r sk1llz. OK, so I follow the link to create an account.

Bandit Create Account Page

OK, so let’s download one of those things.

Bandit Download Page

Hmm. No FreeBSD there, but that’s OK, this is open source. Surely I can build it. After a bit of poking around, I find a download page, from which I can retrieve a source RPM. Now, FreeBSD doesn’t understand RPMs out of the box, but it seems there’s a converter, so one quick portinstall rpm2cpio and a little bit of futzing later and I should be good to go…

[ben@euphrates ~/software/unpacked/digitalme-0.3.846]
$ ./configure
cmake: not found

Not come across cmake before, but FreeBSD’s ports system is at hand, as usual, and happily installs it for me. There, sadly, the fun appears to end:

-- Release DigitalMe build.
CMake Error: Command "/usr/local/bin/svn info /home/ben/software/unpacked/digitalme-0.3.846" failed with output:
svn: '/home/ben/software/unpacked/digitalme-0.3.846' is not a working copy

Well, quite so, it is not a working copy, because it is an RPM! However, a bit of poking suggests that this error is not as fatal as it seems – though a later error is

-- Could not find GLib
-- Gnome Keyring not found.
CMake Error: Unable to find a secret store provider.
-- Configuring done

Is it just me, or is this rather misleading? The configuration appears to have failed, since there are no Makefiles, but it completes as if all was well. In any case, this is beginning to get a bit painful, but once more, after a bit of futzing (in CMakeModules/FindGLib.cmake and CMakeModules/FindGnomeKeyring.cmake) I manage to get it to find Glib and Gnome Keyring and we move on to the next problem

-- Looking for GTK2 ...
-- Unable to find GTK2_gdk_CONFIG_INCLUDE_DIR
CMake Error: Could not find GTK2
-- Configuring done

I’m beginning to get the hang of this – dealt with in seconds. And finally the ./configure completes without error. But still no Makefiles. Yet more poking suggests that I really should be running

./configure --debug-output

if I really want to know what’s going on. And what’s going on is this:

The end of a CMakeLists file was reached with an IF statement that was not closed properly.
Within the directory: /home/ben/software/unpacked/digitalme-0.3.846
The arguments are: NOT ${Subversion_svn_info_result} EQUAL 0
-- Configuring done

Nice. An error you only find out about if debugging is on. OK, so this exhausts my cmake-fu. Can’t figure out how to fix this one. But I am not daunted – I do what every open source developer would do – go to the bleeding edge

svn co

The code I’ve been playing with lives in the iss subdirectory. And yes! After some editing of the cmake configuration, this actually generates Makefiles! Yes! (Once I’ve sorted out the usual irritation of svn checking out into a directory called “trunk”, that is). Not that it builds – I get a ton of errors on a make. Turns out there’s a header with platform info in, and FreeBSD is not configured – although I hate the GNU configure system, this kind of stuff makes me appreciate it! More hackery and I have some kind of configuration set up for FreeBSD. Then its just a matter of build, fix, build, rinse, wash, repeat until the compile completes. Which it does, eventually.

So I am now the proud possessor of a binary called digitalme. Now what, I wonder? I guess that’s tomorrow’s job, because now I have to cook.

For the truly geeky, here’s the diff:

Index: ftk/include/ftk.h
--- ftk/include/ftk.h (revision 960)
+++ ftk/include/ftk.h (working copy)
@@ -41,6 +41,7 @@
#undef FTK_SPARC
#undef FTK_X86
+ #undef FTK_FREEBSD
#undef FTK_GNUC
@@ -134,6 +135,11 @@
#error Platform architecture not supported
+ #elif defined(__FreeBSD__)
+ #define FTK_FREEBSD
+ #define FTK_UNIX
+ #define FTK_OSTYPE_STR "FreeBSD"
+ #define FTK_X86
#elif defined( sun)
#define FTK_OSTYPE_STR "Solaris"
@@ -410,7 +416,9 @@
#elif defined( FTK_UNIX)
#if defined( FTK_GNUC)
#define FTKAPI
- #define FTKEXP __attribute__ ((visibility("default")))
+// BEN: this causes a million warnings, so removing pending clearer understanding
+// #define FTKEXP __attribute__ ((visibility("default")))
+ #define FTKEXP
#define FTKAPI
#define FTKEXP
Index: ftk/src/ftkunix.cpp
--- ftk/src/ftkunix.cpp (revision 960)
+++ ftk/src/ftkunix.cpp (working copy)
@@ -428,6 +428,13 @@
return( f_mapPlatformError( errno, NE_FTK_FLUSHING_FILE));
+#elif defined(FTK_FREEBSD)
+ if( fsync( m_fd) != 0)
+ {
+ return( f_mapPlatformError( errno, NE_FTK_FLUSHING_FILE));
+ }


Index: ftk/src/ftkxpath.cpp
--- ftk/src/ftkxpath.cpp (revision 960)
+++ ftk/src/ftkxpath.cpp (working copy)
@@ -1889,7 +1889,7 @@

-#if defined ( FTK_LINUX) || defined ( FTK_NLM) || defined( FTK_OSX)
+#if defined ( FTK_LINUX) || defined ( FTK_NLM) || defined( FTK_OSX) || defined ( FTK_FREEBSD)
if( ui64Num > ((0xFFFFFFFFFFFFFFFFULL / 10) + (uChar - FTK_UNICODE_0)))
if( ui64Num > ((0xFFFFFFFFFFFFFFFF / 10) + (uChar - FTK_UNICODE_0)))
Index: CMakeModules/FindOpenSSL.cmake
--- CMakeModules/FindOpenSSL.cmake (revision 960)
+++ CMakeModules/FindOpenSSL.cmake (working copy)
@@ -23,19 +23,27 @@

# Locate OpenSSL files

+# BEN: Kludge in local version of 0.9.8 - FreeBSD uses 0.9.7, which
+# doesn't actually work - so this file should not check for 0.9.7.
+# Surely there's some way to do this without hacking this file?

find_path( OPENSSL_INCLUDE_DIR ssl.h
- PATHS /usr/include
+ PATHS /home/ben/work/openssl-0.9.8/include
+ /usr/include
+# remove the trailing "openssl" (this is not a kludge, it is needed)

find_library( SSL_LIBRARY
NAMES ssl.0.9.8 ssl.0.9.7 ssl
- PATHS /usr/lib
+ PATHS /home/ben/work/openssl-0.9.8
+ /usr/lib
@@ -43,7 +51,8 @@

find_library( CRYPTO_LIBRARY
NAMES crypto.0.9.8 crypto.0.9.7 crypto
- PATHS /usr/lib
+ PATHS /home/ben/work/openssl-0.9.8
+ /usr/lib
Index: CMakeModules/FindGTK2.cmake
--- CMakeModules/FindGTK2.cmake (revision 960)
+++ CMakeModules/FindGTK2.cmake (working copy)
@@ -71,6 +71,7 @@
PATH_SUFFIXES gtk-2.0/include
+ gtk-2.0
mark_as_advanced( GTK2_gdk_CONFIG_INCLUDE_DIR)
Index: CMakeModules/FindGLib.cmake
--- CMakeModules/FindGLib.cmake (revision 960)
+++ CMakeModules/FindGLib.cmake (working copy)
@@ -28,7 +28,8 @@
find_path( GLIB_INCLUDE_DIR glib.h
PATHS /opt/gtk/include
- /usr/include
+ /usr/include
+ /usr/local/include
@@ -41,7 +42,9 @@
+ /usr/local/include
PATH_SUFFIXES /glib-2.0/include
+ /glib-2.0
Index: CMakeModules/FindGnomeKeyring.cmake
--- CMakeModules/FindGnomeKeyring.cmake (revision 960)
+++ CMakeModules/FindGnomeKeyring.cmake (working copy)
@@ -34,6 +34,7 @@
PATHS /usr/include
+ /usr/local/include
PATH_SUFFIXES gnome-keyring-1


  1. Wooo Hoooo! Thanks Ben! Complete with an actual patch. Very cool. You are the first person I’ve heard of getting the selector to build on FreeBSD. We’ll make sure to add you to the contributors list. Next we need to figure out how to get it into the FreeBSD ports system.

    Oh, and we should get it to actually work on the Bandit Cards site as well. If your binary actually works — which, given the build problems, I’m not entirely confident that it will — you’ll also need to install the Firefox extension so that it knows how to invoke the digitalme app. Back at the download page there is an xpi package that should do the trick. You need to install it into firefox. After you’ve installed the extension, the site should detect that you have a selector installed.

    As for the build problems… Personally, the cmake stuff is not my favorite either. I find the ./configure;make dance and autoconf options to be useful and fairly consistent. But Andy handles most of the code, so he gets to choose. And we’ll work on it.

    Also, I’ll relay your concerns about the iphone and see if we can find a more open prize in the future. :)

    Comment by Dale Olds — 29 Sep 2007 @ 21:19

  2. [...] I previously wrote, I’ve been trying to get Bandit’s identity selector to work on FreeBSD. The good news [...]

    Pingback by Links » Ben vs. Bandit, Part 2 — 1 Oct 2007 @ 10:31

  3. [...] Ben Laurie (founding director of the Apache Foundation) really cares about. So much so, that he figured out how to make DigitalMe work on it. That is really cool. It’s my job to think about how and what DigitalMe will work [...]

    Pingback by NOVELL: Novell Open PR » Blog Archive » Guest Blog: A Halloween identity tale — 9 Oct 2007 @ 16:45

  4. [...] my work on the Bandit identity selector, I have been keen to get the other end working – that is, the server side. As Java drives me nuts, [...]

    Pingback by Links » Configuring Apache httpd — 12 Oct 2007 @ 11:02

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress

E-mail It