File: ranlipinstall

package info (click to toggle)
libranlip 1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,020 kB
  • sloc: sh: 8,349; cpp: 650; ansic: 340; makefile: 114
file content (108 lines) | stat: -rwxr-xr-x 2,059 bytes parent folder | download | duplicates (6)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/sh

#check if intstall directory provided
if [ $# -eq 1 ]
then
	INSTALL_DIR=$1
	DOCS_DIR=$INSTALL_DIR
		
elif [ $# -eq 0 ]	
then
	INSTALL_DIR="/usr/local"
	DOCS_DIR="/usr/local/share/doc/ranlip.1.0"
	
else
	echo "..."
fi

DEFAULT_DIR="/usr/local"

#run configure script is it exist with install directory as parameter
if [ -f configure ]
then 
	./configure --prefix=$INSTALL_DIR

else 
	echo "Configure script missing!"

	if [ -d $INSTALL_DIR ]
	then
		echo "directory already exist!"
	else
		mkdir $INSTALL_DIR
	fi
fi

#copydocumentation into the directory docs directory
if [ -d ./examples -a -d ./docs ]
then
	echo "Installing documentation ..."
	
	# Check to see if apropritate directories exist if not
	# create them and copy docs to aproprite dirs.
	if  [ ! -d $INSTALL_DIR ]
	then
		mkdir $INSTALL_DIR
	fi

	if [ "$DEFAULT_DIR" != "$INSTALL_DIR" ]
	then
		if [ -d $INSTALL_DIR/examples -a -d $INSTALL_DIR/DOCS ]
		then
			echo "..."
		else
			mkdir $INSTALL_DIR/examples
			mkdir $INSTALL_DIR/docs
		fi
		
		#copy docuemnts in to appropriate directories
		echo " cp -r ./EXAMPLES $INSTALL_DIR/EXAMPLES "
		cp -r ./examples/* $INSTALL_DIR/examples/

		echo " cp -r ./DOCS $INSTALL_DIR/DOCS "
		cp -r ./docs/* $INSTALL_DIR/docs/

		#save documents directory path for later unistall		
		echo $INSTALL_DIR > docs_dir
		
	else
		if [ ! -d $INSTALL_DIR/share ]
		then
			mkdir $INSTALL_DIR/share/
		fi
		
		if [ ! -d $INSTALL_DIR/share/doc ]
		then
			mkdir $INSTALL_DIR/share/doc
		fi
		
		if [ ! -d $DOCS_DIR ]
		then
			mkdir $DOCS_DIR
			mkdir $DOCS_DIR/examples
			mkdir $DOCS_DIR/docs
		fi

		#copy docuemnts in to appropriate directories
		echo " cp -r ./EXAMPLES $DOCS_DIR/EXAMPLES "
		cp -r ./examples/* $DOCS_DIR/examples/

		echo " cp -r ./DOCS $DOCS_DIR/DOCS "
		cp -r ./docs/* $DOCS_DIR/docs
		
		#save documents directory path for later unistall
		echo $DOCS_DIR/ > docs_dir
	fi

else
	echo "documentation not found!"	

fi

#run make file target make isntall to compile and install the library
if [ -f Makefile ]
then
	make install
fi