1#!/bin/sh -
2#	$Id$
3
4# Remove crypto from the DB source tree.
5
6d=..
7
8t=/tmp/__db_a
9trap 'rm -f $t ; exit 0' 0
10trap 'rm -f $t ; exit 1' 1 2 3 13 15
11
12if ! test -d $d/crypto; then
13	echo "s_crypto: no crypto sources found in the source tree."
14	exit 1
15fi
16
17# Remove the crypto.
18rm -rf $d/crypto
19
20# Update the release splash page.
21f=$d/docs/index.html
22chmod 664 $f
23(echo '/DOES/' &&
24 echo 's/DOES/DOES NOT/' &&
25 echo 'w' &&
26 echo 'q') | ed $f
27
28# Win/32.
29f=win_config.in
30chmod 664 $f
31(echo '/#define.HAVE_CRYPTO/' &&
32 echo 'c' &&
33 echo '/* #undef HAVE_CRYPTO */'
34 echo '.' &&
35 echo 'w' &&
36 echo 'q') | ed $f
37
38f=srcfiles.in
39chmod 664 $f
40f=srcfiles.in
41r=`egrep crypto/crypto.c $f | awk 'BEGIN { FS="\t*" } { print $2 }'`
42(echo 'g/^crypto\//d' &&
43 echo '/crypto_stub\.c/' &&
44 echo "s/\$/ $r/" &&
45 echo 'w' &&
46 echo 'q') | ed $f
47
48# Change out crypto/crypto.c for common/crypto_stub.c, remove all other
49# references to crypto files.
50f=win_projects/projects.template.xml
51chmod 664 $f
52(echo '/crypto\/crypto\.c/' &&
53 echo 'c' &&
54 echo '      <file name="common/crypto_stub.c"/>' &&
55 echo '.' &&
56 echo 'g/"crypto\//d' &&
57 echo "s/\$/ $r/" &&
58 echo ',' &&
59 echo 'w' &&
60 echo 'q') | ed $f
61
62 sh ./s_windows
63 sh ./s_windows_dsp
64
65# VxWorks
66f=vx_config.in
67chmod 664 $f
68(echo '/#define.HAVE_CRYPTO/' &&
69 echo 'c' &&
70 echo '/* #undef HAVE_CRYPTO */'
71 echo '.' &&
72 echo 'w' &&
73 echo 'q') | ed $f
74
75 sh ./s_vxworks
76