summaryrefslogtreecommitdiff
path: root/package.sh
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-01-04 01:17:50 +0000
committerJay Freeman <saurik@saurik.com>2008-01-04 01:17:50 +0000
commit03880b546d794abafd6dab3eed876dbefe06c174 (patch)
tree42ef9d2fb26b6321a7bda2f8eecb0009471bb3c2 /package.sh
parent8f3b67fe1123828377d340922a1aca2d4c4c1989 (diff)
Revision numbers on packages now being bumped, moved files around in Apple packages to the correct folders (adjusting for conflicts), added numerous Java packages, and fixed dependencies on findutils, coreutils, inetutils, and gnupg.
git-svn-id: http://svn.telesphoreo.org/trunk@11 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'package.sh')
-rwxr-xr-xpackage.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/package.sh b/package.sh
index 6781b1538..74c838e16 100755
--- a/package.sh
+++ b/package.sh
@@ -2,6 +2,11 @@
set -e
shopt -s extglob nullglob
+if [[ $# == 0 ]]; then
+ echo "usage: $0 <package>"
+ exit
+fi
+
export PKG_MAKE=$0
export PKG_NAME=${1%_}
@@ -12,5 +17,29 @@ export PKG_BASE=$(realpath "$(dirname "$0")")
pkg: mkdir -p /DEBIAN
./control.sh "${PKG_NAME}" control >"$(pkg_ /DEBIAN/control)"
-dpkg-deb -b "${PKG_DEST}" "${PKG_PACK}"
+
+export PKG_HASH=$(util/catdir.sh "${PKG_DEST}" | md5sum | cut -d ' ' -f 1)
+echo "hashed dest ${PKG_NAME} to: ${PKG_HASH}"
+
+if [[ -e "${PKG_STAT}/dest-md5" && ${PKG_HASH} == $(cat "${PKG_STAT}/dest-md5" 2>/dev/null) ]]; then
+ echo "skipping re-package of ${PKG_NAME}"
+else
+ export PKG_RVSN=$(cat "${PKG_STAT}/dest-ver")
+ if [[ -z ${PKG_RVSN} ]]; then
+ PKG_RVSN=1
+ else
+ PKG_RVSN=$((${PKG_RVSN} + 1))
+ fi
+
+ export PKG_PACK=${PKG_BASE}/debs/${PKG_NAME}_${PKG_VRSN}-${PKG_RVSN}_darwin-arm.deb
+ if [[ -e ${PKG_PACK} ]]; then
+ echo "package ${PKG_PACK} already exists..."
+ else
+ ./control.sh "${PKG_NAME}" control "${PKG_VRSN}-${PKG_RVSN}" >"$(pkg_ /DEBIAN/control)"
+ dpkg-deb -b "${PKG_DEST}" "${PKG_PACK}"
+ echo "${PKG_HASH}" >"${PKG_STAT}/dest-md5"
+ echo "${PKG_RVSN}" >"${PKG_STAT}/dest-ver"
+ fi
+fi
+
pkg: rm -rf /DEBIAN