/[tokyocabinet-toys]/tc-latest-deb.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /tc-latest-deb.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8 - (hide annotations)
Sat Jul 25 16:49:30 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1882 byte(s)
tweak build procedure a bit more, but I would relly need to make
proper Debian package out of it with libtokyocabinet and everything

1 dpavlin 6 #!/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 $upstream | grep 'http://' ; then
12     wget -nc -c $upstream
13     else
14     wget -nc -c http://${what}.sourceforge.net/$upstream
15     fi
16    
17     upstream_ver=`echo $upstream | cut -d- -f2 | sed 's/\.tar.gz//'`
18     }
19    
20     d=`pwd`
21     tmp="/tmp/tc-latest"
22    
23     function extract() {
24     arc="$1"
25    
26     name=`echo $arc | cut -d- -f1`
27     ver=`echo $arc | cut -d- -f2 | sed 's/\.tar.gz//'`
28    
29     if dpkg -l "$name" | grep "^ii" | grep "$ver" 2>&1 >/dev/null ; then
30     echo "Skipping $name [$ver], allready installed."
31     return
32     fi
33    
34     mkdir $tmp
35     cd $tmp
36    
37     opt=""
38    
39     echo "Extracting $name [$ver] to $tmp"
40     tar xvfz "$d/$arc"
41     cd *
42    
43     if [ "$ver" == "perl" ] ; then
44    
45 dpavlin 8 dh-make-perl --bdepends tokyocabinet --depends tokyocabinet || exit
46     # echo "libtokyocabinet 8 tokyocabinet(>= 1.4.30)" > debian/shlib.local || exit
47     cat debian/control | sed 's/${shlibs:Depends},//' > debian/control.new && mv debian/control.new debian/control
48     sudo ./debian/rules binary || exit
49 dpavlin 6
50     else
51    
52     ./configure
53     make
54     sudo checkinstall -y
55    
56     fi
57    
58     cd $d
59     sudo rm -Rf $tmp
60     }
61    
62     dpkg -l | awk '{ print $2 }' | egrep '^(tokyocabinet|)' | xargs sudo apt-get remove -y
63    
64     tokyocabinet_ver="$1"
65     perl_ver="$2"
66    
67     if [ -z "$tokyocabinet_ver" ] ; then
68     check_upstream 'tokyocabinet'
69     extract "tokyocabinet-${upstream_ver}.tar.gz"
70     else
71     extract `ls -m tokyocabinet-${tokyocabinet_ver}.tar.gz | head -1`
72     fi
73    
74     perl_upstream=`wget -O - -o /dev/null http://tokyocabinet.sourceforge.net/perlpkg/ | grep tar.gz | cut -d\" -f8 | tail -1`
75     if [ -z "$perl_ver" ] ; then
76 dpavlin 8 wget -nH -nd -nc http://tokyocabinet.sourceforge.net/perlpkg/$perl_upstream
77 dpavlin 6 extract "$perl_upstream"
78     else
79     extract `ls -m $perl_upstream | head -1`
80     fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26