|
@@ -35,7 +35,11 @@ calc_installed_size() {
|
|
|
build_deb() {
|
|
build_deb() {
|
|
|
local pkg_name="$1" staging_dir="$2" arch="$3"
|
|
local pkg_name="$1" staging_dir="$2" arch="$3"
|
|
|
local installed_size; installed_size="$(calc_installed_size "$staging_dir")"
|
|
local installed_size; installed_size="$(calc_installed_size "$staging_dir")"
|
|
|
- sed -i -e "s/{{VERSION}}/${DEB_VERSION}/g" -e "s/{{INSTALLED_SIZE}}/${installed_size}/g" "$staging_dir/DEBIAN/control"
|
|
|
|
|
|
|
+ # {{VERSION}} is the full deb version (upstream-revision); {{UPSTREAM_VERSION}}
|
|
|
|
|
+ # omits the revision, for inter-package deps that track the API version rather
|
|
|
|
|
+ # than the packaging revision (lets the webui ship without bumping the server).
|
|
|
|
|
+ sed -i -e "s/{{VERSION}}/${DEB_VERSION}/g" -e "s/{{UPSTREAM_VERSION}}/${VERSION}/g" \
|
|
|
|
|
+ -e "s/{{INSTALLED_SIZE}}/${installed_size}/g" "$staging_dir/DEBIAN/control"
|
|
|
find "$staging_dir" -type d -exec chmod 0755 {} +
|
|
find "$staging_dir" -type d -exec chmod 0755 {} +
|
|
|
find "$staging_dir/DEBIAN" -type f -exec chmod 0644 {} +
|
|
find "$staging_dir/DEBIAN" -type f -exec chmod 0644 {} +
|
|
|
for f in postinst prerm postrm preinst; do
|
|
for f in postinst prerm postrm preinst; do
|
|
@@ -47,6 +51,14 @@ build_deb() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# ---- Package 1: smartbotic-vectorapi (server) ----
|
|
# ---- Package 1: smartbotic-vectorapi (server) ----
|
|
|
|
|
+# SKIP_SERVER_DEB=1 builds only the arch:all webui package. Use when shipping a
|
|
|
|
|
+# webui-only change to a host whose server must not move (e.g. one pinned to an
|
|
|
|
|
+# older libsmartbotic-db-client — rebuilding the server against a newer client
|
|
|
|
|
+# would force that ABI upgrade).
|
|
|
|
|
+PKG1=""
|
|
|
|
|
+if [ "${SKIP_SERVER_DEB:-0}" = "1" ]; then
|
|
|
|
|
+ echo "--- smartbotic-vectorapi: SKIPPED (SKIP_SERVER_DEB=1) ---"
|
|
|
|
|
+else
|
|
|
echo "--- smartbotic-vectorapi ---"
|
|
echo "--- smartbotic-vectorapi ---"
|
|
|
PKG1="$(mktemp -d)"; trap 'rm -rf "$PKG1"' EXIT
|
|
PKG1="$(mktemp -d)"; trap 'rm -rf "$PKG1"' EXIT
|
|
|
mkdir -p "$PKG1/DEBIAN" "$PKG1/usr/bin" "$PKG1/etc/smartbotic-vectorapi" \
|
|
mkdir -p "$PKG1/DEBIAN" "$PKG1/usr/bin" "$PKG1/etc/smartbotic-vectorapi" \
|
|
@@ -66,6 +78,7 @@ cp "$SCRIPTS_DIR/server.prerm" "$PKG1/DEBIAN/prerm"
|
|
|
cp "$SCRIPTS_DIR/server.postrm" "$PKG1/DEBIAN/postrm"
|
|
cp "$SCRIPTS_DIR/server.postrm" "$PKG1/DEBIAN/postrm"
|
|
|
printf '/etc/smartbotic-vectorapi/config.json\n' > "$PKG1/DEBIAN/conffiles"
|
|
printf '/etc/smartbotic-vectorapi/config.json\n' > "$PKG1/DEBIAN/conffiles"
|
|
|
build_deb "smartbotic-vectorapi" "$PKG1" "amd64"
|
|
build_deb "smartbotic-vectorapi" "$PKG1" "amd64"
|
|
|
|
|
+fi
|
|
|
|
|
|
|
|
# ---- Package 2: smartbotic-vectorapi-webui (static assets) ----
|
|
# ---- Package 2: smartbotic-vectorapi-webui (static assets) ----
|
|
|
echo "--- smartbotic-vectorapi-webui ---"
|
|
echo "--- smartbotic-vectorapi-webui ---"
|