From jens.apel@web.de Thu Apr 18 10:26:53 2002
Return-Path: <jens.apel@web.de>
Received: from mailgate5.cinetic.de (mailgate5.cinetic.de [217.72.192.165])
	by mercure.iro.umontreal.ca (8.12.1/8.12.1) with ESMTP id g3IERCe4010046
	for <blais@iro.umontreal.ca>; Thu, 18 Apr 2002 10:27:13 -0400
Received: from web.de (fmomail02.dlan.cinetic.de [172.20.1.46])
	by mailgate5.cinetic.de (8.11.2/8.11.2/SuSE Linux 8.11.0-0.4) with SMTP id g3IEQqv11815
	for blais@iro.umontreal.ca; Thu, 18 Apr 2002 16:26:53 +0200
Date: Thu, 18 Apr 2002 16:26:53 +0200
Message-Id: <200204181426.g3IEQqv11815@mailgate5.cinetic.de>
MIME-Version: 1.0
Organization: http://freemail.web.de/
From: Jens Apel <jens.apel@web.de>
To: blais@IRO.UMontreal.CA
Subject: Solaris Package Build Script for xxdiff
Precedence: fm-user
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-SpamBouncer: 1.4 (8/24/01)
X-SBPass: NoBounce
X-SBClass: OK
X-UID: 2271

Hello Martin,
thanks for writing xxdiff - a real cool tool.
Since I wanted to use it under Solaris, I had to build 
Solaris Packages for my company. 
I wrote the following script to do that.
It would be nice, if you would put it into the next distribution.
I think it is useful for other people too.

Best regards,
Jens

---8< snipp-----------------------------------------

#!/bin/sh
# Shell script for building a Solaris package of xxdiff
# Written by <jens.apel@web.de>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# Prerequisites:
# 1. I have build Qt 2.3 statically and linked it
#    statically with xxdiff. This is not good, but it works...
#    Compiling Qt 2.3 under Solaris took me half a day...
# 2. Make sure libstdc++.so.2.10.0 is in your LD_LIBRARY_PATH
# 
# Building the Package:
# 1. copy this script to 
#    xxdiff-2.5/tools/build_pkg.sh
# 2. chmod u+x build_pkg.sh
# 3. Run it
#    cd tools
#    ./build_pkg.sh
#    This will create the package xxdiff-2.5-sol8-sparc-local.pkg
# 4. Install it
#    pkgadd -d xxdiff-2.5-sol8-sparc-local.pkg 
#    This will install the files
#    /usr/local/bin/xxdiff
#    /usr/local/man/man1/xxdiff.1
# 5. Use it
#    /usr/local/bin/xxdiff file1 file2
# 6. Have Fun !!


PKGNAME=xxdiff

## Extract common info requires for the 'info' part of the package.
VERSION=`grep "^XX_VERSION" ../src/xxdiff.pro | sed -e 's/.*=\([0-9.]\)/\1/g'`
ARCH=`uname -p`

## Start by faking root install 
echo "Faking root install..."
START=`pwd`
FAKE_ROOT=$START/xxdiff
mkdir $FAKE_ROOT


## Setup our run level stuff while we are at it.
mkdir -p $FAKE_ROOT/bin
mkdir -p $FAKE_ROOT/man/man1

# copy the binary and the man page to their places
cp ../src/xxdiff $FAKE_ROOT/bin
cp ../src/xxdiff.1 $FAKE_ROOT/man/man1

## Build info file
echo "Building pkginfo file..."
cat > $FAKE_ROOT/pkginfo << _EOF
PKG=$PKGNAME
NAME=xxdiff for Solaris
DESC="Graphical tool for comparing and merging files using Qt and diff"
VENDOR="Martin Blais <blais@iro.umontreal.ca"
BASEDIR=/usr/local
ARCH=$ARCH
VERSION=$VERSION
CATEGORY=application
CLASSES=none
_EOF

## Build copyright file
echo "Building copyright file..."
cat > $FAKE_ROOT/copyright << _EOF
Copyright (C) 1999-2002 Martin Blais <blais@iro.umontreal.ca>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

_EOF

## Build prototype file
cat > $FAKE_ROOT/prototype << _EOF
i copyright=copyright
i pkginfo=pkginfo
d none bin 0755 bin bin
d none man 0755 bin bin
d none man/man1 0755 bin bin
f none bin/xxdiff 0755 bin bin
f none man/man1/xxdiff.1 0644 bin bin
_EOF

## And now build the package.
OUTPUTFILE=$PKGNAME-$VERSION-sol8-$ARCH-local.pkg
echo "Building package.."
echo FAKE_ROOT = $FAKE_ROOT
cd $FAKE_ROOT 
pkgmk -d . -r . -f ./prototype -o
echo | pkgtrans -os . $OUTPUTFILE
mv $OUTPUTFILE ..
cd ..
rm -rf $FAKE_ROOT



________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13


