Add a simple script to create a distribution package
authorDave Page <dpage@developer.pgadmin.org>
Tue, 26 Aug 2008 22:16:54 +0000 (23:16 +0100)
committerDave Page <dpage@developer.pgadmin.org>
Tue, 26 Aug 2008 22:16:54 +0000 (23:16 +0100)
create-package.sh [new file with mode: 0755]

diff --git a/create-package.sh b/create-package.sh
new file mode 100755 (executable)
index 0000000..11336aa
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+VERSION=`grep '$APP_VERSION' global.php | awk -F'"' '{print $2}'`
+NAME=`grep '$APP_NAME' global.php | awk -F'"' '{print $2}'`
+
+if [ -e "$NAME-$VERSION" ]; then
+       echo "The directory "$NAME-$VERSION" already exists. Please remove it and try again."
+       exit 1
+fi
+
+mkdir "$NAME-$VERSION"
+mkdir "$NAME-$VERSION/css"
+mkdir "$NAME-$VERSION/images"
+mkdir "$NAME-$VERSION/iui"
+
+# Copy main program file
+cp LICENCE "$NAME-$VERSION"
+cp README "$NAME-$VERSION"
+cp config.php.in "$NAME-$VERSION"
+cp connections.php "$NAME-$VERSION"
+cp favicon.ico "$NAME-$VERSION"
+cp global.php "$NAME-$VERSION"
+cp gucs.php "$NAME-$VERSION"
+cp index.php "$NAME-$VERSION"
+cp info.php "$NAME-$VERSION"
+cp locks.php "$NAME-$VERSION"
+cp misc.php "$NAME-$VERSION"
+cp query.php "$NAME-$VERSION"
+cp results.php "$NAME-$VERSION"
+cp server.php "$NAME-$VERSION"
+cp transactions.php "$NAME-$VERSION"
+
+# Copy CSS extensions
+cp css/iui-ext.css "$NAME-$VERSION/css"
+
+# Copy images
+cp images/connections.png "$NAME-$VERSION/images"
+cp images/database.png "$NAME-$VERSION/images"
+cp images/edb.png "$NAME-$VERSION/images"
+cp images/enterprisedb.png "$NAME-$VERSION/images"
+cp images/gucs.png "$NAME-$VERSION/images"
+cp images/info.png "$NAME-$VERSION/images"
+cp images/locks.png "$NAME-$VERSION/images"
+cp images/pg.png "$NAME-$VERSION/images"
+cp images/query.png "$NAME-$VERSION/images"
+cp images/transactions.png "$NAME-$VERSION/images"
+
+# Copy iui
+cp iui/* "$NAME-$VERSION/iui"
+
+# Tar it all up 
+COPYFILE_DISABLE=true tar zcvf "$NAME-$VERSION.tar.gz" "$NAME-$VERSION"
+
+# Cleanup 
+rm -rf "$NAME-$VERSION"
+
+echo ""
+echo "Package ($NAME-$VERSION.tar.gz) created!"
+echo ""
+