43765e196b524ca784caf8c3d52be53ea9c0a3b4
[abartlet/samba.git/.git] / packaging / SGI / mkrelease.sh
1 #!/bin/sh
2
3 # This file goes through all the necessary steps to build a release package.
4 # You may specify a OS major version number (4, 5, or 6) to specify which
5 # OS release to build. If no version number is given it will default to 6.
6
7 doclean=""
8 SGI_ABI=-n32
9 export SGI_ABI
10
11 if [ "$1" = "clean" ]; then
12   doclean=$1
13   shift
14 fi
15
16 if [ "$doclean" = "clean" ]; then
17   cd ../../source
18   if [ -f Makefile ]; then
19     make distclean
20   fi
21   cd ../packaging/SGI
22   rm -rf bins catman html codepages swat samba.idb samba.spec
23 fi
24
25 # create the catman versions of the manual pages
26 #
27 if [ "$doclean" = "clean" ]; then
28   echo Making manual pages
29   ./mkman
30   errstat=$?
31   if [ $errstat -ne 0 ]; then
32     echo "Error $errstat making manual pages\n";
33     exit $errstat;
34   fi
35 fi
36
37 cd ../../source
38 if [ "$doclean" = "clean" -o ! -f Makefile ]; then
39   echo Create SGI specific Makefile
40   chmod +x configure
41   chmod +x configure.developer
42   chmod +x config.guess
43   chmod +x config.status
44   chmod +x config.sub
45   ./configure --prefix=/usr --mandir=/usr/src/man
46   errstat=$?
47   if [ $errstat -ne 0 ]; then
48     echo "Error $errstat creating Makefile\n";
49     exit $errstat;
50   fi
51 fi
52
53
54 # build the sources
55 #
56 echo Making binaries
57
58 if [ "$1" = "5" ]; then
59   myflags="CFLAGS=-O -g3"
60   shift
61 else
62   myflags="CFLAGS=-O -g3"
63 fi
64
65 make "$myflags" $*
66 errstat=$?
67 if [ $errstat -ne 0 ]; then
68   echo "Error $errstat building sources\n";
69   exit $errstat;
70 fi
71
72 cd ../packaging/SGI
73
74 # generate the packages
75 #
76 echo Generating Inst Packages
77 ./spec.pl                       # create the samba.spec file
78 errstat=$?
79 if [ $errstat -ne 0 ]; then
80   echo "Error $errstat creating samba.spec\n";
81   exit $errstat;
82 fi
83
84 ./idb.pl                        # create the samba.idb file
85 errstat=$?
86 if [ $errstat -ne 0 ]; then
87   echo "Error $errstat creating samba.idb\n";
88   exit $errstat;
89 fi
90
91 if [ ! -d bins ]; then
92    mkdir bins
93 fi
94
95 # do the packaging
96 /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all
97