Monthly Archives: September 2008

Writing my first real specfile

I am starting to get sick of Rhythmbox and Banshee as they are plain annoying at times. Last year through my use of the ArchLinux IRC channel I became aware of this neat little application called MPD or Music Player Daemon for those who hate TLAs. MPD is real neat for those of you console lovers or anyone who wants their music to be stored and played on one computer while controlling it from any device which can establish a TCP/IP connection. I have always used Sonata (GTK) and ncmpc (ncurses) to connect, but I decided that i’d love to be able to control my music when I am on my laptop. I did a little research on the mpd wiki and found that there is a really nice application available for windows+gtk in binary form. After trying it out, I have decided that it is in fact better than Sonata. I went to download it and noticed there was no RPM, I checked PackageKit and there is no package.

Long story short is that I have a perfect opportunity to learn some RPM packaging :D

I am referencing an article on the Fedora wiki to learn basic techniques.

The suggestion of a dry run really was a great one since I was able to find out that there are dependencies that aren’t listed in the program’s documentation. One was relatively easy, it was caught during the configure script, the other was just plain odd. The program compiled perfectly, but kept crashing on me no matter what I did. I searched based on the console output of the program and a lot of the results seemed to deal with database applications. Knowing that there is no large DBMS tie-in to this program, I kept looking and came across something called gnomedb which after installing allowed this program to run perfectly. That was anoying!

The next joy is the %files section. This is the magic of package managment. If you do this wrong (as I understand it) you will have files left in various places. The best way I know how fill this is that when you do a dry-run compile, make a temporary directory and use it as your --prefix= directory when you configure (i.e. ./configure --prefix=/home/jhford/ariotestinstalldir) your application.

Once I finished that, I put in a changelog and as suggested, ran rpmlint on my spec file and god a really nice bit of output: 0 packages and 1 specfiles checked; 0 errors, 0 warnings. which means things either went really well, or horribly, horribly wrong. During my rpmbuild I came across a couple issues, first that I wasn’t giving correct file paths for the strip command. For that, I made use of the upstream make target: install-strip. My next error had to do with the %files section. Rpmbuild is claiming that I have an installed file that isn’t packaged, being the logo. I don’t know why this happened. To fix it, I copied the path from the error message and replaced /usr/share with %{_datadir} (which is a variable that points back to /usr/share). This seems to have fixed my trouble. I am going to install my rpm file and see whether it worked or not!

For stripping, I later realised that RPM knows how to strip files just as well as that install target, but when rpm does it, I get a debuginfo package. I will leave it with that.

The moment of truth: Installing my first ever package! It works!

Only problem is that the icon in my gnome-panels menu doesn’t show up. Through reading the pidgin.spec file, I noticed that they used something called gtk-update-icon-cache to update these icons. I found that the fedora wiki has some real nice snippets to do this, so I made use of them. After doing this, the package worked as expected!

iTunes Store Arrows in iTunes 8

I hate the little arrow links that take you to the iTunes store. I could disable them in iTunes 7, but now apple seems to think I should choose between locking myself from the iTunes Music Store and seeting those anoying things. If it weren’t for the automatic cover downloader, i’d do that in a heartbeat, but it is really useful. I found a bunch of articles about how to do this on a Mac, but I am not running a mac. I ended up finding this article on how to remove the links and I also found one on the same site that gets rid of the genre column from the browser. Why on earth did Apple remove these settings? This is why over-simplifying UI can be a bad choice in my opinion.

In case the original article dissappears, here are the basic steps:
Open %AppData%\Apple Computer\iTunes\iTunesPrefs.xml in a proper text editor, the article’s author recomends Notepad++ then right underneath. Note: the

<keyUser Preferences</key><dict>

add

<key>show-store-arrow-links</key>      <data>      AA==      </data>

and/or

<key>show-genre-when-browsing</key><data>AA==</data>

Building JBoss from Source

I have already tried to build jboss, but determined that what i was downloading wasn’t any good. I am going to try again from scratch. This time I am going to check out the correct version of JBoss from their subversion server. I am using a document I found on google that deals with checking out source. I also found a JBoss Wiki page which relates to svn access.

To tie everything together, my goal is to set up an OpenGrok instance which will index the new Mercurial tree on my self-built JBoss Application Server.

To start I checked out Mozilla Mercurial tree as per the Build Documentation on MozDev. At the same time I started checking out the latest JBoss using “svn co http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_CR2".

After this finished, I ran the same build command I was running before. The difference is that where before it would just check out already built components I think, I get the most satisfying compiler error I have yet come across! It can’t find javac which means that it wanted to use javac. I just reinstalled linux on this machine and It seems like I forgot the jdk.

BUILD FAILED/home/jhford/jboss/svncos/JBoss_5_0_0_CR2/tools/etc/buildmagic/buildmagic.ent:441: Unable to find a javac compiler;com.sun.tools.javac.Main is not on the classpath.

After installing the jdk, it looks like it is really building! I am getting near 100% cpu utilization across both of my cpus without any -j4 magic which is nice, I can’t wait to see how long this takes on my quadcore. It finished a lot quicker than I was thinking, it only took 1 minute and 42 seconds to build which is a little strange. This made me wonder if this was real or not. After running the build script, i changed into the output directoryies then ran “bin/run.sh” and 41seconds later I have a JBoss server running at localhost:8080. I think it is funny how a program takes almost as long to start as it does to build. I am going to do some investigating to see if this was the whole jboss package or just the application server. I don’t know what to think right now, this is all so different to the 30+ minute build process I am used to for everything else that is big.

After looking through the start up output, I am seeing something about JBoss Microcontainer which is their server for POJO (Plain Old Java Objects) web applications. This is confusing because I specifically checked out he JBossAS. Time to start on OpenGrok!

OpenGrok is a source code indexer that is very fast and extensible. I have had experience with it in the past through Mozilla@Seneca. I am going to set up an instance of it for Mozilla running on jboss.

To do this i have been following the documentation at the opengrok project site, however sparse it may be. Initially, things look good. The first line of output while I was building the index was that it found a Mercurial repository which makes things easy. I tested the WAR file and it deploys perfectly, now I just need to test the index when it finishes. If this works, I’d really like to set this up for Mozilla as I know from experience that MXR is painful!

EDIT: It is working, and as soon as I figure out how to make jboss bind to my primary ethernet as well as my loopback, I will post a link for all of you to check it out.

Links:
JBoss Development Process Guide

p.s. Please let me know if i am rambling or if i should be less wordy as i don’t normally write blogs.

HP Battery Degredation

I just realised that my battery is only holding 91% of its designed charge. This laptop is less than 9 months old and it came with a 12cell battery. I am the following values from acpitool -B

[jhford@dv2727ca mozilla]$ acpitool -B  Battery #1     : present    Remaining capacity : 8042 mAh, 100.0%    Design capacity    : 8800 mAh    Last full capacity : 8042 mAh, 91.39% of design capacity    Capacity loss      : 8.614%    Present rate       : 0 mA    Charging state     : charged    Battery type       : rechargeable, LION    Model number       : Akita    Serial number      :  2945

I was just on the online chat with their agent was telling me that i have to have something called HP Total Care Advisor to be able to diagnose the problem to their satisfaction. The catch: You have to have the pre-installed version of vista!!! The same version that has a million trials and adware things, the vista that has a 400pixel tall yahoo search bar! Then they tell me that you can’t download a setup program for this thing!

This is insane! Why would you ever buy an HP Computer with ‘support’ like this?

Luckily, the agent was nice enough to send me a link to download this application
hp tca but i just hope that everything works and i don’t have any issues with this. What irks me is that this happens after i just purchased 3 hp laptops for me and family members!

Useful links:

http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&dlc=en&cc=us&docname=c00821536

http://h10025.www1.hp.com/ewfrf/wc/genericDocument?docname=c00817650&cc=us&dlc=en&lc=en&jumpid=reg_R1002_USEN

Jboss, are you really building?

As I was mentioning, I want to figure out if my jboss is actually compiling or if it is just downloading a bunch of files that have already been compiled. Since i am using the OpenJDK for running and compiling, I decided that the easiest way to see if I am compiling is to wrap the java compiler with a simple script:

#!/bin/bashecho "Executed javac at `date`: with arguments of $*" >> /home/jhford/javac-jobs./javac-real $*

This script gives me output like this:

Executed javac at Sat Sep 20 11:09:11 EDT 2008: with arguments of -version

Unfortunatley, when using the command ‘ant’ I get no output, which leads me to beleive that this isn’t building the software. I am going to have to find something else to out how to actually compile since as I understand, I must build from source to meet the Fedora packaging guidelines.