reverted to 1.24 and manually merged in changes from 2.2
[Samba.git] / packaging / SGI / mkrelease.sh
blob7412a02d4f9653434f19b7a30c7cd50cbd7e564c
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" ]; then
23 doclean=$1
24 shift
27 export SGI_ABI ISA CC
29 if [ "$doclean" = "clean" ]; 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
39 # create the catman versions of the manual pages
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;
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;
63 # build the sources
65 echo Making binaries
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;
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 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;
88 mv bin/smbd bin/smbd.noquota
90 echo "===================== Making smbwrapper.32.so ======================="
91 # cannot use -mips3 with 32 bit shared libraries so reset the ISA variable
92 # just for this object
93 ISA=
94 export ISA
95 make -P "CFLAGS=-O -g3" bin/smbwrapper.32.so
96 errstat=$?
97 if [ $errstat -ne 0 ]; then
98 echo "Error $errstat building sources\n";
99 exit $errstat;
101 ISA=-mips3
102 export ISA
103 echo "===================== Making Regular versions ======================="
104 make -P "CFLAGS=-O -g3" all nsswitch/libnss_wins.so
105 errstat=$?
106 if [ $errstat -ne 0 ]; then
107 echo "Error $errstat building sources\n";
108 exit $errstat;
111 cd ../packaging/SGI
113 # generate the packages
115 echo Generating Inst Packages
116 ./spec.pl # create the samba.spec file
117 errstat=$?
118 if [ $errstat -ne 0 ]; then
119 echo "Error $errstat creating samba.spec\n";
120 exit $errstat;
123 ./idb.pl # create the samba.idb file
124 errstat=$?
125 if [ $errstat -ne 0 ]; then
126 echo "Error $errstat creating samba.idb\n";
127 exit $errstat;
130 if [ ! -d bins ]; then
131 mkdir bins
134 # do the packaging
135 /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all