dtinfo other files
[oweals/cde.git] / cde / admin / IntegTools / post_install / sun / configShlibs.src
1 XCOMM!/bin/ksh
2 XCOMM $XConsortium: configShlibs.src /main/4 1996/06/13 16:06:34 drk $
3
4 #define STAR *
5
6 XCOMM ############################################
7 RemoveShlibFiles()
8 {
9     while read SRC
10     do
11       if [ "$SRC" != "" ]
12       then
13         rm -f $SRC
14         dirname=${SRC%/STAR}
15         if [ -d $dirname ]
16         then
17           cd $dirname
18           while [ "$dirname" != "$CDE_TOP" ]
19           do
20             cd ..
21             rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
22             dirname=${dirname%/STAR}
23           done
24         fi
25       fi
26     done <<-EOF
27 #include "CDE-SHLIBS.list"
28         EOF
29 }
30
31 VerifyInstalledFiles()
32 {
33     echo "Status   mode    owner   group   filename"
34     echo "-----------------------------------------"
35 XCOMM     exists  correct correct correct  /usr/dt/foo1
36 XCOMM     MISSING  WRONG   WRONG   WRONG   /usr/dt/foo2
37 XCOMM        exists    the link is correct    /usr/dt/link
38
39     while read SRC
40     do
41 #include "../verify.func"
42     done <<-EOF
43 #include "CDE-SHLIBS.lst"
44         EOF
45 }
46
47 #include "../option.func"
48
49 MakeTheLink()
50 {
51 XCOMM
52 XCOMM Usage: configTT
53 XCOMM
54 XCOMM creates links in the install tree libtt.so -> libtt.so.1
55 XCOMM
56
57   cd CDE_INSTALLATION_TOP/lib
58
59   for lib in `/bin/ls *.so.*`
60   do
61     link=`echo $lib | cut -d. -f1,2`
62
63     rm -f $link
64     ln -s $lib $link
65
66   done
67
68 }
69
70 XCOMM #########################################################################
71 XCOMM
72 XCOMM                           Main Body
73 XCOMM
74 XCOMM #########################################################################
75
76 PRODUCT=CDE
77 FILESET=CDE-SHLIBS
78 retval=0
79 CDE_TOP=CDE_INSTALLATION_TOP
80 CDE_CONF_TOP=CDE_CONFIGURATION_TOP
81
82   HandleOption $*
83
84   if [ "$OPERATION" = "deconfigure" ]
85   then
86
87     echo "de-Configuring for CDE-SHLIBS..."
88
89     RemoveShlibFiles
90
91     VerifyInstalledFiles
92
93   elif [ "$OPERATION" = "configure" ]
94   then
95
96     MakeTheLink
97
98   elif [ "$OPERATION" = "verify" ]
99   then
100
101     VerifyInstalledFiles
102
103   fi
104
105   return $retval