fix potential handle leak in _spoolss_open_printer_ex(); final fix for CR2102; review...
[Samba.git] / packaging / HPUX / gen_psf.sh
blob4a24bab49b4dc244df4a69ea6751b43ec85d336b
1 #!/usr/bin/sh
2 #- Below variables are editable.
3 #- VERSION Script tries to set the version automatically if it's empty
4 #- string. The version number is assumed to be in
5 #- ../../source/include/version.h. Should this fail to find correct
6 #- version, set it manually to override automatic search.
7 #- BIN List of binaries from ../../source/bin. Note: do not include
8 #- swat here for it is a part of Samba.swat fileset
9 #- SCRIPT List of scripts
10 #- OS_REVISION The regular expression to determine the supported OS version.
11 #- The default versions are HP-UX 10.10 or later as well as 11.*.
12 #- You can modify this to reflect the OS you compile on. For
13 #- instance, to support any 10.? and 11.? releases, use the
14 #- following string:
15 #- '?.10.*|?.11.*
16 VERSION=""
18 BIN="smbd nmbd smbclient testparm testprns smbstatus\
19 rpcclient smbpasswd make_smbcodepage nmblookup "
21 # SCRIPT="smbtar addtosmbpass convert_smbpasswd"
23 OS_RELEASE='?.10.[2-9]?|?.11.*'
26 #- Below variables should be exported from create_package.sh
28 if [ -z "$PSF" ]
29 then
30 PSF=samba.psf
33 if [ -z "$DEPOT" ]
34 then
35 DEPOT=samba.depot
38 if [ -z "$PRODUCT" ]
39 then
40 PRODUCT=Samba
43 #--------------------------------------------------------------------------
44 CODEPAGES=""
45 if [ -z "$VERSION" ]
46 then
47 echo "Deducing Samba version from version.h ... \c"
48 VERSION=`grep VERSION ../../source/include/version.h | awk '{print $3}' |\
49 tr -d '"'`
50 if [ $? -ne 0 -o -z "$VERSION" ]
51 then
52 echo "failed."
53 echo "Cannot find Samba version. Edit gen_psf.sh and set VERSION"
54 echo "variable manually."
55 exit 1
56 else
57 echo "$VERSION"
61 echo "Creating list of codepage definitions ..."
63 #- create codepages from definition and add them to PSF file
64 for a in ../../source/codepages/codepage_def.[0-9][0-9][0-9]
66 b=${a##../../source/codepages/codepage_def.}
67 CODEPAGES="$CODEPAGES $b"
68 done
69 echo "\t$CODEPAGES"
71 echo "Running make_smbcodepage on codepage definitions ... \c"
73 mkdir codepage >/dev/null 2>&1
74 for a in $CODEPAGES
76 ../../source/bin/make_smbcodepage c $a ../../source/codepages/codepage_def.$a\
77 codepage/codepage.$a
78 done
79 echo "done."
81 #- HP-UX uses slightly different section numbers for man pages. The following
82 #- compares to "normal" sections:
84 #- Section HP-UX section
85 #- 1 1 user commands
86 #- 5 4 files
87 #- 7 5 concepts
88 #- 8 1m administration commands
89 #- NOTE:
90 #- Sed expressions used in below loops replaces original section references
91 #- inside man page with HP-UX section references. Assumption is that
92 #- only numbers in brackets are section references and nothing else.
93 #- So far I did not see the man pages corrupted by replacing anything
94 #- else but section references.
96 mkdir man >/dev/null 2>&1
97 echo "Coverting man pages to HP-UX numbering ..."
98 echo "\t Sections 1 \c"
99 for a in ../../docs/manpages/*.1
101 sed -e 's/^[.]TH \([^ ][^ ]*\) .*/.TH \1 1/'\
102 -e '1a\
103 .ds )H Samba Team'\
104 -e "1a\\
105 .ds ]W $VERSION"\
106 -e 's/(8)/(1m)/g' \
107 -e 's/(5)/(4)/g' \
108 -e 's/(7)/(5)/g' \
109 $a >man/`basename $a`
110 done
111 echo "1m \c"
112 for a in ../../docs/manpages/*.8
114 b=`basename $a`
115 c=${b%.8}
116 sed -e 's/^[.]TH \([^ ][^ ]*\) .*/.TH \1 1M/'\
117 -e '1a\
118 .ds )H Samba Team'\
119 -e "1a\\
120 .ds ]W $VERSION"\
121 -e 's/(8)/(1m)/g' \
122 -e 's/(5)/(4)/g' \
123 -e 's/(7)/(5)/g' \
124 $a >man/$c.1m
125 done
126 echo "4 \c"
127 for a in ../../docs/manpages/*.5
129 b=`basename $a`
130 c=${b%.5}
131 sed -e 's/^[.]TH \([^ ][^ ]*\) .*/.TH \1 4/'\
132 -e '1a\
133 .ds )H Samba Team'\
134 -e "1a\\
135 .ds ]W $VERSION"\
136 -e 's/(8)/(1m)/g' \
137 -e 's/(5)/(4)/g' \
138 -e 's/(7)/(5)/g' \
139 $a >man/$c.4
140 done
141 echo "5"
142 for a in ../../docs/manpages/*.7
144 b=`basename $a`
145 c=${b%.7}
146 sed -e 's/^[.]TH \([^ ][^ ]*\) .*/.TH \1 5/'\
147 -e '1a\
148 .ds )H Samba Team'\
149 -e "1a\\
150 .ds ]W $VERSION"\
151 -e 's/(8)/(1m)/g' \
152 -e 's/(5)/(4)/g' \
153 -e 's/(7)/(5)/g' \
154 $a >man/$c.5
155 done
157 echo "Creating product specification file:"
158 echo "\tVendor and product description"
159 #- vendor and header of product definition
160 cat <<_EOF_ >$PSF
161 vendor
162 tag Samba
163 title Samba Team
164 description <vendor_description
167 product
168 tag $PRODUCT
169 title Samba Server
170 description < ../../WHATSNEW.txt
171 copyright "Copyright (c) 1998 Samba Team. See COPYING for details."
172 readme < ../../README
173 revision $VERSION
174 machine_type *
175 os_name HP-UX
176 os_release $OS_RELEASE
177 os_version *
178 directory /
179 is_locatable false
180 vendor_tag Samba
182 _EOF_
184 echo "\tFileset $PRODUCT.core"
186 cat <<_EOF_ >>$PSF
187 fileset
188 tag core
189 title Samba server core components
190 revision $VERSION
191 is_kernel false
192 is_reboot false
193 is_secure false
194 configure configure.bin
195 unconfigure unconfigure.bin
197 file -m 0755 -o root -g sys / /usr/local/samba/
198 file -m 0755 -o root -g sys / /usr/local/samba/bin/
199 file -m 0755 -o root -g sys / /usr/local/samba/lib/
200 file -m 0755 -o root -g sys / /usr/local/samba/lib/codepages/
201 file -m 0755 -o root -g sys / /usr/local/samba/newconfig/
202 file -m 0755 -o root -g sys / /usr/local/samba/newconfig/examples/
203 file -m 0700 -o root -g sys / /usr/local/samba/private/
204 file -m 0755 -o root -g sys / /var/usr/local/samba/
205 file -m 0755 -o root -g sys / /var/usr/local/samba/locks/
207 file -m 0444 -o root -g sys ../../COPYING /usr/local/samba/COPYING
208 file -m 0555 -o root -g sys ./samba.boot /sbin/init.d/samba
209 file -m 0444 -o root -g sys ./samba.config /usr/local/samba/newconfig/samba.config
211 file -m 0444 -o root -g sys ../../examples/smb.conf.default /usr/local/samba/newconfig/examples/smb.conf.default
212 file -m 0444 -o root -g sys ../../examples/simple/smb.conf /usr/local/samba/newconfig/examples/smb.conf.simple
213 file -m 0444 -o root -g sys ../../examples/dce-dfs/smb.conf /usr/local/samba/newconfig/examples/smb.conf.dce-dfs
215 directory ../../source/bin=/usr/local/samba/bin
216 _EOF_
217 for a in $BIN
219 echo " file -m 0555 -o root -g sys $a" >>$PSF
220 done
222 echo " directory ../../source/script=/usr/local/samba/bin" >>$PSF
224 for a in $SCRIPT
226 echo " file -m 0555 -o root -g sys $a" >>$PSF
227 done
229 echo " directory ./codepage=/usr/local/samba/lib/codepages" >> $PSF
231 for a in $CODEPAGES
233 echo " file -m 0444 -o root -g sys codepage.$a" >>$PSF
234 done
235 echo " end" >>$PSF
236 #- end of fileset CORE
238 echo "\tFileset $PRODUCT.man"
239 #- Man pages
240 cat <<_EOF_ >>$PSF
241 fileset
242 tag man
243 title Samba server man pages
244 revision $VERSION
245 is_kernel false
246 is_reboot false
247 is_secure false
248 configure configure.man
250 file -m 0755 -o root -g sys / /usr/local/samba/man/
251 file -m 0755 -o root -g sys / /usr/local/samba/man/man1/
252 file -m 0755 -o root -g sys / /usr/local/samba/man/man1m/
253 file -m 0755 -o root -g sys / /usr/local/samba/man/man4/
254 file -m 0755 -o root -g sys / /usr/local/samba/man/man5/
256 _EOF_
258 #- HP-UX uses slightly different section numbers for man pages. The following
259 #- compares to "normal" sections:
261 #- Section HP-UX section
262 #- 1 1 user commands
263 #- 5 4 files
264 #- 7 5 concepts
265 #- 8 1m administration commands
267 for a in man/*.1
269 b=`basename $a`
270 echo " file -m 0444 -o root -g sys $a /usr/local/samba/man/man1/$b" >>$PSF
271 done
273 for a in man/*.1m
275 b=`basename $a`
276 echo " file -m 0444 -o root -g sys $a /usr/local/samba/man/man1m/$b" >>$PSF
277 done
279 for a in man/*.4
281 b=`basename $a`
282 echo " file -m 0444 -o root -g sys $a /usr/local/samba/man/man4/$b" >>$PSF
283 done
285 for a in man/*.5
287 b=`basename $a`
288 echo " file -m 0444 -o root -g sys $a /usr/local/samba/man/man5/$b" >>$PSF
289 done
291 echo " end" >>$PSF
293 echo "\tFileset $PRODUCT.swat"
295 cat <<_EOF_ >>$PSF
297 fileset
298 tag swat
299 title Samba Web-based administration tool
300 revision $VERSION
301 is_kernel false
302 is_reboot false
303 is_secure false
304 prerequisite Samba.core
305 configure configure.swat
306 unconfigure unconfigure.swat
308 file -m 0755 -o root -g sys / /usr/local/samba/swat/
309 file -m 0755 -o root -g sys / /usr/local/samba/swat/help/
310 file -m 0755 -o root -g sys / /usr/local/samba/swat/images/
311 file -m 0755 -o root -g sys / /usr/local/samba/swat/include/
313 directory ../../swat=/usr/local/samba/swat
314 file -m 0444 -o root -g sys README
316 directory ../../source/bin=/usr/local/samba/bin
317 file -m 0555 -o root -g sys swat
319 directory ../../swat/images=/usr/local/samba/swat/images
320 _EOF_
322 for a in ../../swat/images/*.gif
324 b=`basename $a`
325 echo " file -m 0444 -o root -g sys $b" >>$PSF
326 done
328 echo " directory ../../swat/help=/usr/local/samba/swat/help" >>$PSF
330 for a in ../../swat/help/*.html
332 b=`basename $a`
333 echo " file -m 0444 -o root -g sys $b" >>$PSF
334 done
336 echo " directory ../../docs/htmldocs=/usr/local/samba/swat/help" >>$PSF
338 for a in ../../docs/htmldocs/*.html
340 b=`basename $a`
341 echo " file -m 0444 -o root -g sys $b" >>$PSF
342 done
344 echo " directory ../../swat/include=/usr/local/samba/swat/include" >>$PSF
346 for a in ../../swat/include/*.html
348 b=`basename $a`
349 echo " file -m 0444 -o root -g sys $b" >>$PSF
350 done
352 cat <<_EOF_ >>$PSF
356 _EOF_