From 6e925700f5ecb8048e1b473412d290262b8c1af1 Mon Sep 17 00:00:00 2001 From: Stefan Grundmann Date: Sat, 6 Oct 2018 23:34:47 +0000 Subject: [PATCH] FreeBSD package creation --- packaging/MANIFEST | 83 +++++++++++++++++++++++++++++++++++++ packaging/create_package.sh | 54 ++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 packaging/MANIFEST create mode 100755 packaging/create_package.sh diff --git a/packaging/MANIFEST b/packaging/MANIFEST new file mode 100644 index 0000000..f15ccac --- /dev/null +++ b/packaging/MANIFEST @@ -0,0 +1,83 @@ +name: albatross +version: 1.0.%%GITVER%%_1 +origin: local/albatross +comment: Albatross: Managing virtual machines +www: https://github.com/hannesm/vmm +maintainer: Hannes Mehnert +prefix: /usr/local +licenselogic: single +licenses: [NONE] +flatsize: %%FLATSIZE%% +categories: [local] +deps { + gmp { + origin = "math/gmp"; + version = "6.1.2"; + } +} +scripts : { + pre-install = < Creating groups." +if ! ${PW} groupshow albatross >/dev/null 2>&1; then + echo "Creating group 'albatross' with gid '496'." + ${PW} groupadd albatross -g 496 +else + echo "Using existing group 'albatross'." +fi +echo "===> Creating users" +if ! ${PW} usershow albatross >/dev/null 2>&1; then + echo "Creating user 'albatross' with uid '496'." + ${PW} useradd albatross -u 496 -g 496 -c "albatross daemon" -d /nonexistent -s /usr/sbin/nologin +else + echo "Using existing user 'albatross'." +fi +EOD; + post-install = </dev/null 2>&1; then + echo "==> You should manually remove the \"albatross\" user. " +fi +if ${PW} groupshow albatross >/dev/null 2>&1; then + echo "==> You should manually remove the \"albatross\" group " +fi +EOD; + +} +desc = < "$manifest" + +{ + printf '\nfiles {\n' + find "$rootdir" -type f -exec sha256 -r {} + | + awk '{print " " $2 ": \"" $1 "\"," }' + find "$rootdir" -type l | + awk "{print \" \"\$1 \": -,\"}" + printf '}\n' +} | sed -e "s:${rootdir}::" >> "$manifest" + +pkg create -r "$rootdir" -M "$manifest" -o $basedir/_build/