aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/svr4/mkpkg
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2000-07-26 03:39:11 +0000
committerGerald Combs <gerald@wireshark.org>2000-07-26 03:39:11 +0000
commit7baf3c17307c0ca5b3e959fb74a0ee7dfcd20654 (patch)
treec3f3444305330d11b4f59880422ee723a07b17af /packaging/svr4/mkpkg
parenteeade6de433bb8031fa7d7fdf0f7ecfa5806d54e (diff)
Switch Solaris package build naming to a more generic SVR4. Add RPM and SRPM
package build targets. Move ethereal.spec(.in) to packaging/rpm. The spec file is different from Henri's. We might want to switch to his for the sake of consistency. svn path=/trunk/; revision=2162
Diffstat (limited to 'packaging/svr4/mkpkg')
-rwxr-xr-xpackaging/svr4/mkpkg82
1 files changed, 82 insertions, 0 deletions
diff --git a/packaging/svr4/mkpkg b/packaging/svr4/mkpkg
new file mode 100755
index 0000000000..06e8a40540
--- /dev/null
+++ b/packaging/svr4/mkpkg
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# mkpkg - Builds a pkgadd-installable package from a listing of the contents in
+# a staging directory.
+#
+# This is a modified version of a script written by mark@metalab.unc.edu .
+# The original is at http://metalab.unc.edu/pub/packages/solaris/sparc/html/creating.solaris.packages.html .
+
+if [ "$1" != "" ] ; then
+ pkg=$1
+else
+ echo "Usage: " `basename $0` " <package name> [output file]"
+ exit 1
+fi
+
+if [ "$2" != "" ] ; then
+ pkgfile=$2
+else
+ pkgfile=$pkg
+fi
+
+if [ "$3" != "" ] ; then
+ prefix=$3
+else
+ prefix=/usr/local
+fi
+
+if [ "$4" != "" ] ; then
+ srcdir=$4
+else
+ srcdir=`basename $0`/../..
+fi
+
+# Initialize our variables
+prepdir=`dirname $0`
+prototype="$prepdir/Prototype"
+stagedir=$srcdir/${pkg}.stage
+
+# Create the Prototype file
+cat > $prototype <<Fin
+i pkginfo
+i checkinstall
+Fin
+if [ ! -d $stagedir ] ; then
+ echo "Whoops! Staging directory $stagedir doesn't exist. Bailing."
+ exit 1
+fi
+
+find $stagedir/$prefix -mindepth 1 -print | \
+ pkgproto $stagedir/$prefix=$prefix >> $prototype
+
+# Make the package installation directory
+pkgmk -o -r / -d /$srcdir -f $prototype
+echo "Setting file permissions in $stagedir tree to 644."
+find $stagedir -type f -print | xargs chmod a+r
+find $stagedir -type f -print | xargs chmod u+w
+echo "Setting directory permissions in $stagedir tree to 755."
+find $stagedir -type d -print | xargs chmod 755
+if [ -f $stagedir/install/preinstall ]; then
+ chmod 755 $stagedir/install/preinstall
+fi
+if [ -f $stagedir/install/postinstall ]; then
+ chmod 755 $stagedir/install/postinstall
+fi
+if [ -f $stagedir/install/preremove ]; then
+ chmod 755 $stagedir/install/preremove
+fi
+if [ -f $stagedir/install/postremove ]; then
+ chmod 755 $stagedir/install/postremove
+fi
+if [ -f $stagedir/install/request ]; then
+ chmod 755 $stagedir/install/request
+fi
+if [ -f $stagedir/install/checkinstall ]; then
+ chmod 755 $stagedir/install/checkinstall
+fi
+
+# Spool the install directory into its own self-contained file.
+pkgtrans -s $srcdir $pkgfile $pkg
+
+# echo "Compressing package file"
+# gzip -9 $srcdir/$pkgfile