Subversion Repositories DevTools

Rev

Rev 5872 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
371 dpurdie 1
#! /bin/bash
243 dpurdie 2
########################################################################
3
#
4
#   JATS Post Installation Setup for SOLARIS/LINUX
5
#
6
#   This command is to be executed in the directory in which it is found
7
#
8
#   Note: This MUST be a UNIX format file, not a DOS formatted file
9
#
5872 dpurdie 10
#   The script may be called automatically when the package is released
11
#   into dpkg_archive. If this is then three arguments will be provided:
12
#       archive - name of the archive
13
#       name    - Name of this package
14
#       version - version of this package
15
#   This installer will create a symlink in the parent directory to 
16
#   assist in the timely rollout of a new version of jats.
17
#       The script will create a symlink from jats2_new to this version
18
#
19
#       Every night a cronjob on hte master package server will run to
20
#       update the jats2_current symlink, from the jats2_new symlink
21
#   
243 dpurdie 22
########################################################################
23
#
24
#
25
#   Sanity test
26
#
371 dpurdie 27
echo "JATS setup"
243 dpurdie 28
if [ ! -d ./TOOLS ] ; then
29
    echo "ERROR: TOOLS directory not found"
30
    exit 1
31
fi
32
 
33
#
34
#   Ensure some essential scripts are not in DOS format
35
#   The TOOLS/*.pl file conversion will ensure that pod2usage() operates
36
#
37
for file in ./TOOLS/armerge ./BIN.*/links.sh $( find ./TOOLS -name *.pl ); do
38
    chmod +w $file
39
    dos2unix -ascii $file $file 2>/dev/null
4732 dpurdie 40
    chmod -w $file 2>/dev/null
243 dpurdie 41
done
42
 
43
#
44
#   Make executables executable
45
#
4732 dpurdie 46
chmod -fR a+x ./TOOLS 2>/dev/null
47
chmod -fR a+x ./BIN.* 2>/dev/null
243 dpurdie 48
 
49
#
50
#   Release links for all targets.
51
#
52
for dir in ./BIN.*; do
53
    if [ -d $dir ] ; then
54
        cd $dir
6798 dpurdie 55
        echo "Processing links in $dir"
243 dpurdie 56
        [ -f ./links.sh ] && sh ./links.sh
5872 dpurdie 57
        cd - > /dev/null
243 dpurdie 58
    fi
59
done
60
 
5872 dpurdie 61
#
62
#   Possibly - if run by the build system
63
#       Must have at least 3 args
64
#       3rd arg must be this version of the package    
65
#   Create a symlink in the parent diretory to this version
66
#
67
if [ $# -ge 3 ]; then
68
    thisVer=${PWD##*/}
69
    if [ "$3" = "$thisVer" ] ; then
6798 dpurdie 70
        echo "Creating jats2_new symlink to $thisVer"
5872 dpurdie 71
        pushd .. >/dev/null
72
        rm -f jats2_new
73
        ln -s $thisVer jats2_new
74
        popd >/dev/null
75
    fi
76
fi
77
 
243 dpurdie 78
echo "JATS setup complete"
4732 dpurdie 79