diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-10-12 20:30:52 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-10-12 20:30:52 +0000 |
commit | 8b5ba1c39acd9bdf64c55a1407021111969a4289 (patch) | |
tree | 70d01b6f6b8000a3310692331957840684a8ac29 /contrib/solaris/buildpkg.sh | |
parent | 4a820ea750ce79be709ca8c4b11edf39e07b2676 (diff) |
- (bal) First wave of contrib/solaris/ package upgrades. Still more
work needs to be done, but it is a 190% better then the stuff we
had before!
Diffstat (limited to 'contrib/solaris/buildpkg.sh')
-rwxr-xr-x | contrib/solaris/buildpkg.sh | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/contrib/solaris/buildpkg.sh b/contrib/solaris/buildpkg.sh new file mode 100755 index 000000000..a71417075 --- /dev/null +++ b/contrib/solaris/buildpkg.sh | |||
@@ -0,0 +1,82 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Fake Root Solaris Build System - Prototype | ||
4 | # | ||
5 | # The following code has been provide under Public Domain License. I really | ||
6 | # don't care what you use it for. Just as long as you don't complain to me | ||
7 | # nor my employer if you break it. - Ben Lindstrom (mouring@eviladmin.org) | ||
8 | # | ||
9 | umask 022 | ||
10 | PKGNAME=OpenSSH | ||
11 | |||
12 | ## Extract common info requires for the 'info' part of the package. | ||
13 | VERSION=`tail -1 ../../version.h | sed -e 's/.*_\([0-9]\)/\1/g' | sed 's/\"$//'` | ||
14 | ARCH=`uname -p` | ||
15 | |||
16 | ## Start by faking root install | ||
17 | echo "Faking root install..." | ||
18 | START=`pwd` | ||
19 | FAKE_ROOT=$START/package | ||
20 | mkdir $FAKE_ROOT | ||
21 | cd ../.. | ||
22 | make install-nokeys DESTDIR=$FAKE_ROOT | ||
23 | |||
24 | ## Fill in some details, like prefix and sysconfdir | ||
25 | ETCDIR=`grep "^sysconfdir=" Makefile | sed 's/sysconfdir=//'` | ||
26 | PREFIX=`grep "^prefix=" Makefile | cut -d = -f 2` | ||
27 | cd $FAKE_ROOT | ||
28 | |||
29 | ## Setup our run level stuff while we are at it. | ||
30 | mkdir -p $FAKE_ROOT/etc/init.d | ||
31 | mkdir -p $FAKE_ROOT/etc/rcS.d | ||
32 | mkdir -p $FAKE_ROOT/etc/rc0.d | ||
33 | mkdir -p $FAKE_ROOT/etc/rc1.d | ||
34 | mkdir -p $FAKE_ROOT/etc/rc2.d | ||
35 | |||
36 | |||
37 | ## setup our initscript correctly | ||
38 | sed -e "s#%%configDir%%#$ETCDIR#g" \ | ||
39 | -e "s#%%openSSHDir%%#$PREFIX#g" \ | ||
40 | ../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd | ||
41 | chmod 711 $FAKE_ROOT/etc/init.d/opensshd | ||
42 | |||
43 | ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd | ||
44 | ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd | ||
45 | ln -s $FAKE_ROOT/etc/init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd | ||
46 | |||
47 | |||
48 | ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk | ||
49 | ## whining. | ||
50 | for i in *; do | ||
51 | PROTO_ARGS="$PROTO_ARGS $i=/$i"; | ||
52 | done | ||
53 | |||
54 | ## Build info file | ||
55 | echo "Building pkginfo file..." | ||
56 | cat > pkginfo << _EOF | ||
57 | PKG=$PKGNAME | ||
58 | NAME=OpenSSH Portable for Solaris | ||
59 | DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh." | ||
60 | VENDOR="OpenSSH Portable Team - http://www.openssh.com/portable.html" | ||
61 | BASEDIR=$FAKE_ROOT | ||
62 | ARCH=$ARCH | ||
63 | VERSION=$VERSION | ||
64 | CATEGORY=Security | ||
65 | BASEDIR=/ | ||
66 | _EOF | ||
67 | |||
68 | ## Next Build our prototype | ||
69 | echo "Building prototype file..." | ||
70 | find . | egrep -v "prototype|pkginfo" | sort | pkgproto $PROTO_ARGS | \ | ||
71 | awk ' | ||
72 | BEGIN { print "i pkginfo" } | ||
73 | { $5="root"; $6="sys"; } | ||
74 | { print; }' > prototype | ||
75 | |||
76 | ## Step back a directory and now build the package. | ||
77 | echo "Building package.." | ||
78 | cd .. | ||
79 | pkgmk -d . -f $FAKE_ROOT/prototype -o | ||
80 | rm -rf $FAKE_ROOT | ||
81 | echo | pkgtrans -os . $PKGNAME-$ARCH-$VERSION.pkg | ||
82 | rm -rf $PKGNAME | ||