Home Home > 2008 > 05 > 26 > learning ruby…
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

learning ruby…

May 26th, 2008 by

Recently, I wanted to show how the buildservice makes packaging easier by creating a specfile template for you (just click the “Create RPM SPEC file templat” checkbox when creating a new package). Unfortunatelly, the template it creates is not really useful for someone not skilled in writing spec files. Also, it’s just a static template, so you have to write the summary and description even though you have just entered both in the web form. Definitely nothing to show off to newbies ;-). But knowing that the buildservice developers have more important stuff to do, and wanting to learn something new, I decided give it a try and fix it myself.

My idea is: The buildservice api asks a set of questions, which are presented by the client (webclient, osc, …) to the user, and creates a specfile based on these questions. Also, the api tries to suggest good defaults where possible. After spending some time learning ruby, rails and the api code, I have an ugly 200 line patch to the api that generates a working specfile for GNU hello ;-).

wizard in action

The user interface part is not yet done, but should be easy. What’s more chalenging is adding heuristics to “do the right thing”: detecting the build system (autotools, cmake, Makefile.PL, etc), detecting build dependencies, and so on. Right now, it only extracts the version number from the tar name.

Both comments and pings are currently closed.

3 Responses to “learning ruby…”

  1. Argh, cannot copy and paste from a PNG!
    Fortunately, the text (and screenshots!!1!) is available here: http://lists.opensuse.org/opensuse-buildservice/2008-05/msg00228.html

    Ahem, “localhost”, OK.

    • Michal Marek

      The xterm screenshot is obsolete anyway, I had to change the protocol a bit. But the good news is that the code is in the opensuse svn since yesterday, so you’ll be able to try it out soon.