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
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!