3 # Fake Root Solaris Build System - Prototype
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)
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/\"$//'`
16 ## Start by faking root install
17 echo "Faking root install..."
19 FAKE_ROOT=$START/package
22 make install-nokeys DESTDIR=$FAKE_ROOT
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 PIDDIR=`grep "^piddir=" Makefile | cut -d = -f 2`
30 ## Setup our run level stuff while we are at it.
31 mkdir -p $FAKE_ROOT/etc/init.d
32 mkdir -p $FAKE_ROOT/etc/rcS.d
33 mkdir -p $FAKE_ROOT/etc/rc0.d
34 mkdir -p $FAKE_ROOT/etc/rc1.d
35 mkdir -p $FAKE_ROOT/etc/rc2.d
38 ## setup our initscript correctly
39 sed -e "s#%%configDir%%#$ETCDIR#g" \
40 -e "s#%%openSSHDir%%#$PREFIX#g" \
41 -e "s#%%pidDir%%#$PIDDIR#g" \
42 ../opensshd.in > $FAKE_ROOT/etc/init.d/opensshd
43 chmod 711 $FAKE_ROOT/etc/init.d/opensshd
45 ln -s ../init.d/opensshd $FAKE_ROOT/etc/rcS.d/K30opensshd
46 ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc0.d/K30opensshd
47 ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc1.d/K30opensshd
48 ln -s ../init.d/opensshd $FAKE_ROOT/etc/rc2.d/S98opensshd
51 ## Ok, this is outright wrong, but it will work. I'm tired of pkgmk
54 PROTO_ARGS="$PROTO_ARGS $i=/$i";
58 echo "Building pkginfo file..."
61 NAME=OpenSSH Portable for Solaris
62 DESC="Secure Shell remote access utility; replaces telnet and rlogin/rsh."
63 VENDOR="OpenSSH Portable Team - http://www.openssh.com/portable.html"
71 ## Next Build our prototype
72 echo "Building prototype file..."
73 find . | egrep -v "prototype|pkginfo" | sort | pkgproto $PROTO_ARGS | \
75 BEGIN { print "i pkginfo" }
76 { $5="root"; $6="sys"; }
77 { print; }' > prototype
79 ## Step back a directory and now build the package.
80 echo "Building package.."
82 pkgmk -d . -f $FAKE_ROOT/prototype -o
84 echo | pkgtrans -os . $PKGNAME-$ARCH-$VERSION.pkg