Wednesday, 6 November 2013

Building and Packaging Avahi 0.6.31 for Pidora Linux

This post is part of my ongoing project in the Pidora Linux project. General information on my project can be found here. Once again, I apologize for the lateness of this post. I had it done 2 weeks ago but was waiting to post the first post and find a time when the Koji build environment would co-operate.

Now that I have my Pi set up, I can begin building the latest version of Avahi for Pidora Linux. My goal for this post is to build Avahi 0.6.31 and have it running on the Pi.

To begin, I thought I would just try the configure process on my Pi. After this is complete I will probably move the building process to the Pidora Koji system as building on the Pi will be incredibly slow.

After downloading the latest source code from avahi.org using wget, I extracted it onto my Pi and ran ./configure. The configure step failed and alerted me that my C++ compiler was not working:
checking whether the C++ compiler works... no
configure: error: in `/home/tsbarras/avahi/avahi-0.6.31':
configure: error: The C++ compiler does not work

To fix this, I download the gcc c++ utility using yum install gcc-c++
With the C++ compiler installed I tried to configure once again. I was met with this error:
checking for intltool >= 0.35.0... ./configure: line 18800: intltool-update: command not found
 found
configure: error: Your intltool is too old.  You need intltool 0.35.0 or later.

It is apparent that I am missing the intltool utility. Let's install that using yum install intltool
With that installed, let's give it another shot! So far, the configure stage requires gcc, gcc-c++, and intltool.
Stopped again, this time it was glib2.0
checking for GLIB20... no
configure: error: Package requirements ( glib-2.0 >= 2.4.0 ) were not met:

No package 'glib-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GLIB20_CFLAGS
and GLIB20_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Let's try to fix this using yum install glib glib-devel
Although this installed some packages, it did not fix my problem. I finally found the proper packages to install from this post.
I suspect the package that I wanted was glib2-devel-2.34.2-2.fc18.1307161943kf.armv6hl.rpm and I installed it with yum install gtk2-devel gtk2
With the GLIB2 problems out of the way, I ran into another suite that needed to be installed.
checking for QT3... no
configure: error: Package requirements ( qt-mt >= 3.0.0 ) were not met:

No package 'qt-mt' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables QT3_CFLAGS
and QT3_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I solved this by installing the qt3-devel package.
After this I encountered the same problem but with the qt4-devel package; so I installed it. The library we are looking for is libQtCore.so.4 for package: 1:qt-devel-4.8.4-17.fc18.1307160019kf.armv6hl
So far, the configure process has required gcc, gcc-c++, intltool, gtk2-devel, qt3-devel, qt4-devel, gtk3-devel, dbus-devel, expat-devel, gdbm-devel, libdaemon-devel, monodoc-devel, xmltoman, doxygen, dot.

With these dependencies, Avahi 0.6.31 finally configured successfully with all documentation. If you do not want documentation, you do not need xmltoman, doxygen, or dot. All this is mentioned in the 0.6.30 spec file.

I got the original spec file by using yumdownloader --source avahi to grab the srpm of avahi for armv7hl. Then I used the commands rpm2cpio avahipackage.rpm | cpio -idmv to extract the files and retrieve the spec file.

Now I will run make on the new version of Avahi on my Pi. If I run into problems, or the build takes more than 1/2 an hour, I'll just use the koji system and begin packaging avahi.

So the build failed because gtk2-sharp was not found. I have moved the spec file and sources over to my main PC and will modify this package using the Pidora Koji system. I will now attempt to build on the armv6hl system. The build now requires gcc version 4.8.1. This was because the Koji build environment was being updated and the version of libtools required a version of gcc that was still being built and added.

After playing with the spec file and performing one test build, the SSL between my pc and the Pidora Koji system seems to have stopped working.

Error: [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')]

I have tried to make contact with others on IRC to resolve this problem. The problem resolved itself about an hour later. It appeared to be a problem on the server side. With that out of the way, I was free to test my builds once again.

From this point onwards I figured it was better to use the upstream package from Fedora 19 as opposed to using the pristine Avahi source code that I had been using before.

The 0.6.31 spec file requires that libtool be installed for building. As I was building on my Pi, I did not have this error. It is because on the Koji system, the builder grabs the latest version of libtool but an old Fedora 17 version of gcc (I believe the latest gcc build is on the way). On the Pi, I am using an old version of libtool and an old version of gcc. To compensate for this I changed the spec file to only build with libtool if the architecture is not armv6hl. I will modify the spec file when the gcc 4.8.1 build is complete.

I had some errors about hard-coded directories and fixed them with macros in my rpmmacros file but of course it wouldn't build with this so I had to leave them out.

The build succeeded! I downloaded all of the rpm's to my Pi and ran sudo rpm -U *.rpm to update to the latest avahi. After running avahi-daemon -V I was told that my Avahi is now 0.6.31. Hurrah!

UPDATE 4/11/2013: I have now also rebuilt this package with the updated libtool and gcc packages.

Testing will come in the next post!

0 comments :

Post a Comment