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" ] || [ "$1" = "cleanonly" ]; then
|
---|
23 | doclean=$1
|
---|
24 | shift
|
---|
25 | fi
|
---|
26 |
|
---|
27 | export SGI_ABI ISA CC
|
---|
28 |
|
---|
29 | if [ "$doclean" = "clean" ] || [ "$doclean" = "cleanonly" ]; 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 | if [ "$doclean" = "cleanonly" ]; then exit 0 ; fi
|
---|
38 | fi
|
---|
39 |
|
---|
40 | # create the catman versions of the manual pages
|
---|
41 | #
|
---|
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;
|
---|
49 | fi
|
---|
50 | fi
|
---|
51 |
|
---|
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;
|
---|
60 | fi
|
---|
61 | fi
|
---|
62 |
|
---|
63 |
|
---|
64 | # build the sources
|
---|
65 | #
|
---|
66 | echo Making binaries
|
---|
67 |
|
---|
68 | echo "===================== Making Profile versions ======================="
|
---|
69 | make clean
|
---|
70 | make headers
|
---|
71 | make -P "CFLAGS=-O -g3 -woff 1188 -D WITH_PROFILE" bin/smbd bin/nmbd
|
---|
72 | errstat=$?
|
---|
73 | if [ $errstat -ne 0 ]; then
|
---|
74 | echo "Error $errstat building profile sources\n";
|
---|
75 | exit $errstat;
|
---|
76 | fi
|
---|
77 | mv bin/smbd bin/smbd.profile
|
---|
78 | mv bin/nmbd bin/nmbd.profile
|
---|
79 |
|
---|
80 | echo "===================== Making No Quota versions ======================="
|
---|
81 | make clean
|
---|
82 | make headers
|
---|
83 | make -P "CFLAGS=-O -g3 -woff 1188 -D QUOTAOBJS=smbd/noquotas.o" bin/smbd
|
---|
84 | errstat=$?
|
---|
85 | if [ $errstat -ne 0 ]; then
|
---|
86 | echo "Error $errstat building noquota sources\n";
|
---|
87 | exit $errstat;
|
---|
88 | fi
|
---|
89 | mv bin/smbd bin/smbd.noquota
|
---|
90 |
|
---|
91 | echo "===================== Making Regular versions ======================="
|
---|
92 | make -P "CFLAGS=-O -g3 -woff 1188" all libsmbclient
|
---|
93 | errstat=$?
|
---|
94 | if [ $errstat -ne 0 ]; then
|
---|
95 | echo "Error $errstat building sources\n";
|
---|
96 | exit $errstat;
|
---|
97 | fi
|
---|
98 |
|
---|
99 | cd ../packaging/SGI
|
---|
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 | sort +4 samba.idb > xxx
|
---|
118 | mv xxx samba.idb
|
---|
119 |
|
---|
120 | if [ ! -d bins ]; then
|
---|
121 | mkdir bins
|
---|
122 | fi
|
---|
123 |
|
---|
124 | # do the packaging
|
---|
125 | /usr/sbin/gendist -rbase / -sbase ../.. -idb samba.idb -spec samba.spec -dist ./bins -all
|
---|
126 |
|
---|