OpenPKG: Binary software stacks made easy

2007-10-27 by Thomas Lotterer

You may know that OpenPKG makes it easy to create a custom software stack for any Unix from source. The included tools also allow easy reuse of the binaries created during the build process, enabling users to run setups using one build host for each platform, then distributing the binaries across a large number of compatible machines.

The approach is to download the sources and build binaries as usual. Use the “openpkg build” command to resolve the build and install dependencies. Keeping private copies of the sources and binaries allows reproducible recreation of the setup. By creating an index file and publishing it together with the source and binary packages allows remote “openpkg build” commands to reduce to a pure installer.

Please note that publishing binaries may have to be limited to closed user groups because of redistribution licensing limitations – this is off topic here, but you may hunt the Internet for problems binary distributions like Debian GNU/Linux are faced with when they attempt to ship a mix of GPL and MIT+Ad components like Nessus or Aqbanking linked against OpenSSL. True source distributions like OpenPKG do not suffer from those limitations.

In order to use the -C option to “openpkg index” the instance is required to have perl module DB_File, which comes with the perl-db package, installed. Indexing is a time consuming effort and caching removes the need to index an unchanged RPM over and over again. If you leverage the “multiple instance” feature of OpenPKG only the instance running “openpkg index” requires Perl and the perl-db package.

Build Host. It is imperative to keep the sources along with the binaries. Due to a conceptual RPM limitation the entwinded build and install dependencies are split across both kinds of packages. The index consolidates both informations so both must be available while building the index.

# su - openpkg
$ openpkg build -kKbB -Ua | sh
$ (   cd ~/RPM/PKG \
   && openpkg index \
      -r `~/lib/openpkg/shtool echo -e '%h%d:'$HOME` \
      -p `openpkg rpm --eval '%{l_platform}'` \
      -C 01INDEX.cache -o 00INDEX.rdf -i . )

Publish the ~openpkg/RPM/PKG folder with you favorite HTTP, HTTPS or FTP server.

Binary compatible machine.

# su - openpkg
$ openpkg build -r http://buildhost.example.com/openpkg/RPM/PKG/ \
                -p `openpkg rpm --eval '%{l_platform}'` \
                -Ua | sh

Leave a Reply