Commit 5423cd08 authored by Heinz N. Gies's avatar Heinz N. Gies

Add package generation

parent ab658ce8
dist:
cargo build --release
$(MAKE) -C rel/pkgng
......@@ -58,7 +58,7 @@ Some of the steps above require a reboot, there is however no reason not just do
## installation
1. Install rust (https://rustup.rs/) and cargo: `pkg install rust cargo`
1. Install rust (https://rustup.rs/) and cargo: `pkg install rust cargo pkgconf openssl`
2. Clone this repository using Git or download it as a Zip archive
3. Build the vmadm binary: `cargo build --release`
4. Copy the executable: `cp target/release/vmadm /usr/local/sbin`
......
VERSION=0.2.0
COMPONENT_INTERNAL=rvmadm
COMPONENT=vmadm
name: chunter
version: "__VNS__"
origin: projectfifo/chunter
comment: "fifo hypervisor agent"
desc: "fifo hypervisor agent"
maintainer: info@project-fifo.net
www: https://project-fifo.net
prefix: /
#!/bin/sh
CONFFILE="/usr/local/etc/vmadm.toml"
if [ ! -f $CONFFILE ]
then
echo "Creating new configuration from example file."
cat <<EOF > $CONFFILE
pool = "zroot/jails"
[networks]
admin = "bridge0"
EOF
else
echo "Please make sure you update your config according to the update manual!"
fi
INSTALL_DIR=usr/local/sbin
DEPS="openssl"
REBARPROFILE ?= default
include ../../config.mk
include pkgng.mk
.PHONY: prepare
prepare:
-rm -r $(STAGE_DIR)
mkdir -p $(STAGE_DIR)/$(INSTALL_DIR)
mkdir -p $(STAGE_DIR)/usr/local/etc
mkdir -p $(STAGE_DIR)/usr/local/vmadm
mkdir -p $(STAGE_DIR)/var/imgadm/images
cp -r ../../target/release/vmadm $(STAGE_DIR)/$(INSTALL_DIR)
TARGET_DIR ?=/usr/local/lib
RC_DIR ?=/usr/local/etc/rc.d
FILE ?=$(COMPONENT)-$(VERSION)$(SUFFIX)
BLOCK_SIZE ?=65536
STAGE_DIR ?=deploy
TMP_DIR ?=tmp
PKG_CATEGORY ?=fifo
PKG_HOMEPAGE ?=https://project-fifo.net
.PHONY: package_list dep_list clean-pkg
package: prepare $(STAGE_DIR)/+MANIFEST $(STAGE_DIR)/plist
cp +POST_INSTALL $(STAGE_DIR)/
pkg create -m $(STAGE_DIR)/ -r $(STAGE_DIR)/ -p $(STAGE_DIR)/plist -o .
$(STAGE_DIR)/plist:
-rm $(STAGE_DIR)/plist || true
(cd $(STAGE_DIR); find * -type f | sort | grep -v '^+' | grep -v '^plist$$') >> $(STAGE_DIR)/plist
clean-pkg:
$(STAGE_DIR)/+MANIFEST: +MANIFEST.in
sed -e 's/__VNS__/${VERSION}/' +MANIFEST.in > $(STAGE_DIR)/+MANIFEST
( echo 'deps: { '; \
for dep in ${DEPS}; do \
pkg query --glob " \"%n\" : { \"origin\" : \"%o\", \"version\" : \"%v\" }," "$$dep"; \
done ; \
echo '}' ) >> $(STAGE_DIR)/+MANIFEST
tmp/$(FILE).tgz: dep_list package_list +MANIFEST
-rm -r tmp
mkdir tmp
pkg_create -i install.sh -k deinstall.sh -D displayfile -B build-info -c comment -d description -f packlist -I $(TARGET_DIR) -p $(STAGE_DIR) -U tmp/$(FILE).tgz
clean: clean-pkg
-rm -r tmp build-info packlist
-rm -r $(STAGE_DIR)
-rm *.tgz
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment