#!/bin/sh package=${1:-$ZPMPACKAGE} shift pkgver=${ZPMPACKAGEVER:-1.0} pkgrel=${ZPMPACKAGEREL:-1} pkgroot=/ # option for "multipackage" just to let the system know that's what you meant # option to take filenames from stdin # parse package, version, release from file if not given while getopts :f:v:r:d:a:u:l:p:b:P: opt; do case $opt in R) pkgroot="$OPTARG" ;; S) format=shell ;; f) pkgfile="$OPTARG" ;; v) pkgver="$OPTARG" ;; r) pkgrel="$OPTARG" ;; d) description="$OPTARG" ;; a) arch="$OPTARG" ;; u) url="$OPTARG" ;; l) licenses="$OPTARG" ;; p) packager="$OPTARG" ;; b) builddate="$OPTARG" ;; P) prefix="$OPTARG" ;; esac done set -e if [ -z "$pkgfile" ]; then pkgfile="$package-$pkgver-$pkgrel.zpm" fi appid=$(sqlite3 $pkgfile 'pragma application_id;' | ( echo obase = 16; cat - ) | bc) if [ "$appid" != "5A504442" ]; then echo $pkgfile does not appear to be a zpm package file exit 1 fi { sqlite3 $pkgfile <