Autopackage API Bindings
Wednesday, April 26th, 2006Autopackage has a pretty decent API that does everything from comparing versions, to finding shared libraries, to installing menu items. A while ago, in a comment on Mike’s blog (can’t find it now), someone suggested writing bindings for the Autopackage API. At first I wasn’t sure if it would be useful, but now that I’ve thought about it, it’s seems like it could be pretty handy.
I know that there are corporate lawyers at ISVs who are just going to require an EULA to be displayed and accepted before any files land on disk. This ISV would like to provide a Linux version of their software, but their lawyers and managers require the installer to display an EULA and serial key check.
I think this is a case where libautopackage (or whatever it’s called) could be useful. The company writes their installer in C which handles all the interaction like showing EULAs, checking serial key numbers, showing screen shots, playing stupid music, etc. Meanwhile, libautopackage is chugging away in the background, checking/installing dependencies, installing menu items, updating environment variables, and doing whatever it is that installers do.
The ISV gets several benefits that they wouldn’t get from rolling their own installer:
- Our binary compatibility tools (well, they could use them without autopackage, but it wouldn’t be integrated).
- Dependency Checking/Resolution
- Our non-Autopackage APIs like compareVersions(), isInList(), getKey(), and stripDupedItems()
- Our APIs for installing distro dependent stuff like menu items and MIME types
And some other stuff as well, like their program is listed in the package manager, statistics on installs, auto-updates (maybe, in the future? I think Curtis may have had some code for this…), etc.
Some of this can be accomplished by the ISV writing a new frontend for Autopackage. However, a new FE doesn’t exactly have the same flexibility as a new installer.
One example of where this would be useful is an office suite. Often times, an office suite has optional addons (such as extra file format converters, language packs, etc). The custom installer could ask the user what they wanted installed, then use libautopackage to install the core application and each optional component as an Autopackage.
Writing the bindings probably wouldn’t exactly be easy, as Autopackage is written almost entirely in bash, and is most of the APIs require global variables to be set, like $PREFIX, $WORKING_DIR, and $AUTOPACKAGETARGET. Also, I’ve never heard of bindings from bash to C, it could be pretty slow (starting a bash session each time a function is called!). And no, rewriting Autopackage in C doesn’t really sound like fun!
Anyway, it’s an idea…very possibly/probably just more inane ramblings from Taj. Thoughts? Good idea? Bad idea? Impossible to implement? Leave a comment!
