Add solo5-tenders package (#2)

Solo5-tenders.0.7.3 is the same as solo5.0.7.3 with only the tenders and solo5-elftool. Solo5-tenders opam file conflicts with solo5 as they provide the same binaries. The OS packages are named solo5 and conflict with solo5-hvt.

Reviewed-on: https://git.robur.io/robur/unikernel-repo/pulls/2
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Co-committed-by: Reynir Björnsson <reynir@reynir.dk>
This commit is contained in:
Reynir Björnsson 2022-10-25 13:11:51 +00:00
parent 2279c41b62
commit e887cd761b
7 changed files with 194 additions and 0 deletions

View file

@ -0,0 +1,17 @@
name: solo5
version: 0.7.3
origin: local/solo5
comment: Solo5 tenders
www: https://github.com/Solo5/solo5
maintainer: Robur <team@robur.coop>
prefix: /usr/local
licenselogic: single
licenses: [ISC]
flatsize: %%FLATSIZE%%
categories: [local]
conflict: solo5-hvt
desc = <<EOD
Solo5 sandboxed execution environment (all tenders)
EOD;

View file

@ -0,0 +1,44 @@
#!/bin/sh -e
# only execute anything if either
# - running under orb with package = solo5-tenders
# - not running under opam at all
if [ "$ORB_BUILDING_PACKAGE" != "solo5-tenders" -a "$OPAM_PACKAGE_NAME" != "" ]; then
exit 0;
fi
basedir=$(realpath "$(dirname "$0")"/../..)
pdir=$basedir/packaging/FreeBSD
tmpd=$basedir/_build/stage
manifest=$tmpd/+MANIFEST
rootdir=$tmpd/rootdir
bindir=$rootdir/usr/local/bin
trap 'rm -rf $tmpd' 0 INT EXIT
mkdir -p "$bindir"
# stage app binaries
install -U $basedir/elftool/solo5-elftool $bindir/solo5-elftool
install -U $basedir/tenders/hvt/solo5-hvt $bindir/solo5-hvt
# create +MANIFEST
flatsize=$(find "$rootdir" -type f -exec stat -f %z {} + |
awk 'BEGIN {s=0} {s+=$1} END {print s}')
sed -e "s:%%FLATSIZE%%:${flatsize}:" -e "/^[Vv]ersion:/s/-/./g" "$pdir/MANIFEST" > "$manifest"
{
printf '\nfiles {\n'
find "$rootdir" -type f -exec sha256 -r {} + | sort |
awk '{print " " $2 ": \"" $1 "\"," }'
find "$rootdir" -type l | sort |
awk "{print \" \"\$1 \": -,\"}"
printf '}\n'
} | sed -e "s:${rootdir}::" >> "$manifest"
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct)
pkg create -r "$rootdir" -M "$manifest" -o $basedir/
mv $basedir/solo5-*.pkg $basedir/solo5.pkg
echo 'bin: [ "solo5.pkg" ]' > $basedir/solo5-tenders.install
echo 'doc: [ "README.md" ]' >> $basedir/solo5-tenders.install

View file

@ -0,0 +1,5 @@
solo5 (0.7.3) unstable; urgency=medium
* Initial release
-- Robur team <team@robur.coop>

View file

@ -0,0 +1,19 @@
Package: solo5
Version: 0.7.3
Section: unknown
Priority: optional
Maintainer: Robur Team <team@robur.coop>
Standards-Version: 4.4.1
Homepage: https://github.com/Solo5/solo5
Vcs-Browser: https://github.com/Solo5/solo5
Vcs-Git: https://github.com/Solo5/solo5.git
Conflicts: solo5-hvt
Architecture: all
Description: Solo5 sandboxed execution environment (all tenders)
Solo5 is a sandboxed execution environment primarily intended
for, but not limited to, running applications built using various
unikernels (a.k.a. library operating systems).
This package provides the Solo5 components needed to run MirageOS
unikernels on all targets, including the. The "hvt" target is
supported on 64-bit Linux, FreeBSD and OpenBSD systems with hardware
virtualization.

View file

@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: solo5
Upstream-Contact: Robur Team <team@robur.coop>
Source: https://github.com/solo5/solo5
Files: *
Copyright: "Dan Williams <djwillia@us.ibm.com>" "Martin Lucina <martin@lucina.net>" "Ricardo Koller <kollerr@us.ibm.com>"
License: ISC

View file

@ -0,0 +1,35 @@
#!/bin/sh -e
# only execute anything if either
# - running under orb with package = solo5-tenders
# - not running under opam at all
if [ "$ORB_BUILDING_PACKAGE" != "solo5-tenders" -a "$OPAM_PACKAGE_NAME" != "" ]; then
exit 0;
fi
basedir=$(realpath "$(dirname "$0")"/../..)
tmpd=$basedir/_build/stage
rootdir=$tmpd/rootdir
bindir=$rootdir/usr/bin
debiandir=$rootdir/DEBIAN
trap 'rm -rf $tmpd' 0 INT EXIT
mkdir -p "$bindir" "$debiandir"
# stage app binaries
install $basedir/elftool/solo5-elftool $bindir/solo5-elftool
install $basedir/tenders/hvt/solo5-hvt $bindir/solo5-hvt
install $basedir/tenders/spt/solo5-spt $bindir/solo5-spt
# install debian metadata
install -m 0644 $basedir/packaging/debian/control $debiandir/control
install -m 0644 $basedir/packaging/debian/changelog $debiandir/changelog
install -m 0644 $basedir/packaging/debian/copyright $debiandir/copyright
ARCH=$(dpkg-architecture -q DEB_TARGET_ARCH)
sed -i -e "s/^Architecture:.*/Architecture: ${ARCH}/" $debiandir/control
dpkg-deb --build $rootdir $basedir/solo5.deb
echo 'bin: [ "solo5.deb" ]' > $basedir/solo5-tenders.install
echo 'doc: [ "README.md" ]' >> $basedir/solo5-tenders.install

66
packages/solo5-tenders.0.7.3/opam vendored Normal file
View file

@ -0,0 +1,66 @@
opam-version: "2.0"
maintainer: "martin@lucina.net"
authors: [
"Dan Williams <djwillia@us.ibm.com>"
"Martin Lucina <martin@lucina.net>"
"Ricardo Koller <kollerr@us.ibm.com>"
]
homepage: "https://github.com/solo5/solo5"
bug-reports: "https://github.com/solo5/solo5/issues"
license: "ISC"
dev-repo: "git+https://github.com/solo5/solo5.git"
build: [
["./configure.sh" "--prefix=%{prefix}%" "--disable-toolchain"]
[make "V=1"]
["sh" "-ex" "packaging/FreeBSD/create_package.sh"] {os = "freebsd"}
["sh" "-ex" "packaging/debian/create_package.sh"] {os-family = "debian"}
]
# install: [make "V=1" "install"]
depends: [
"conf-pkg-config" {build & os = "linux"}
"conf-libseccomp" {build & os = "linux"}
]
depexts: [
["linux-headers"] {os-distribution = "alpine"}
["kernel-headers"] {os-distribution = "fedora"}
["kernel-headers"] {os-distribution = "rhel"}
["linux-libc-dev"] {os-family = "debian"}
]
conflicts: [
"ocaml-freestanding" {< "0.7.0"}
"solo5-bindings-hvt"
"solo5-bindings-spt"
"solo5-bindings-virtio"
"solo5-bindings-muen"
"solo5-bindings-genode"
"solo5-bindings-xen"
# XXX(reynir) we install the same binaries
"solo5"
]
available: [
(arch = "x86_64" | arch = "arm64" | arch = "ppc64") &
(os = "linux" | os = "freebsd" | os = "openbsd")
]
synopsis: "Solo5 sandboxed execution environment"
description: """
Solo5 is a sandboxed execution environment primarily intended
for, but not limited to, running applications built using various
unikernels (a.k.a. library operating systems).
This package provides the Solo5 components needed to run MirageOS
unikernels on the host system.
"""
url {
src:
"https://github.com/Solo5/solo5/releases/download/v0.7.3/solo5-v0.7.3.tar.gz"
checksum:
"sha512=cafc590923b7bb53f27d46255914af620e47f14ce772c2e03afb0badf3c89abe06e625db290a8ccfaf280320ad4e63cf4876106f5d1d8a7801b13ccb5c033f2d"
}
extra-files: [
["packaging/FreeBSD/MANIFEST" "sha512=321f26281126749bb7307c4375a56ebedf32fd4c9028f21c8e2b995c04bb6ac83fd0971f213f01d3442cfcfd353e6a2578c6e24501fd84868914a2fa2c7859c8"]
["packaging/FreeBSD/create_package.sh" "sha512=3c3c3b5d82fbd2651b9701f42a010c0a8a25f7b9dd0c134bc1f254a45d5d6b2589140f25af2a2ea87af2b5973a89e351d3a15e597026b850c110022f49a78f7d"]
["packaging/debian/changelog" "sha512=c99c931846f6066be06fb69b19914dd1385a445b0d6d976f04a95198301469bd8e2d33bcc997796d81dd21c8b49d15cfec604ec707cfd9e8663f4bc8f5c7c22b"]
["packaging/debian/control" "sha512=abb4458916e1e7574070c3ef243cfad58aabf600ef82a22585e55ad279c9f18753c94224bc34d55533e5069801d84c701996d572470ced9f8e9b9da25c484615"]
["packaging/debian/copyright" "sha512=722fe8f14e03d015dec7bced1b3cca619e0aee2d9e067e298281052956b24aa41ed95f9c1917205a37097261d5ae3707c8053bad8aea144f0220ff50c02b9625"]
["packaging/debian/create_package.sh" "sha512=383c4dde2ee85ad9357bcec3053a91326b9e091cd4cfb15c8c163af6c9d8b0759fcce21f9e7278b3444f7733886f468f59cec82322864f42b6ea7010e543bc3d"]
]