Building Applications with the Linux Standard Base
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.
Ah, yes, standards. So many good ones to choose from.
... writing apps that work across distros is really easy - it's called Java. :)
Does anyone see how one thing is supposed to follow the other?
-Peter
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?
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!!!!
Does this mean the "make configure" checks will be shorter, because stuff if standardized? Or where will this be visible for end-users?
Z
...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.
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.
File naming protocol
------
Characters in filename names are a rare commodity, to be used wisely.
Filenames should be abbreviated to the point of obfuscating any meaning:
Why use "print" when you can use "prin," why use "prin" when you can use
"pin," why use "pin," when you can use "xb."
Standard output formatting protocol
------
When printing a table of data to standard output, there is no need to
label rows and columns. Linux users are elite professionals, they
instantly know what the endless rows and columns of hex values,
abbreviated acronyms, and various other standard and non-standard
variables represent.
In the rare occasion that a Linux user is unsure what some data
represents, he will simply view the source, if the source is not
available, he will disassemble the executable, and read the assembly code.
If you must label columns and/or rows, please
follow guidelines set out by the "File naming protocol" section.
The biggest pain in the ass I find in writing complex apps that interact with other complex apps, across different Linux distros, is the different filesystems. Where's the meta-FS-standard, where either "make" or at runtime my app can access a filesystem path under one distro's namespace (ie, on which the app was designed), and have it translated to the distro under which it will run?
"That's the nice thing about standards... there's so many to choose from!" - Anonymous PHB
--
make install -not war
Come on people, that is not insightful,.. flaimbait at best.
- Java is slooooow (yes it is, just because its a fun language, doesnt make it any less slow). It's certainly not something you would want to code your browser, fps-game or webserver in.
- Every GUI Java application feels like, well,... like Java.
- Java doesnt run smoothly on all platforms. Maybe it just me, but Java has caused me trouble on all platforms I have used (Windows, RedHat, Debian and Gentoo).
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.
IMHO, this is one great advantage that the FreeBSD project has - there are no "distros".
I think, until a Steve Jobs or Bill Gates comes out with a killer apps with a corresponding toolkit that takes over the market, we'll be stuck in the same boat.
The Kai's Semi-Updated Website Thingy
Java solves the problem of cross-platform apps at the granularity of CPU/OS-API. The JVM doesn't solve problems of different Linux distros, because they all share the same OS API. If you're running the same binary across different CPU architectures, even the same distro won't run x86 binaries on PowerPC. And if you're recompiling from source for different CPU architectures, Java doesn't do anything at runtime that gcc doesn't do at build time. Java is a solution to a more fragmented platform, like "web servers", than we have with Linux.
--
make install -not war
Moderation +1
70% Funny
30% Offtopic
How the hell is a joke about "extract from book" in a book review thread "Offtopic"?
--
make install -not war
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...
Writing an application to work reliably under all variations is not a slam-dunk.
So it turns out that Microsoft's mutant penguin ad compaign was right all along?
For the past few years, I've been screaming about the negative effects of having so many different standards to choose from on Linux - this is why I personally use FreeBSD and OSX (well, okay, and Windows for games).
But the biggest problem (which also exists on FreeBSD), is QT. The shitty licence has caused so much damage by keeping cross-platform and commercial development off KDE (one of the most popular window managers). I know there's GTK, but I can't help think that Linux might have reached critical mass and become mainstream popular without it - GTK might not be perfect, but it is a STANDARD.
Monkey man Steve Balmer might have looked silly when he yelled it on stage, but he was right: "Developers, developers, developers." The Linux community should be bending over backwards to attract new developers into their flock, by making their passage into the fold as easy and as hassle-free as possible.
Chicken and the egg: applications for Linux, users for Linux. The Linux community can't force people to use Linux for the sake of using Linux, but they can bring applications to the platform - if they're worth using, users will follow.
Basically LSB is a set of rules that some group came up with to try to make "the one" distro. LSB takes away the differences and uniqueness of distros and makes them all the same. I don't see this ever working nor good for Linux. Why don't they just call it Redhat Standards Base, as if all distros followed LSB they would all be Redhat. Who wants that?
Don't assume your config file is /etc/thisapp.conf, don't assume your data is in /var/spool/thisapp.
Make it all configurable.
Linux has approximately 15% of the server market in 2003. And it just keeps growing. That sounds pretty mainstream to me.
7 175,00.htm
http://asia.cnet.com/news/systems/0,39037054,3920
OpenOffice, or Mozilla, just unpack and install, works on all Linux distros, although distros do rebuild em for their specific distro you can still get the packages from the distributer of the app, thats how i get mozilla & firefox & thunderbird, and OpenOffice, RealPlayer/HelixPlayer too is looking much better than before...
MPlayer is very nice now and with the essential codec pack plays anything i want...
"Building Applications with the Linux Standard Base" has been (apparently) also published under the GNU Free Documentation License. Here is the Online version.
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/
because as good as their intentions are, it's never really going to happen.
If we pretend for one moment that Linux is all about the desktop market, the LSB is only going to have relevance to the top two or four distributions, period. The server market is more restrictive, only two distributions, most likely sharing the desktop market. Forget the embedded market totally.
NOTHING else will register, and there's no reason why it ever should.
insecurity asks the wrong question irritation gives the wrong answer
If I had a Slashdot account(1) I'd mod this up.
(1) Every conceivable username has already been taken, and I refuse to use something like b0b_luv_a0lz_d00d2004.
The differences between Linux distros are what make Linux a vibrant community and drive innovation. I hope the LSB project fails miserably to remove those differences.
-73, de n1ywb
www.n1ywb.com
Instead of having a proprietary OS I can now have an open source OS and run all my apps on a proprietary interpreter?
Depending on the version of the C compiler you use, different kernel data structures will contain different alignment of structures, and possibly include different functions in different ways (putting functions inline or not.) The individual function organization isn't that important, but the different data structure padding is very important.
the C compiler.
It's kind of funny that the gcc has become such a standard in the Linux world, that now it's just called "the compiler".
When people are going to realize there is no such thing as one Linux. Each distribution is pretty much a different operating system. Somehow if two operating system have the same kernel(quite frankly even that is false becase RH kernel is different from Suse or Official Linus' kernel) people think they are the same. They are not. They are similar but not the same. Accept it and get over it.
Particulary becase of the fact that Linux is open source there is always going to be "non standard" Linux based OSes.
Your argument isn't valid. If the cross-platform capability was what was hindering the C++ code optimization, then the same argument should apply to their C compiler. gcc generates very good optimized C code. The reason the optimizer is bad is because of the development history of g++. They evolved the compiler to support more and more of the standard (which is a good thing). In the process, however, more and more available optimizations were lost (which is a bad thing). It's that the available manpower is being spent on getting the C++ compiler standards compliant instead of making it generate fast code. I have no doubt that when the standards compliance is done that the optimizations will kick ass.
Oh, and I am the grandparent poster. I actually use g++ despite the bad code generation because it is the only compiler that actually compiles some of my C++ code correctly (although when the intel compiler does compile it, I use that -- yay test cases). Besides, it's still faster than my equivalent java code. I didn't mean to offend any gcc fans. It's just still fairly young in its development.
After reading dumb comment after dumb comment, i do wonder if linux has a bright future. But i can always hope that when linux will be one big standard windows distro that some bright chap will have forked a good non standardized rebel version that wont succome to all the problems that arise with Standardizing things. Also it seems to me that microsoft has driven advancement for quite a while now with their resource demanding software. And i still see people bitching about Java not being as fast as binaries, why not skip the whole Compilation process and have dynamically compiled source that is compiled at runtime that way you take the worries for dependancies from the developers hands and put it in the hands of the compiler. As a developer i will install the necesary tools to cary out a certain functino of my software, but then i have to worry that it might not work on machines that dont have this or hardware that is less then that etc. Why the hell not just distribute the source code and have the compiler decide that on the spot ? I need this library, then go get it from its location online and run the damn application. Yes its slow but that can be a good thing.
Functino: The smallest unit of code which can be perceived to perform a useful action.
Your running kernel version 1 and the drivers in kernel version 1.2 and version 1.2 has some API changes that the driver uses.
Kernel 1.2 also has a very new VM that causes no amount of grief (as do the new changes in the API) so it's not an option to just download the driver and compile.
You could probably hack the driver to work, but then it would could be buggy and it would be hard to benefit from other bug fixes etc...
The drivers and the kernel need to be seperated for the good of Linux, what happens in a few years when we've got twice the number of drivers to maintain and how can you expect a comercial(one that makes money!) opertion to try and hit such a moving target.
thank God the internet isn't a human right.
La arquitectura interna del microprocesador PowerPC es ENORMEMENTE MUY MARRANA.
Los mejores microprocesadores de propósito general son : "Pentium-M" de Centrino, "x86_64" de Opteron y el limpio "Alpha 21364".
Nunca compraré un PowerPC ni un PowerPC64.
no me entiende? Utiliza un traductor.
Actually, each distro has its own little additions and, consequently, quirks.
GNU's not UNIX. I get a bit of a laugh out of that.
-- "Makes Little Debbie look like a pile of puke!" - Moe Szyslak
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.
LWN already had a great article on this:
http://lwn.net/Articles/96347/
LSB rpms depend by their very nature NOT on other stuff ... forcing administrators to hold multiple disparate copies of the same libraries, and have to keep track of the security of each individual copy. Or perhaps every lsb app is simply statically linked?
/opt/ and nowhere else.
...)
No, because they go to
The LSB standard doesn't guarantee this. It only suggests, and recommends that there be documentation of other modifications made. It does not prevent modification. (Chapter 5)
You haven't yet understand the purpose of LSB, have you?
Yes I have. LSB is a way for Redhat to impose vendor lock-in and attempt to hijack the Linux market. Too many distributions were popping up using dpkg instead of rpm because it was better, and they had to do something to stop their eroding marketshare. So they form a standards committee with HP, Sun, and other Microsoft friends, and try to brainwash the Linux community into thinking this is a great idea because standards are good, right? They make their filesystem layout the "standard", their package management tool the "standard", etc and then make everyone feel guilty for not following the "standard".
I have no guilt. Redhat are a pawn of Microsoft, being used to drive Linux into the ground with technically inferior "standards" and user interfaces that are just like M$ Windows but not quite good enough so desktop users don't feel compelled to switch. They could have used their old monopoly to further enhance Linux, instead they appear to have used it to buy up kernel developers so they can't speak publically against the company line, and to prevent good things getting into the kernel as long as possible (eg, reiserfs, devfs,
Their idea of a "community" seems to be "people who will do marketing for us for free!" as they have a proven track record of ignoring horrific bugs in their packages (both code/patch and packaging) that had been fixed by third-party rpms distributed via their own "community" mailing lists long before release of the next distribution version. Quality is second to profit. Wait, no, third to maintaining reputation.
I don't trust their business practices, their commitment to the real open source community nor their ability to create unbiased standards for that community, hence I won't use their distributions, nor advocate their standards, and urge the community to do likewise.
Matt
...is lack of coherent marketing. Competitors are very careful to frame any discussion with technical details and stresing that there are many different versions. The key to selling Linux to people who make decisions is to take a step back and focus on the high-level. Explain just how cheap it is and just how rock-solid and secure it is. Don't let the MS advocate in the room bait you into a debate about the finer technical points. I've got a bunch of stuff at www.softwareobjectz.com that may help to frame the discussion better. www.softwareobjectz.com
http://www.softwareobjectz.com