1 |
dpavlin |
22 |
#!/bin/sh |
2 |
|
|
|
3 |
|
|
sudo echo "Cache credentials for sudo..." |
4 |
|
|
|
5 |
|
|
function check_upstream() { |
6 |
|
|
what="$1" |
7 |
|
|
upstream=`wget -O - http://${what}.sourceforge.net/ -o /dev/null | grep "Latest Source Package" | cut -d\" -f2` |
8 |
|
|
|
9 |
|
|
echo "Upstream version of $what is $upstream" |
10 |
|
|
|
11 |
|
|
if echo $usptream | grep 'http://' ; then |
12 |
|
|
wget -nc -c $upstream |
13 |
|
|
else |
14 |
|
|
wget -nc -c http://${what}.sourceforge.net/$upstream |
15 |
|
|
fi |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
d=`pwd` |
19 |
|
|
tmp="/tmp/est-latest" |
20 |
|
|
|
21 |
|
|
function extract() { |
22 |
|
|
arc="$1" |
23 |
|
|
|
24 |
|
|
name=`echo $arc | cut -d- -f1` |
25 |
|
|
ver=`echo $arc | cut -d- -f2 | sed 's/\.tar.gz//'` |
26 |
|
|
|
27 |
|
|
if dpkg -l "$name" | grep "$ver" 2>&1 >/dev/null ; then |
28 |
|
|
echo "Skipping $name [$ver], allready installed." |
29 |
|
|
return |
30 |
|
|
fi |
31 |
|
|
|
32 |
|
|
mkdir $tmp |
33 |
|
|
cd $tmp |
34 |
|
|
|
35 |
|
|
echo "Extracting $name [$ver] to $tmp" |
36 |
|
|
tar xvfz "$d/$arc" |
37 |
|
|
cd * |
38 |
|
|
./configure |
39 |
|
|
make |
40 |
|
|
sudo checkinstall -y |
41 |
|
|
cd $d |
42 |
|
|
sudo rm -Rf $tmp |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
check_upstream 'qdbm' |
46 |
|
|
extract `ls -d qdbm-*.tar.gz | tail -1` |
47 |
|
|
|
48 |
|
|
check_upstream 'hyperestraier' |
49 |
|
|
extract `ls -d hyperestraier-*.tar.gz | tail -1` |
50 |
|
|
|