Showing changes from revision #5 to #6:
Added | Removed | Changed
RISC OS on the Raspberry Pi has been the first release with a package manager available to upgrade the system and install new programs. This guide describes how to make new packages and submit them to the package repository. All this is very new at the moment, both the RISC OS software, the documentation and the server infrastructure, so please bear with it as things settle down.
There are two programs for installing new software on RISC OS Pi, !Store and PackMan. These are two complementary systems, which operate in different ways. !Store is primarily an index of available software, and a way to buy commercial software. It stores and downloads software, but leaves it to the user to install and upgrade programs.
PackMan is a package manager, in that it both has an index and download function, but also installs and upgrades. In RISC OS Pi, PackMan is the primary interface for updating the OS distribution after it’s been released, including new ROMs and other system components.
PackMan wasn’t written from scratch, it uses the underlying package format and code from a previous packaging system called RiscPkg. RiscPkg laid much of the groundwork for the packaging system as it now stands, but has seen little development in recent years. Some users also criticised it for lacking in user-friendliness, hence PackMan was written. Some of the terminology continues to refer to RiscPkg however. In theory RiscPkg and PackMan will operate on the same database – in other words you can use them interchangeably – but this hasn’t been tested recently.
For more details on using PackMan to install, move, upgrade, remove, etc packages, see the PackMan User's Guide.
A packaging system that automatically installs programs needs them to be structured so that it knows where to put all the files. For example on RISC OS, files need to be installed in !System, !Boot.Resources, and other places. PackMan will handle this, but you need to tell it what you want. In addition, it needs to have information about the program itself – the name, the version, a description, dependencies (what other packages are needed for this one to operate), and so on.
As it happens, PackMan packages are Zip files which are structured in a particular way to aid auto-installation. This means you can view PackMan as a clever unzip tool that keeps track of everything it unzips, so that it can rollback when things change (for example, a program is removed). PackMan maintains a database of the files and packages it knows about. It’s also possible to manually install programs from PackMan packages (they’re just Zip files after all) but, since this is not recorded by PackMan in its database, such manual installs won’t be updated unless you do it yourself.
There’s two main components of a package: the program/data files themselves and the packaging information.
Earlier versions also included the system variables and the sprites. These are now deprecated. PackMan from 0.8 onwards can use the RISC OS Boot mechanism to perform the equivalent functionality.
First, think about how to structure your package.
One consideration of packaging is that your files will be pushed to the user’s machine. The user can use PackMan to move applications around, but it’s not appropriate to have a haphazard file layout in your package because you’ll impose it on all users. So, ideally, design your program so that it’s stored in an application, rather than a directory full of files. For example, put your documentation and example documents in a directory and have that open when the user clicks Help from the Filer menu on your app.
Also, think about how you might split up your program into multiple packages. For example, users might not want to install all the documentation, or the tutorials, on a machine with a small amount of storage. You might want to make packages like MyApp, MyApp-Tutorials, MyApp-Examples, and so on, instead of one huge package. Or you might use a module that is useful for other programs – make it a separate package and they can all share it instead of installing their own (potentially out of date) versions. When a package is upgraded, the full package will get downloaded. If you break things up, users won’t have to re-download the whole lot for a small change in the program code.
Let’s assume you have a nice simple app !MyApp, that has files outside it. If you split your program up, you could have several !MyApp shells, each containing the parts for that package (for example tutorials might only contain !MyApp.Docs.Tutorials)
The quickest way to make a package is with PackIt, a tool which can be installed with PackMan (or install manually )
Drag !MyApp to PackIt, and fill in the boxes. PackMan will warn you about which things remain to be fixed. Then click menu to save out the package file.
(In the case PackMan gives spurious warnings – eg about an empty Copyright window that isn’t – you can still save out the package anyway, or load an existing package to modify it)
PackIt has help which explains the options. If you really need to read the gory details, see the RiscPkg policy manual There’s also a Drobe article on the subject (aimed at packaging by hand rather than a tool like PackIt).
Any time PackMan finds a package with a version number higher than the one already on your system, it will attempt to upgrade it. An upgrade may not be because the program itself changed – something may have changed in the other files or the way the program is packaged. To mark this as an upgrade, package version numbers have two or more components. For example, version 3.4.1tiny-9 has a suffix -9 which indicates that this is the ninth package of program version 3.4.1tiny.
Important. Any time you update a package, you must increase the package version number. If you don’t, users who try and install the old version will get an error message due to a mismatch between old and new.
You may have to create a package yourself, or modify the output of PackIt in some way. See below and the above links for more detail on how to do this.
Modules for !System go in a directory in top level of the Zip called (annoyingly) System, in the same structure as !System (eg System.310.Modules.Network…)
!Boot components are divided by their function. For example, files to go in !Boot.Resources live in a directory ‘Resources’ in the zip. Similarly for RO500Hook, Library and Utils (which goes into !Boot.Utils).
PackMan does not support installing things into Choices. This is deliberate, because user settings live there – PackMan leaves Choices completely alone when upgrading software – if it didn’t, it would overwrite your choices with the defaults of the new version. In addition, some versions of RISC OS support multi-user mode, where each user can have their own Choices.
This means that you may have to alter programs that expect users to copy things in Choices at installation time (such as folders of settings like !ZapUser and !StrgEDcfg). The best way to do this is to copy them into <Choices$Write> the first time the app is run, and also to handle any necessary upgrading by detecting an old version is in use.
PackMan also provides Manuals, Utilities and Printing which are, by default, installed into those top level directories.
If you need advice on where other things should be installed , do ask for help (see below).
Currently, RISC OS Open have a fairly basic means of integrating your packages into the distributions. To supply your packages:
/fred/myapp-1.0.1-1.zip
/fred/myapp101-tutorial.zip
packages [at] riscosopen.org
with the URL of the pointer file.Packages will be checked and, once any issues with the packages are fixed, they will be downloaded on a nightly basis to the ROOL server and added to the repository.
If you upgrade your packages, just update the pointer file to point to the new versions. The old versions will be automatically archived for safekeeping – you don’t need to do anything. When you update a package, make sure you increase the revision number (the last digit in the package version number – eg the ‘3’ in 0.1.2-3) so that it’s clear that it has been changed.
ROOL takes care of providing a stable server from which to serve the packages to users, so it doesn’t matter if something later happens to your web space (except updates will no longer happen).
Should you wish to remove your package from the ROOL server, please contact us at packages [at] riscosopen.org
. See also our privacy policy for more information.
If you need help or someone to look over your packages, feel free to email packages [at] riscosopen.org
or post on the ROOL forum.