]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/solaris/makepkg.sh
Finally... the 100% of bacula spanish !!! ;-)
[bacula/bacula] / bacula / platforms / solaris / makepkg.sh
1 #!/bin/bash
2 #
3 #
4
5 # make use of Studio 11 or 12 compiler
6 #
7 export CC=cc
8 export CXX=CC
9
10 INSTALL_BASE=/opt/bacula
11 SBIN_DIR=$INSTALL_BASE/sbin
12 MAN_DIR=$INSTALL_BASE/man
13 SYSCONF_DIR=$INSTALL_BASE/etc
14 SCRIPT_DIR=$INSTALL_BASE/etc
15 WORKING_DIR=/var/bacula
16
17 VERSION=2.2.5
18
19 CWD=`pwd`
20 # Try to guess the distribution base
21 DISTR_BASE=`dirname \`pwd\` | sed -e 's@/platforms$@@'`
22 echo "Distribution base:   $DISTR_BASE"
23
24 TMPINSTALLDIR=/tmp/`basename $DISTR_BASE`-build
25 echo "Temp install dir:  $TMPINSTALLDIR"
26 echo "Install directory: $INSTALL_BASE"
27
28 cd $DISTR_BASE
29
30 if [ "x$1" = "xbuild" ]; then
31     ./configure --prefix=$INSTALL_BASE \
32             --sbindir=$SBIN_DIR \
33             --sysconfdir=$SYSCONF_DIR \
34             --mandir=$MAN_DIR \
35             --with-scriptdir=$SCRIPT_DIR \
36             --with-working-dir=$WORKING_DIR \
37             --with-subsys-dir=/var/lock/subsys \
38             --with-pid-dir=/var/run \
39             --enable-smartalloc \
40             --enable-conio \
41             --enable-readline \
42             --enable-client-only \
43             --disable-ipv6
44     
45     make
46 fi
47
48 if [ -d $TMPINSTALLDIR ]; then
49     rm -rf $TMPINSTALLDIR
50 fi
51 mkdir $TMPINSTALLDIR
52
53 make DESTDIR=$TMPINSTALLDIR install
54
55 # copy additional files to install-dir
56 #
57
58
59 # change conf-files that they won't be overwritten by install
60 #
61 cd $TMPINSTALLDIR/$SYSCONF_DIR
62 for x in *.conf; do
63     mv ${x} ${x}-dist
64 done
65
66
67 # cd back to my start-dir
68 #
69 cd $CWD
70
71 #cp prototype.master prototype
72 sed -e "s|__PKGSOURCE__|$CWD|" prototype.master > prototype
73
74 pkgproto $TMPINSTALLDIR/$INSTALL_BASE=. >> prototype
75
76 pkgmk -o -d /tmp -b $TMPINSTALLDIR/$INSTALL_BASE -f prototype
77
78 if [ $? = 0 ]; then
79     pkgtrans /tmp bacula-$VERSION.pkg Bacula
80     echo "Package has been created in /tmp"
81 fi 
82