File: mksolpkg

package info (click to toggle)
iverilog 12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,148 kB
  • sloc: cpp: 109,972; ansic: 62,713; yacc: 10,216; sh: 3,470; vhdl: 3,246; perl: 1,814; makefile: 1,774; python: 78; csh: 2
file content (47 lines) | stat: -rwxr-xr-x 1,066 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# mksolpkg
#  a script to generate a native solaris package
#


if [ `whoami` != "root" ]; then
  echo "you must be root to run this script"
  exit 1
fi

# an ugly hack to get various bits of info
ver=`grep VERSION pkginfo | sed 's/"/ /g' | awk '{print $2}'`
basedir=`grep BASEDIR pkginfo | sed 's/"/ /g' | awk '{print $2}'`
name=`grep NAME pkginfo | sed 's/"/ /g' | awk '{print $2}'`
pkg=`grep PKG pkginfo | sed 's/"/ /g' | awk '{print $2}'`
arch=`grep ARCH pkginfo | sed 's/"/ /g' | awk '{print $2}'`
march=`uname -p`


if [ "$arch" != "$march" ]; then
  echo "Warning:  you have listed \"$arch\" in the pkginfo file but this machine"
  echo "          has a \"$march\" processor"
  exit 1
fi

oslabel=`uname -s`-`uname -r`-$march
fname=$name-$ver-$oslabel

cp -f prototype $basedir
cp -f pkginfo  $basedir
cd $basedir

pkgmk -o -r  `pwd`

cd /var/spool/pkg
pkgtrans -s `pwd` /tmp/$fname all
cd /tmp
gzip -f $fname

echo "Your $oslabel package is left in /tmp/$fname.gz"

# cleanup
rm -f $basedir/prototype $basedir/pkginfo
rm -fr /var/spool/pkg/$pkg