Avoid changing file_extra_cnt during deletion.
[rsync/rsync.git] / packaging / solaris / build_pkg.sh
CommitLineData
1ea15dbe
JT
1#!/bin/sh
2# Shell script for building Solaris package of rsync
3# Author: Jens Apel <jens.apel@web.de>
4# License: GPL
5#
6# BASEDIR is /usr/local and should be the same as the
7# --prefix parameter of configure
8#
9# this script should be copied under
10# packaging/solaris/5.8/build_pkg.sh
11
12# Definitions start here
13# you can edit this, if you like
14
15# The Package name under which rsync will b installed
16PKGNAME=SMBrsync
17
18# Extract common info requires for the 'info' part of the package.
19# This should be made generic and generated by the configure script
20# but for now it is hard coded
21BASEDIR=/usr/local
22VERSION="2.5.5"
23ARCH=`uname -p`
24NAME=rsync
25
26# Definitions end here
27# Please do not edit below this line or you know what you do.
28
29## Start by faking root install
30echo "Creating install directory (fake $BASEDIR)..."
31START=`pwd`
32FAKE_ROOT=$START/${PKGNAME}
33mkdir $FAKE_ROOT
34
35# copy the binary and the man page to their places
36mkdir $FAKE_ROOT/bin
37mkdir -p $FAKE_ROOT/doc/rsync
38mkdir -p $FAKE_ROOT/man/man1
39mkdir -p $FAKE_ROOT/man/man5
40
41cp ../../../rsync $FAKE_ROOT/bin/rsync
42cp ../../../rsync.1 $FAKE_ROOT/man/man1/rsync.1
43cp ../../../rsyncd.conf.5 $FAKE_ROOT/man/man5/rsyncd.conf.5
44cp ../../../README $FAKE_ROOT/doc/rsync/README
45cp ../../../COPYING $FAKE_ROOT/doc/rsync/COPYING
46cp ../../../tech_report.pdf $FAKE_ROOT/doc/rsync/tech_report.pdf
47cp ../../../COPYING $FAKE_ROOT/COPYING
48
49## Build info file
50echo "Building pkginfo file..."
51cat > $FAKE_ROOT/pkginfo << EOF_INFO
52PKG=$PKGNAME
53NAME=$NAME
54DESC="Program for efficient remote updates of files."
55VENDOR="Samba Team URL: http://samba.anu.edu.au/rsync/"
56BASEDIR=$BASEDIR
57ARCH=$ARCH
58VERSION=$VERSION
59CATEGORY=application
60CLASSES=none
61EOF_INFO
62
63## Build prototype file
64cat > $FAKE_ROOT/prototype << EOFPROTO
65i copyright=COPYING
66i pkginfo=pkginfo
67d none bin 0755 bin bin
68f none bin/rsync 0755 bin bin
69d none doc 0755 bin bin
70d none doc/$NAME 0755 bin bin
71f none doc/$NAME/README 0644 bin bin
72f none doc/$NAME/COPYING 0644 bin bin
73f none doc/$NAME/tech_report.pdf 0644 bin bin
74d none man 0755 bin bin
75d none man/man1 0755 bin bin
76f none man/man1/rsync.1 0644 bin bin
77d none man/man5 0755 bin bin
78f none man/man5/rsyncd.conf.5 0644 bin bin
79EOFPROTO
80
81## And now build the package.
82OUTPUTFILE=$PKGNAME-$VERSION-sol8-$ARCH-local.pkg
83echo "Building package.."
84echo FAKE_ROOT = $FAKE_ROOT
85cd $FAKE_ROOT
86pkgmk -d . -r . -f ./prototype -o
87pkgtrans -os . $OUTPUTFILE $PKGNAME
88
89mv $OUTPUTFILE ..
90cd ..
91
92# Comment this out if you want to see, which file structure has been created
93rm -rf $FAKE_ROOT
94