clean up if {} statement to keep in sync with HEAD
[Samba.git] / packaging / SGI / mkrelease.sh
blobf4febca220bd31ff985b7ff92a6fa9c0fb6c260c
1 #!/bin/sh
3 # This file goes through all the necessary steps to build a release package.
4 # syntax:
5 # mkrelease.sh [clean]
7 # You can specify clean to do a make clean before building. Make clean
8 # will also run configure and generate the required Makefile.
10 # This will build an smbd.noquota, smbd.profile, nmbd.profile and the
11 # entire package with quota support and acl support.
13 doclean=""
14 SGI_ABI=-n32
15 ISA=-mips3
16 CC=cc
18 if [ ! -f ../../source/Makefile ]; then
19 doclean="clean"
22 if [ "$1" = "clean" ] || [ "$1" = "cleanonly" ]; then
23 doclean=$1
24 shift
27 export SGI_ABI ISA CC
29 if [ "$doclean" = "clean" ] || [ "$doclean" = "cleanonly" ]; then
30 cd ../../source
31 if [ -f Makefile ]; then
32 make distclean
34 rm -rf bin/*.profile bin/*.noquota
35 cd ../packaging/SGI
36 rm -rf bins catman html codepages swat samba.idb samba.spec
37 if [ "$doclean" = "cleanonly" ]; then exit 0 ; fi
40 # create the catman versions of the manual pages
42 if [ "$doclean" = "clean" ]; then
43 echo Making manual pages
44 ./mkman
45 errstat=$?
46 if [ $errstat -ne 0 ]; then
47 echo "Error $errstat making manual pages\n";
48 exit $errstat;
52 cd ../../source
53 if [ "$doclean" = "clean" ]; then
54 echo Create SGI specific Makefile
55 ./configure --prefix=/usr/samba --sbindir=/usr/samba/bin --mandir=/usr/share/catman --with-acl-support --with-quotas --with-smbwrapper
56 errstat=$?
57 if [ $errstat -ne 0 ]; then
58 echo "Error $errstat creating Makefile\n";
59 exit $errstat;
64 # build the sources
66 echo Making binaries
68 echo "===================== Making Profile versions ======================="
69 make clean
70 make -P "CFLAGS=-O -g3 -woff 1188 -D WITH_PROFILE" CHECK bin/smbd bin/nmbd
71 errstat=$?
72 if [ $errstat -ne 0 ]; then
73 echo "Error $errstat building profile sources\n";
74 exit $errstat;
76 mv bin/smbd bin/smbd.profile
77 mv bin/nmbd bin/nmbd.profile
79 echo "===================== Making No Quota versions ======================="
80 make clean
81 make -P "CFLAGS=-O -g3 -woff 1188 -D QUOTAOBJS=smbd/noquotas.o" CHECK bin/smbd
82 errstat=$?
83 if [ $errstat -ne 0 ]; then
84 echo "Error $errstat building noquota sources\n";
85 exit $errstat;
87 mv bin/smbd bin/smbd.noquota
89 echo "===================== Making Regular versions ======================="
90 make -P "CFLAGS=-O -g3 -woff 1188" all libsmbclient
91 errstat=$?
92 if [ $errstat -ne 0 ]; then
93 echo "Error $errstat building sources\n";
94 exit $errstat;
97 cd ../packaging/SGI
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