summaryrefslogtreecommitdiff
path: root/support/biblio/install
blob: af5e010a1c32820441de330805f0c5ee81c84f1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh

PREFIX="/usr/local/biblio/" 
BINDIR="/usr/local/bin/"
ADDSCRIPTS="ADDSCRIPTS"

CP="cp"
LN="ln -s"
COPYERROR="Copy Error"


if [ -d $PREFIX ] ; then
  echo "$PREFIX already exist!!! Delete it and repeate $0"
  exit 0
fi


mkdir $PREFIX

if [ -d $PREFIX ] ; then
   echo "$PREFIX is created"
   echo ""
   $CP biblio.pl  "$PREFIX"
   if [ -e "$PREFIX"biblio.pl ] ; then
     echo "$PREFIX"biblio.pl is copied
     echo "Copying directories..."     
     $CP -r formats     "$PREFIX"
     $CP -r EXAMPLES    "$PREFIX"
     $CP -r ADDSCRIPTS  "$PREFIX"

     if [ -d "$PREFIX"formats ] ; then
        if [ -d "$PREFIX"EXAMPLES ] ; then
           if [ -d "$PREFIX"ADDSCRIPTS ] ; then
             echo "All files are copied."
           else
             echo "$COPYERROR ADDSCRIPTS"
             exit 0
           fi   
        else 
          echo "$COPYERROR EXAMPLES"
          exit 0
        fi
        
     else 
        echo "$COPYERROR formats"
        exit 0
     fi

   else 
     echo "$COPYERROR biblio.pl"
     exit 0
   fi

   echo "Changing dir to $PREFIX"
   cd $PREFIX
   $LN biblio.pl biblio
   if [ -e biblio ] ; then
      echo "Link biblio to biblio.pl is created"
   else
      echo "Failed to create a link to biblio.pl.  Exiting..."
      exit 0
   fi
   
   echo "Changing dir to $BINDIR"
   cd $BINDIR

   $LN "$PREFIX"biblio  biblio
   if [ -e biblio ] ; then 
      echo "Link $BINDIR"biblio to "$PREFIX"biblio is created
   else
      echo Error creating link "$BINDIR"biblio! Exiting...
      exit 0
   fi
 
   $LN "$PREFIX""$ADDSCRIPTS"/biblist.pl  biblist.pl
   if [ -e biblist.pl ] ; then 
      echo "Link $BINDIR"biblist.pl to "$PREFIX"biblist.pl is created
   else
      echo Error creating link "$BINDIR"biblist! Exiting...
      exit 0
   fi

   echo "Done!!!"
   echo 

else
   echo Error creating "$PREFIX".  Exiting...
   exit 0     
fi