improve FreeBSD and orb packaging

This commit is contained in:
Robur 2021-06-24 10:46:27 +00:00
parent bde3baec46
commit 987230c15f
2 changed files with 9 additions and 8 deletions

View file

@ -13,10 +13,6 @@ build: [
["sh" "packaging/FreeBSD/create_package.sh"] {os = "freebsd"} ["sh" "packaging/FreeBSD/create_package.sh"] {os = "freebsd"}
] ]
install: [
["cp" "builder_web.txz" "%{bin}%/"] {os = "freebsd"}
]
depends: [ depends: [
"builder" "builder"
"dream" "dream"

View file

@ -1,5 +1,12 @@
#!/bin/sh -e #!/bin/sh -e
# only execute anything if either
# - running under orb with package = builder
# - not running under opam at all
if [ "$ORB_BUILDING_PACKAGE" != "builder-web" -a "$OPAM_PACKAGE_NAME" != "" ]; then
exit 0;
fi
basedir=$(realpath "$(dirname "$0")"/../..) basedir=$(realpath "$(dirname "$0")"/../..)
pdir=$basedir/packaging/FreeBSD pdir=$basedir/packaging/FreeBSD
bdir=$basedir/_build/install/default/bin bdir=$basedir/_build/install/default/bin
@ -14,9 +21,7 @@ libexecdir=$rootdir/usr/local/libexec
trap 'rm -rf $tmpd' 0 INT EXIT trap 'rm -rf $tmpd' 0 INT EXIT
mkdir -p "$rootdir"/usr/local/sbin \ mkdir -p "$sbindir" "$libexecdir" "$rcdir"
"$rootdir"/usr/local/libexec \
"$rootdir"/usr/local/etc/rc.d
# stage service scripts # stage service scripts
install -U $pdir/rc.d/builder_web $rcdir/builder_web install -U $pdir/rc.d/builder_web $rcdir/builder_web
@ -45,4 +50,4 @@ sed -e "s:%%FLATSIZE%%:${flatsize}:" "$pdir/MANIFEST" > "$manifest"
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct) export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct)
pkg create -r "$rootdir" -M "$manifest" -o $basedir/ pkg create -r "$rootdir" -M "$manifest" -o $basedir/
mv $basedir/builder_web-*.txz $basedir/builder_web.txz mv $basedir/builder_web-*.txz $basedir/builder_web.txz
rm $basedir/builder-web.install echo 'bin: [ "builder_web.txz" ]' > builder-web.install