Slashdot Mirror


Building Applications with the Linux Standard Base

r3lody (Ray Lodato) writes "Just because Linux is under the GPL, some people believe that it's pretty standardized. Actually, each distro has its own little additions and, consequently, quirks. Writing an application to work reliably under all variations is not a slam-dunk. The Linux Standard Base Specification seeks to provide the common ground that all Linux apps should adhere to, and therefore make reasonably sure that they will work as advertised. Building Applications with the Linux Standard Base is a reference manual for application developers to make sure their programs will work across the Linux map." Read on for the rest of Lodato's review. Building Applications with the Linux Standard Base author Core Members of the Linux Standard Base Team pages 246 publisher Pearson plc publishing as IBM Press rating 8 reviewer Ray Lodato (rlodato AT yahoo DOT com) ISBN 0131456954 summary Very dry reading, but a lot of useful information packed into a slim 246 pages.

I've been involved with IBM products and documentation since the late '70s, and their documentation has traditionally come in two flavors: user's guides, and reference manuals. The former are meant to be read cover-to-cover (more or less), and the latter are meant to be looked at for specific bits of information. This book falls more to the reference manual side of the spectrum. Consequently, reading it cover-to-cover was a little dry, but the information needed to get an application certified with the Linux Standard Base (LSB) was clearly laid out.

Building Applications with the Linux Standard Base (published by IBM Press and available on your favorite bookstore sites) is laid out in five large parts: Introduction, Developing LSB Applications, Certifying for the LSB, Contributing to the LSB Project, and Using LSB Resources. Except for the first part (Introduction), the book gives specific examples, and many, many references to the opengroup.org website's sections on the LSB.

It becomes obvious as you go through the book that the Linux Standard Base is still evolving. The authors (13 core members of the LSB team) frequently allude to how the project can (and should) be extended to increase its scope and sophistication. Two chapters (Adding New Interfaces..., and Adding New Architectures...) cover (albeit skimpily) what's needed to update the specification.

Backing up for a moment, Part II (Developing LSB Applications) describes in detail (with examples) the Dos and Don'ts of coding practices. It then explains carefully how an application should be packaged for distribution (RPM), and finally wraps up with a section on porting Solaris apps to the LSB. In each chapter, step-by-step instructions are given when appropriate. Differences in filesystem hierarchy, signal handling, and program options are all laid out to help you through.

Part III goes over the LSB Certification process. Both runtime environments (distros) and applications are covered. Again, the book lays out the process in a step-by-step approach.

The last part in the book talks about the various resources available: the written spec, the test suites, and various usage guides. The chapter on using the LSB test suites shows how much thought went into making sure a successful test ensures a certifiable (in a good way) application.

All in all, Building Applications with the Linux Standard Base, has what you need if you're developing a commercial-grade Linux distribution or application. Once your product has passed the testing described inside, you can be confident that it will work on almost anything Linux. Very dry reading, but a lot of useful information packed into a slim 246 pages. I'd give it a 7 for writing style, but a 9 for content: total=8/10.

You can purchase Building Applications with the Linux Standard Base from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, carefully read the book review guidelines, then visit the submission page.

22 of 282 comments (clear)

  1. Non Sequitur by pete-classic · · Score: 5, Insightful
    Just because Linux is under the GPL, some people believe that it's pretty standardized.


    Does anyone see how one thing is supposed to follow the other?

    -Peter
    1. Re:Non Sequitur by pete-classic · · Score: 2, Insightful

      Huh? Neither "GPL" nor "standardized" represent either of these things AFAICT.

      -Peter

    2. Re:Non Sequitur by Eric+Giguere · · Score: 3, Insightful

      Doesn't releasing something under GPL pretty much guarantee a loss of standardization? GPL = "Go, procreate and live".

      Eric
      How to detect Internet Explorer using the headers
  2. How about building applications for unix? by Anonymous Coward · · Score: 1, Insightful

    There may not be that many linux-specific high-quality standards, but linux follows closely most relevant unix standards. So why not just build your applications for the Single Unix Specification and ignore any linux-specific features?

    1. Re:How about building applications for unix? by networkBoy · · Score: 2, Insightful

      Not trolling here, but that illustrates how M$ and Windows are being successful.

      If this (LSB) actually takes off it could be what allows *nix to displace windows in the Joe Sixpack Desktop. All Joe currently knows is that he has a windows computer, so he looks for software that says Windows on it. With this as a replacement Joe's information complexity does not change just =~s/windows/LSB/g and Joe's happy.

      What I see here instead is:
      1) My way of implementing portability is best(Java)
      2) No it's not (Python)
      3) You're right, mine is (PERL)

      Whatever people. Until the developers can agree on a minimum compatibility spec that can be advertised (possibly LSB) Linux will only be in the data center.
      -nB

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  3. "linux standardization" by stratjakt · · Score: 5, Insightful

    This is about the hundredth project of it's kind that I've seen since linux' infancy.

    Good luck to it. I'd love see a "works with linux" stamp, and have distro choice be completely irrelevant.

    It's absolutely necessary if linux is to go anywhere worth going commercially.

    --
    I don't need no instructions to know how to rock!!!!
  4. it's lame that... by xyeeyx · · Score: 4, Insightful

    ...programs can break on subsequent versions of linux because something has been moved or changed. Come on, guys. Maybe the reason linux isn't mainstream yet is because it's so hard to get your feet on the ground before the rug is pulled out.

    1. Re:it's lame that... by Feyr · · Score: 2, Insightful

      that's called ldd and strace. those let me solve missing deps problems in under 5 minutes

    2. Re:it's lame that... by Archangel+Michael · · Score: 2, Insightful

      SCUSE ME, but shouldn't the average user not have to worry about such things? I mean, I can and do use make and ldd and strace and all that, but then again I am a professional. Mom on the other hand isn't, and shouldn't have to worry 'bout such things.

      Linux will not get to the desktop until such time as one can walk into a store (or online) and buy SUPERDEEDUPER Tools for Linux for 49.95 and have it work, out of the box on all the major distros (SuSE, Redhat, Fedora, Debian ..... ).

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
  5. Application level isn't such a problem by grahamsz · · Score: 3, Insightful

    An effort to make device driver standards would mean a lot more to lots of us.

    That would make it easier for manufacturers to make linux supported hardware and know that it worked.

    Every linux user needs linux compatible hardware, but relatively few need commercial software.

    1. Re:Application level isn't such a problem by dbacher · · Score: 3, Insightful

      2.6.8 to 2.6.9 broke ABI.

      --- QUOTE from someone who doesn't get the problem
      Simple, get your kernel driver into the main kernel tree (remember we are talking about GPL released drivers here, if your code doesn't fall under this category, good luck, you are on your own here, you leech .) If your driver is in the tree, and a kernel interface changes, it will be fixed up by the person who did the kernel change in the first place. This ensures that your driver is always buildable, and works over time, with very little effort on your part.
      ---END quote from someone who doesn't get the problem

      Wrong.

      The kernel developer goes into the GPL source code, and marks the driver as "incomplete" or at absolute best makes it compile. Not actually having the device, in all likelyhood, the code is then comitted, untested, to the kernel.

      At some later point in time, a week or a month down the line, some unsuspecting user installs the updated kernel, and their device starts having random, untrackable problems. They come to the list, and are told by a dozen people that the kernel developers aren't responsible for drivers, and that they should talk to whoever actually maintains the driver.

      After finding the appropriate mailing list for the particular driver that the kernel developer broke, the user posts a question about is there a patch, and receives e-mails from not less than 10 trolls telling them "it's open source, fix it yourself." Their message is in a sea of messages in all caps with too many question marks and exclamation points, where a developer is going around in circles with a user who can't afford a keyboard with a shift key, and can't afford to buy a vowel (they are expensive, you know).

      Finally after all of this, the device driver developer sends them back a reply "sorry, I've not had a chance to test with the new kernel yet, run the old version while you wait." Then the developer gets around to posting a patch.

      If you're lucky, it's a device a lot of people use, people get angry about it, and it gets some attention fast. If you're unlucky, you've got a device that needs the older kernel and a device that needs the newer kernel, and you have to make a choice between the two and wait for the other driver to get upgraded.

      The odds of another user capable of it getting off their ass and actually researching, fixing, and posting the fix are virtually nil.

      Here is the scenario for Windows:
      Insert your device
      Boot the computer
      Windows says "there's a new device, put the disk in"
      Windows copies the device driver
      Windows possibly reboots (this is rare for most device classes, but some still need reboots)
      Device works

      Now you can argue about bluescreens or whatever, but it is a better model in that Microsoft's kernel team takes no time maintaining device drivers. There's a clear ABI division between their kernel and their drivers, and that division changes only at major versions of the kernel.

      This is the thing. When I get the kernel, I'm getting thousands of drivers I don't want or need. Most of these aren't being actively maintained, and are being updated so that they compile but aren't undergoing any level of testing at all.

      The kernel developers do not perform unit testing on the drivers (there is no facility for them to do so), and do not typically have the hardware or the large number of hardware, software combinations that need to be tested.

      So no, putting it in the kernel tree does absolutely nothing to solve the problem.

      --
      If your code is acting bloated, and is running rather slow, it's likely and predicted that some loops you will unroll.
  6. Re:Actually... by Anonymous Coward · · Score: 1, Insightful

    Please learn Java before commenting.

    Thank you.

  7. What we need--installation/uninstallation API by bonch · · Score: 0, Insightful

    I am firmly convinced that Linux on the desktop will not break out of its niche until a binary installation/uninstallation API is developed that allows normal software developers like Adobe and Macromedia to write installers for their software. All you'd have to do is pop in a CD, autoplay would start, the thing would install, stick items into the "start menu" of the desktop environment, and provide an uninstall icon.

    The API should remain sane so that you could install something from four years ago and still have it work. I can still run Windows 3.1 and 95 applications on my XP laptop. Try running a Linux binary from two years ago.

    To really go all the way, there needs to be a unified framework, probably based on something like Mono, facilitating a desktop foundation and hopefully replacing X.org (Y-Windows looks promising if it would ever take off). That way, GNOME and KDE could just be seperate shells on top of the same desktop, and they would happily run each other's apps.

    I know what you're thinking--GNOME can already run my KDE apps and vice versa! No, what's happening is all those massive KDE libraries get loaded into memory when you run that KDE app. You have to install two entire huge desktop environments just to run all the apps you need. It's ridiculous. If there was a standardized library and GUI framework, this could have been avoided. But the obsession with "choice" when these projects were began has splintered the effort.

    First things first--give me a binary installation/uninstallation API. A real API like the non-amateur desktops have, not some package manager built out of shell scripts. I'd also request a kernel driver API that unties them from the kernel--recompiling an entire kernel to support a new scanner I just bought is ridiculous. I should just be able to go online and download a special binary driver, or, better yet--using the binary installation/uninstallation API, just pop in a CD in my desktop environment and have it do it for me.

    One can dream...

  8. Re:FreeBSD has it figured out by The_Dougster · · Score: 3, Insightful


    What about Debian GNU/kFreeBSD? Isn't that the Debian distro of FreeBSD? Just because FreeBSD is still relatively obscure doesn't mean that its not going to end up in the same boat as Linux. Give it a couple more years.

    --
    Clickety Click ...
  9. Re:Actually... by WebCowboy · · Score: 4, Insightful

    Dunno about you but I don't find Java all that easy across distros either.

    Java apps aren't immune to dependency issues either and I'm not aware of any widespread effort on the scale of LSB to create a compatibility and deployment standard.

    Dont forget the biggest dependency of all--you need a JVM to run Java. That still needs to be packeaged like any other app. Let me know when there is a GPL-compatible JVM, available in an LSB-compliant package that will install and run cross-distro...and wont break if you use a different X server or non-standard hardware...then we'll talk.

    Yes, Java can be written once to run everywhere, but you often still have a few hurdles to clear during compilation and installation.

  10. Re:Don't hardcode paths by MightyMartian · · Score: 1, Insightful

    > Don't assume your config file is /etc/thisapp.conf, don't
    > assume your data is in /var/spool/thisapp.
    > Make it all configurable.

    I don't know why anyone would put system-wide configuration data anywhere else but in /etc. I mean, I've been working around *nix for going on fourteen years now, and that was always supposed to be the place.

    The only real solution to this is to make options for loading critical config data from environment, but that also seems so kludgy when compared with a proper file.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  11. Radio Edit... by Duncan3 · · Score: 2, Insightful

    Writing an application to work reliably under all variations is not a slam-dunk.

    s/a slam-dunk/possible/

    Solution: Python, Perl, ANSI C, etc. i.e. don't code "for Linux" at all, just code. Of all the ports I've done, Linux is always the biggest pain in the arse, due to the joyous work of glibc, and of course Redhat's need to do everything their own way.

    --
    - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
  12. Re:Don't hardcode paths by barawn · · Score: 2, Insightful


    I don't know why anyone would put system-wide configuration data anywhere else but in /etc. I mean, I've been working around *nix for going on fourteen years now, and that was always supposed to be the place.


    Yah, but that's not what he's alluding to. What about /etc/thisapp/thisapp.conf instead of /etc/thisapp.conf (which pollutes /etc rather quickly)?

    Hence, make it all configurable. Then you don't have to worry.

  13. Re:Actually... by Tribbin · · Score: 3, Insightful

    I'd like to state that in this case a layer lower than the virtual machine is not working.

    If the virtual machine is not working properly, it's like running an x86 executable on a sparc.

    --
    If you mod this up, your slashdot background will turn into a beautiful sunset!
  14. Re:No! by ScrewMaster · · Score: 2, Insightful

    It's a poor craftsman who blames his tools.

    Absolutely true, and I can't tell you how many times I've heard otherwise-talented programmers blame their development environment for performance or stability issues. My attitude is usually something on the order of "Stop your bitching, get off your ass and deal with it."

    Conversely though, it is a good craftsman who picks the right tool for the job. Most languages can, to some degree, accomplish most tasks, just not necessarily well ... it's best to pick a language optimized for the task at hand. Or even parts of it: I've worked on many applications where I would use, say, C or assembler for time-critical or compute-bound modules, and something easier to work with for the GUI and file-management layers.

    What irritates me are programmers that learn a couple of languages and insist upon using them for everything, whether it's a good design choice or not.

    --
    The higher the technology, the sharper that two-edged sword.
  15. Re:Actually... by JamieF · · Score: 2, Insightful

    >At the moment, Java gui apps are neat toys.

    I guess IBM, Oracle, SAP, Intel, Novell, Red Hat, Wind River, and others desperately need you as a consultant to tell them that they should stop using Eclipse and rewrite their developer tools in C. Why don't you email them and suggest that?

    GNOME is pretty slow too. What's that written in again?

  16. Shitty license? by Craig+Ringer · · Score: 2, Insightful

    Qt is licensed under the GPL, with the option of a commercial license for a fee.

    It's not LGPL, sure. That means that commerical developers must buy a license from TrollTech or make the source to their application availible under the GPL. Not ideal for developers, but TrollTech are not a charity, and in my view they're rather generous to permit Qt to be used under the GPL (yes, it's just good business, but still...).

    I'd like Qt under the LGPL - or heck, the BSD license - too, but I don't see a viable way to keep Trolltech in business. I can't see any reason why they would release it under such a license, and think it'd be pretty dumb to ask them to. Additionally, TrollTech do the vast majority of the development on Qt, and I'd like it to continue improving so I can have more introspection and meta-object goodness in C++.

    Commercial developers have two perfectly good options - use Gtk, or buy a Qt license. I don't see that as a big deal. Remember that the "competition" is hardly in the business of offering cross platform GUI toolkits.