final sync with SAMBA_2_2
[Samba/gbeck.git] / packaging / SGI / mkrelease.sh
blob6eab242de846c3b7f15cf9b9721d9d55aeec5609
1 #!/bin/sh
3 # This file goes through all the necessary steps to build a release package.
4 # syntax:
5 # mkrelease.sh [5] [clean] [targets ....]
7 # You may specify 5 to build for IRIX 5.3
9 # You can specify clean to do a make clean before building. Make clean
10 # will also run configure and generate the required Makefile.
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.
15 doclean=""
16 SGI_ABI=-n32
17 ISA=-mips3
18 CC=cc
20 if [ ! -f ../../source/Makefile ]; then
21 doclean="clean"
24 if [ "$1" = "clean" ]; then
25 doclean=$1
26 shift
27 elif [ "$1" = "5" ]; then
28 SGI_ABI=-32
29 ISA=""
30 shift
33 # check again in case they put the args in the wrong order
35 if [ "$1" = "clean" ]; then
36 doclean=$1
37 shift
38 elif [ "$1" = "5" ]; then
39 SGI_ABI=-32
40 ISA=""
41 shift
44 export SGI_ABI ISA CC
46 if [ "$doclean" = "clean" ]; then
47 cd ../../source
48 if [ -f Makefile ]; then
49 make distclean
51 cd ../packaging/SGI
52 rm -rf bins catman html codepages swat samba.idb samba.spec
55 # create the catman versions of the manual pages
57 if [ "$doclean" = "clean" ]; then
58 echo Making manual pages
59 ./mkman
60 errstat=$?
61 if [ $errstat -ne 0 ]; then
62 echo "Error $errstat making manual pages\n";
63 exit $errstat;
67 cd ../../source
68 if [ "$doclean" = "clean" ]; then
69 echo Create SGI specific Makefile
70 ./configure --prefix=/usr/samba --mandir=/usr/share/catman --with-acl-support --with-smbwrapper
71 errstat=$?
72 if [ $errstat -ne 0 ]; then
73 echo "Error $errstat creating Makefile\n";
74 exit $errstat;
79 # build the sources
81 echo Making binaries
83 make "CFLAGS=-O -g3" $*
84 errstat=$?
85 if [ $errstat -ne 0 ]; then
86 echo "Error $errstat building sources\n";
87 exit $errstat;
90 cd ../packaging/SGI
93 # Don't generate packages if targets were specified
95 if [ "$1" != "" ]; then
96 exit 0;
99 # generate the packages
101 echo Generating Inst Packages
102 ./spec.pl # create the samba.spec file
103 errstat=$?
104 if [ $errstat -ne 0 ]; then
105 echo "Error $errstat creating samba.spec\n";
106 exit $errstat;
109 ./idb.pl # create the samba.idb file
110 errstat=$?
111 if [ $errstat -ne 0 ]; then
112 echo "Error $errstat creating samba.idb\n";
113 exit $errstat;
116 if [ ! -d bins ]; then
117 mkdir bins
120 # do the packaging
121 /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all