First go at documentation for debug2html.
[samba.git] / packaging / SGI / mkrelease.sh
1 #!/bin/sh
2
3 # This file goes through all the necessary steps to build a release package.
4 # syntax:
5 #     mkrelease.sh [5] [clean] [targets ....]
6 #
7 # You may specify 5 to build for IRIX 5.3
8 #
9 # You can specify clean to do a make clean before building. Make clean
10 # will also run configure and generate the required Makefile.
11 #
12 # You can specify which targets to build. If targets are specified, the
13 # specified targets will be built but inst packages will not be generated.
14
15 doclean=""
16 SGI_ABI=-n32
17 CC=cc
18
19 if [ ! -f ../../source/Makefile ]; then
20   doclean="clean"
21 fi
22
23 if [ "$1" = "clean" ]; then
24   doclean=$1
25   shift
26 elif [ "$1" = "5" ]; then
27   SGI_ABI=-32
28   shift
29 fi
30
31 # check again in case they put the args in the wrong order
32
33 if [ "$1" = "clean" ]; then
34   doclean=$1
35   shift
36 elif [ "$1" = "5" ]; then
37   SGI_ABI=-32
38   shift
39 fi
40
41 export SGI_ABI CC
42
43 if [ "$doclean" = "clean" ]; then
44   cd ../../source
45   if [ -f Makefile ]; then
46     make distclean
47   fi
48   cd ../packaging/SGI
49   rm -rf bins catman html codepages swat samba.idb samba.spec
50 fi
51
52 # create the catman versions of the manual pages
53 #
54 if [ "$doclean" = "clean" ]; then
55   echo Making manual pages
56   ./mkman
57   errstat=$?
58   if [ $errstat -ne 0 ]; then
59     echo "Error $errstat making manual pages\n";
60     exit $errstat;
61   fi
62 fi
63
64 cd ../../source
65 if [ "$doclean" = "clean" ]; then
66   echo Create SGI specific Makefile
67   chmod +x configure
68   chmod +x configure.developer
69   chmod +x config.guess
70   chmod +x config.status
71   chmod +x config.sub
72   ./configure --prefix=/usr/samba --mandir=/usr/share/catman --with-smbwrapper
73   errstat=$?
74   if [ $errstat -ne 0 ]; then
75     echo "Error $errstat creating Makefile\n";
76     exit $errstat;
77   fi
78 fi
79
80
81 # build the sources
82 #
83 echo Making binaries
84
85 make "CFLAGS=-O -g3" $*
86 errstat=$?
87 if [ $errstat -ne 0 ]; then
88   echo "Error $errstat building sources\n";
89   exit $errstat;
90 fi
91
92 cd ../packaging/SGI
93
94 #
95 # Don't generate packages if targets were specified
96 #
97 if [ "$1" != "" ]; then
98   exit 0;
99 fi
100
101 # generate the packages
102 #
103 echo Generating Inst Packages
104 ./spec.pl                       # create the samba.spec file
105 errstat=$?
106 if [ $errstat -ne 0 ]; then
107   echo "Error $errstat creating samba.spec\n";
108   exit $errstat;
109 fi
110
111 ./idb.pl                        # create the samba.idb file
112 errstat=$?
113 if [ $errstat -ne 0 ]; then
114   echo "Error $errstat creating samba.idb\n";
115   exit $errstat;
116 fi
117
118 if [ ! -d bins ]; then
119    mkdir bins
120 fi
121
122 # do the packaging
123 /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all
124