DIY Packages
Chris Johnson (125) 825 posts |
I am about to start trying to get some of my own software in to package format. Assuming my stuff is simple enough for Packit to deal with, the next step would be to see if the packaging has been successful, and Packman could install it. I have actually fetched the urls in the sources of my version of Packman, and they look like a simple text file with details of each package hosted. The included url for each package points, usually, to a zip file. Is this all that is required for ‘test’ package delivery? I thought I could use either my own web site, or even WebJames running on a local machine. Is this all that would be needed for test purposes, or is there more ‘magic’ involved at the server end? |
Chris Gransden (337) 1207 posts |
You only need a package source file and the package. Here’s an example package source file. Package: Anagramarama Priority: Optional Section: Games Maintainer: GCCSDK mailing list <<a href="mailto:gcc@gccsdk.riscos.info">gcc@gccsdk.riscos.info</a>> Standards-Version: 0.1.0 Version: 0.3-1 Depends: SharedUnixLibrary (>= 1.11) Licence: Unknown License: Free Description: Word game. The aim is to find as many words as possible in the time available. Get the longest word and you'll advance to the next level. Size: 890588 MD5Sum: 654afb1134ec9c55d0289bd92f4a2ce2 URL: /anagramarama_0.3-1.zip You can put everything in the !Webjames ‘site’ folder. The URL: then just needs to be ‘/filename’. |
Chris Johnson (125) 825 posts |
Thanks Chris (G) for confirming there is nothing else involved. |
Steve Fryatt (216) 2105 posts |
Are there any tools for generating source files automagically from a bunch of packages? There’s the Autobuilder stuff, which looked fairly specific to the Autobuilder; is there anything else? Also, is PackIt the only option for package generation (aside from the Autobuilder)? I’d want something that ran on Linux and could also sort out package version numbers for itself if pointed to the existing repository. I’m happy to do a bit of DIY, but it seems pointless reinventing the wheel if someone else has already sorted the problem out. |
Theo Markettos (89) 919 posts |
You can use the Autobuilder without autobuilding things. Basically you just make a package directory with the right file layout then call the add-riscpkg script to make the packaging information. Here’s the Sunfish package script (setvars), which just grabs existing zips and shuffles the files around. AB_PVERSION=2.05 AB_ROVERSION=2 UPSTREAM_ZIP=Sunfish_${AB_PVERSION} UPSTREAM_URL=http://www.riscpkg.org/arm/Sunfish/${UPSTREAM_ZIP} PATCH_ZIP=sunfish.zip PATCH_URL=http://www.cgransden.co.uk/${PATCH_ZIP} # don't build anything AB_NOREMOTE=yes AB_PRECONF=":" AB_COMPILEFAIL=yes AB_INSTALL=no AB_CONFIG= AB_MAKE= AB_LICENCE=Non-free ab_make () { : } AB_CATEGORY=Library # $S build directory # $D top level of destination package directory # $H autobuilder directory for package # $A RISC OS application (after calling ab_create_app, etc) ab_package () { wget $UPSTREAM_URL mkdir -p $S/Sunfish $GCCSDK_UNZIP -d $S/Sunfish $UPSTREAM_ZIP wget $PATCH_URL mkdir -p $S/patch $GCCSDK_UNZIP -d $S/patch $PATCH_ZIP cp $S/patch/* $S/Sunfish/Apps/Disc/\!Sunfish/ sed -i "s/^Maintainer.*$/Maintainer: GCCSDK Developers \<gcc\@gccsdk\.riscos\.info\>/" $S/Sunfish/RiscPkg/Control,fff sed -i "s/^Version.*$/Version: $AB_PVERSION-$AB_ROVERSION/" $S/Sunfish/RiscPkg/Control,fff mv $S/Sunfish $D/ } As that’s amending an existing package it’s missing the usual last line in ab_package, which is (for example):
All that does is makes an appropriate Control file. Then the autobuilder zips everything up automatically. The whole lot is called via:
(optionally using -d to keep the build files around afterwards) Have a look at some of the other packages like RaspberryPi-* or DrWimp for more examples. Most of the time you can fill in the fields in the setvars file (AB_LICENCE, AB_CATEGORY etc), and just give a RiscPkg/Copyright file and a RiscPkg/Control file which only contains the description lines, and the autobuilder will construct the rest of the package for you. It includes filetype-friendly zip and unzip tools so you can handle RISC OS zips on Linux. Version numbering is taken care of by setting AB_PVERSION=(upstream version number) and AB_ROVERSION=(package revision number). The autobuilder/build-website and autobuilder/build-index scripts will also build the package indexes from a directory of packages, to put on a website. The ROOL package repository uses these – just drop a new package in and run autobuilder/build-index to rebuild the index and website. |
Chris Johnson (125) 825 posts |
For any others who are thinking of using !Packit to package up their own stuff natively on RISC OS, I found !Packit worked very well last night on a couple of my apps. Not fully tested whether the packages will install via Packman yet, but looking at the packages produced, everything seems to be there. If you are thinking of packaging for your own stuff, I say go for it! |
Alan Buckley (167) 232 posts |
To test packages with PackMan you can just drag the package you have created to the PackMan iconbar icon. It will then appear as any other application in the main window where you can install it as normal. The packages are just zip files that are laid out with a particular format and include some extra text files with controlling information. You can create these in Linux or RISC OS without using any special software (except of course, the autobuilder zip program so it can set the filetypes for RISC OS). For instance the autobuilder just creates all the files in a temporary directory and then zips it up to make a package. Although PackIt does have some limitations as it has been designed to create simple binary packages easily, I frequently use it as a starting point for more complicated packages as you can just extract the files from the package it creates using SparkPlug or InfoZip or the like and then modify them by hand. |