no longer need separate build o32 smbwrapper
[idra/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 [clean]
6 #
7 # You can specify clean to do a make clean before building. Make clean
8 # will also run configure and generate the required Makefile.
9 #
10 # This will build an smbd.noquota, smbd.profile, nmbd.profile and the
11 # entire package with quota support and acl support.
12
13 doclean=""
14 SGI_ABI=-n32
15 ISA=-mips3
16 CC=cc
17
18 if [ ! -f ../../source/Makefile ]; then
19   doclean="clean"
20 fi
21
22 if [ "$1" = "clean" ]; then
23   doclean=$1
24   shift
25 fi
26
27 export SGI_ABI ISA CC
28
29 if [ "$doclean" = "clean" ]; then
30   cd ../../source
31   if [ -f Makefile ]; then
32     make distclean
33   fi
34   rm -rf bin/*.profile bin/*.noquota
35   cd ../packaging/SGI
36   rm -rf bins catman html codepages swat samba.idb samba.spec
37 fi
38
39 # create the catman versions of the manual pages
40 #
41 if [ "$doclean" = "clean" ]; then
42   echo Making manual pages
43   ./mkman
44   errstat=$?
45   if [ $errstat -ne 0 ]; then
46     echo "Error $errstat making manual pages\n";
47     exit $errstat;
48   fi
49 fi
50
51 cd ../../source
52 if [ "$doclean" = "clean" ]; then
53   echo Create SGI specific Makefile
54   ./configure --prefix=/usr/samba --sbindir=/usr/samba/bin --mandir=/usr/share/catman --with-acl-support --with-quotas --with-smbwrapper
55   errstat=$?
56   if [ $errstat -ne 0 ]; then
57     echo "Error $errstat creating Makefile\n";
58     exit $errstat;
59   fi
60 fi
61
62
63 # build the sources
64 #
65 echo Making binaries
66
67 echo "=====================  Making Profile versions ======================="
68 make clean
69 make headers
70 make -P "CFLAGS=-O -g3 -D WITH_PROFILE" bin/smbd bin/nmbd
71 errstat=$?
72 if [ $errstat -ne 0 ]; then
73   echo "Error $errstat building profile sources\n";
74   exit $errstat;
75 fi
76 mv  bin/smbd bin/smbd.profile
77 mv  bin/nmbd bin/nmbd.profile
78
79 echo "=====================  Making No Quota versions ======================="
80 make clean
81 make headers
82 make -P "CFLAGS=-O -g3 -D QUOTAOBJS=smbd/noquotas.o" bin/smbd
83 errstat=$?
84 if [ $errstat -ne 0 ]; then
85   echo "Error $errstat building noquota sources\n";
86   exit $errstat;
87 fi
88 mv  bin/smbd bin/smbd.noquota
89
90 echo "=====================  Making Regular versions ======================="
91 make -P "CFLAGS=-O -g3" all nsswitch/libnss_wins.so
92 errstat=$?
93 if [ $errstat -ne 0 ]; then
94   echo "Error $errstat building sources\n";
95   exit $errstat;
96 fi
97
98 cd ../packaging/SGI
99
100 # generate the packages
101 #
102 echo Generating Inst Packages
103 ./spec.pl                       # create the samba.spec file
104 errstat=$?
105 if [ $errstat -ne 0 ]; then
106   echo "Error $errstat creating samba.spec\n";
107   exit $errstat;
108 fi
109
110 ./idb.pl                        # create the samba.idb file
111 errstat=$?
112 if [ $errstat -ne 0 ]; then
113   echo "Error $errstat creating samba.idb\n";
114   exit $errstat;
115 fi
116
117 if [ ! -d bins ]; then
118    mkdir bins
119 fi
120
121 # do the packaging
122 /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all
123