diff options
| author | Harshavardhana <harsha@gluster.com> | 2010-07-23 17:38:26 +0000 |
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-16 03:38:37 -0700 |
| commit | b53bdce3ea4a73c6dd974f3d3e4d67d94a0b7186 (patch) | |
| tree | 3fcffcb3476d90072e9b457a9475e165408d9fb1 /extras/Solaris/make-gluster-pkg.sh | |
| parent | f5137bf755542f4ea28d4fce3c659c1b9ec38647 (diff) | |
Add Solaris Packaging manifest
* script to build the package
* init script for starting glusterfs server
* pkginfo manifest and updated copyright.
* options file which is read to take additional arguments to glusterfs server.
Signed-off-by: Harshavardhana <harsha@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1212 (Add solaris building manifest)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1212
Diffstat (limited to 'extras/Solaris/make-gluster-pkg.sh')
| -rwxr-xr-x | extras/Solaris/make-gluster-pkg.sh | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/extras/Solaris/make-gluster-pkg.sh b/extras/Solaris/make-gluster-pkg.sh new file mode 100755 index 000000000..0d52b2dda --- /dev/null +++ b/extras/Solaris/make-gluster-pkg.sh @@ -0,0 +1,107 @@ +#!/usr/bin/bash +# +# Copyright (C) 2010 Gluster Inc. +# +# script to build GlusterFS Packages for Solaris +# + +export PATH=/opt/csw/bin:/opt/csw/gcc4/bin:/usr/ccs/bin:/usr/ucb:/usr/sfw/bin:$PATH + +INSTALL_BASE=/opt/glusterfs + +VERSION=3.0.5 +SBINPROS="glusterfsd glusterfs" +BINPROGS="glusterfs-volgen" +##################################################################### +## BEGIN MAIN +##################################################################### + +TMPINSTALLDIR=/tmp/build + +# Try to guess the distribution base.. +CURR_DIR=`pwd` +echo "Assuming GlusterFS distribution is rooted at $CURR_DIR .." + +## +## first build the source +## + +WGET=`which wget` +$WGET http://ftp.gluster.com/pub/gluster/glusterfs/3.0/$VERSION/glusterfs-$VERSION.tar.gz + +tar xf glusterfs-$VERSION.tar.gz +mv glusterfs-$VERSION source + +if [ "x$1" != "xnobuild" ]; then + + ./configure.sh + + if [ $? -ne 0 ]; then + echo "Build failed! Exiting...." + exit 1 + fi +fi + +cd $CURR_DIR/source +make DESTDIR=$TMPINSTALLDIR install + +cd $CURR_DIR +## +## Now set the install locations +## +SBINDIR=/opt/glusterfs/sbin +BINDIR=/opt/glusterfs/bin +CONFIGDIR=/opt/glusterfs/etc/glusterfs +## +## Main driver +## +## copy over some scripts need for packagaing +## +mkdir -p $TMPINSTALLDIR/etc/init.d + cp -fp glusterfsd $TMPINSTALLDIR/etc/init.d +mkdir -p $TMPINSTALLDIR/etc/rc3.d + cp -fp glusterfsd $TMPINSTALLDIR/etc/rc3.d/S52glusterfsd +mkdir -p $CONFIGDIR + cp -fp options $TMPINSTALLDIR$CONFIGDIR + +## +## Start building the prototype file +## +cp pkginfo.master pkginfo + +echo "SBINDIR=$SBINDIR" >> pkginfo +echo "BINDIR=$BINDIR" >> pkginfo +echo "CONFIGDIR=$CONFIGDIR" >> pkginfo + +## +## copy packaging files +## +for i in pkginfo copyright preremove postinstall request checkinstall; do + cp $i / +done + + +cd / +(echo 'i pkginfo'; echo 'i copyright'; echo 'i preremove'; echo 'i postinstall'; echo 'i request'; pkgproto /$TMPINSTALLDIR=/ ) >prototype + +GREP=`which ggrep` +$GREP -w '/' /prototype -v > /prototype.new + +mv /prototype.new /prototype + +# Create the package +pkgmk -o -d /tmp -f prototype + +if [ $? = 0 ]; then + pkgtrans /tmp glusterfs_${VERSION}_i386.pkg glusterfs +fi + +echo "Cleaning up build files" + +rm -rf $TMPINSTALLDIR + +for i in pkginfo copyright preremove postinstall request checkinstall; do + rm /$i +done + +echo The GlusterFS package is in /tmp |
