Wednesday, April 25, 2007

pkgbuild tips - 1

I have been thinking for some time that I should publish some tips for building packages using pkgbuild. If you have created more then one spec file using pkgbuild, then you will know that many things are repeatable. The general process goes like time -
  1. Create an initial spec file from either a template or a spec file for a similar application.
  2. Try a build.
  3. You should expect that the above should fail. Check the log file (/tmp/.log) for where it failed. Fix the problem. Generally a typo or the build needs a patch
  4. Repeat 2-3 until the prep and build works. If it actually installs the packages, then go to 7
  5. Look in the RPM_BUILD_ROOT directory tree in /var/tmp for what was installed, and adjust the %files section of the spec file to match the installation.
  6. Go back and repeat from 2 (Note: you can short-cut this with pkgbuild)
  7. Publish the spec file(s), patches, ChangeLog etc and your done.
Todays tip involves adding a patch. I find that using 2 or 3 windows makes this really easy. The 1st window is where you do the pkgtool/pkgbuild commands and edit your spec files. You use the 2nd window to dig through the build area to find and fix any bugs or problems after a fail build. Have the 3rd window setup so you are in the /tmp directory. Once you have a change to make that requires a patch, just do somthing similar in following in the 3rd window.
jdsbuild@prae> cd /tmp
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> mv xfwm4-4.4.1 xfwm4-4.4.1-orig
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
#
# Fix the files which need to be patched.
#
jdsbuild@prae> diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 > ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff

At this point add an entry for the patch xfwm4-01-fixbadcode.diff into the spec file and try again.

If you need to add another patch, just remove the patched directory, and un-tar again.

Maybe you want to merge a fix into an existing patch. Just patch the directory in /tmp and then make the changes.
jdsbuild@prae> cd /tmp
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> mv xfwm4-4.4.1 xfwm4-4.4.1-orig
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> cd xfwm4-4.4.1
jdsbuild@prae> gpatch -p1 < ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff jdsbuild@prae> cd /tmp
#
# Fix the files which need to be patched.
#
jdsbuild@prae> diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 > ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff

Using a shell like bash with command line editing, the process can be quite quick and easy.

Have Fun!!!

Tuesday, April 24, 2007

Sex on the Desktop with Solaris

My first draft of this blog went into half a page of crap about how Sun was originally really cool on the desktop, and then decided it would leave it all to Microsoft and Apple. Rather than dragging up the past (and boring you will what you with what you already know), I will focus on the here, now, and future.

Having been lagging by several years, Solaris Express is now hot on the heals of todays desktop. JDS is currently Gnome 2.16 (2.18.x will be Solaris Express real soon). If you really want the latest and greatest now, you can either download and install the Vermillion developers release or build it directly from the JDS spec files. The latest and greatest Xfce Desktop (4.4.1) like Vermillion can be downloaded and installed (x86 only), or built from the Xfce spec files.

While JDS and Xfce are now are rather nice now. For the real story on a sexy eye-candy Desktop you can not go past Compiz on Solaris. If you are into shimmering transparent windows etc, and you think that there is not a hope in hell that you can do this on Solaris, then you need to check out Erwann Chénedé's blog. Also if you also want transparent windows for Xfce. Install Erwann's Compiz packages and rebuild the Xfce window manager from the spec files. Re-login and turn on the "Compositor" in the Window Teaks settings.

To top this off, I have recently added the spec files for several really cool 3D Linux Games (more on the way) and wine to the SFE repository. The SFE repository has the spec files for a lot of really cool applications for Open Solaris. Check it out!

The only thing missing now is the latest KDE....

Below I have put together hopefully some useful links for a Sexy Desktop Solaris...

Name: Open Solaris Desktop Community
Homepage: http://www.opensolaris.org/os/community/desktop
Discussion List: http://www.opensolaris.org/os/community/desktop/discussions

Name: JDS
Full Name: Java Desktop System
Description: Sun's version of the Gnome Desktop
Project Homepage: http://www.opensolaris.org/os/project/jds
Download URL: http://dlc.sun.com/osol/jds/downloads/current
SVN URL: svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files/trunk

Name: Erwann Chénedé's Weblog
Description: Compiz 0.5.0 packages and patches for OpenSolaris x86
Blog URL: http://blogs.sun.com/erwann/entry/compiz_0_5_0_packages

Name: Open Solaris Xfce Project
Description: Xfce Desktop for Open Solaris
Project Homepage: http://www.opensolaris.org/os/project/xfce
Download URL: http://dlc.sun.com/osol/xfce/downloads/current
Parent Project URL 1: http://www.xfce.org
Parent Project URL 2: http://goodies.xfce.org
SVN URL 1: svn+ssh://anon@svn.opensolaris.org/svn/xfce/spec-files-xfce/trunk
SVN URL 2: svn+ssh://anon@svn.opensolaris.org/svn/xfce/xfce-goodies/trunk

Name: Spec Files Extra (SFE)
Description: A Repository for pkgbuild spec files (Not only Desktop)
Project Homepage: http://pkgbuild.sourceforge.net
SVN URL: https://svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk

Name: Build Recipes Reference
Description: List of build files, scripts and patches for Open Source Software on Solaris
URL: http://www.genunix.org/wiki/index.php/BuildRecipesReference