aboutsummaryrefslogtreecommitdiff
path: root/pkg/vocl/mkdist
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/vocl/mkdist
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/vocl/mkdist')
-rwxr-xr-xpkg/vocl/mkdist87
1 files changed, 87 insertions, 0 deletions
diff --git a/pkg/vocl/mkdist b/pkg/vocl/mkdist
new file mode 100755
index 00000000..65f92be6
--- /dev/null
+++ b/pkg/vocl/mkdist
@@ -0,0 +1,87 @@
+#!/bin/csh -f
+#
+# Build the VOCL self-installer distribution
+#
+###############################################################################
+
+
+if ((! $?iraf) || (! $?IRAFARCH)) then
+ echo -n "ERROR: "
+ echo "Must define 'iraf' and 'IRAFARCH' before building!!"
+ echo "Quitting."
+ exit 1
+endif
+
+
+# Process command line arguments.
+set exec = yes
+set src_only = no
+
+while ("$1" != "")
+ switch ("$1")
+ case -n: # no execute
+ set exec = no
+ breaksw
+ case -src: # source-only distribution
+ set src_only = yes
+ breaksw
+ default:
+ echo "mkdist: unknown argument $1"
+ breaksw
+ endsw
+
+ if ("$2" == "") then
+ break
+ else
+ shift
+ endif
+end
+
+
+# Do it.
+echo "Removing old binaries ...."
+ if ($exec == "yes" && $src_only == "no") then
+ rmbin .
+ endif
+
+echo "Rebuilding VOCL ...."
+ if ($exec == "yes" && $src_only == "no") then
+ mkpkg relink
+ endif
+
+
+echo "Creating VOCL distribution...."
+ if ($exec == "yes") then
+
+ # Exclude other distribution files and platform-specific libs
+ # tarball.
+ if ($src_only == "yes") then
+ /bin/ls -1 vocl_install_* *.[aeo] */*.[aeo] > /tmp/_ex$$
+ else
+ /bin/ls -1 vocl_install_* lib*.a */*.[aeo] > /tmp/_ex$$
+ endif
+
+ # Create a tar of the source and binary
+ if ($IRAFARCH == "ssun" || $IRAFARCH == "sparc") then
+ tar -cfX - /tmp/_ex$$ . | gzip > /tmp/_tar$$
+ else
+ tar -cf - -X /tmp/_ex$$ . | gzip > /tmp/_tar$$
+ endif
+
+ # Encode the tarball and build the installer itself.
+ uuencode /tmp/_tar$$ vocl_tar.gz > /tmp/_uu$$
+ if ($src_only == "yes") then
+ cat vocl_install.csh /tmp/_uu$$ | sed -e 's/VERSION_DATE/`date`/' \
+ > vocl_install_src.csh
+ chmod 777 vocl_install_src.csh
+ else
+ cat vocl_install.csh /tmp/_uu$$ | sed -e 's/VERSION_DATE/`date`/' \
+ > vocl_install_${IRAFARCH}.csh
+ chmod 777 vocl_install_${IRAFARCH}.csh
+ endif
+
+ # Clean up.
+ /bin/rm -f /tmp/_tar$$ /tmp/_uu$$ /tmp/_ex$$
+ endif
+
+echo "Done."