forked from treasure-data/td-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
executable file
·82 lines (72 loc) · 2.18 KB
/
autogen.sh
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
#!/bin/bash
CACHE_DIR=~/.tda_cache
mkdir -p ac
mkdir -p $CACHE_DIR
test -f AUTHORS || touch AUTHORS
test -f COPYING || touch COPYING
test -f ChangeLog || touch ChangeLog
test -f NEWS || touch NEWS
test -f NOTICE || touch NOTICE
test -f README || cp -f README.md README
function download() {
if [ ! -f "$2" ];then
cache_file="$CACHE_DIR/$2"
if [ -a "$cache_file" ]; then
cp -f $cache_file .
else
wget "$1/$2" -O "$2" || exit 1
cp -f $2 $cache_file
fi
fi
}
mkdir -p deps
mkdir -p deps/jemalloc
mkdir -p deps/ruby
mkdir -p plugins
cd deps
download "http://www.canonware.com/download/jemalloc" "jemalloc-2.2.5.tar.bz2"
download "http://ftp.ruby-lang.org/pub/ruby/1.9" "ruby-1.9.3-p484.tar.bz2"
download "http://rubygems.org/downloads" "bundler-1.2.5.gem"
download "http://rubygems.org/downloads" "json-1.7.7.gem"
download "http://rubygems.org/downloads" "msgpack-0.4.7.gem"
download "http://rubygems.org/downloads" "iobuffer-1.1.2.gem"
download "http://rubygems.org/downloads" "cool.io-1.1.1.gem"
download "http://rubygems.org/downloads" "http_parser.rb-0.5.1.gem"
download "http://rubygems.org/downloads" "yajl-ruby-1.1.0.gem"
download "http://rubygems.org/downloads" "jeweler-1.6.2.gem"
cd ..
echo "#!/bin/sh
##
## Generated by autogen.sh
##
version=\`cat VERSION\`
dst=fluentd-\$version
rm -rf \$dst
mkdir \$dst || exit 1
cp -fpR lib bin \$dst/ || exit 1
mkdir -p \$dst/deps || exit 1
mkdir -p \$dst/pkg || exit 1
cp pkg/fluentd-\$version.gem \$dst/pkg/
cp deps/*.gem deps/ruby-*.tar.bz2 deps/jemalloc-*.tar.bz2 \$dst/deps/
cp README.md README COPYING NEWS ChangeLog AUTHORS INSTALL NOTICE \\
configure.in Makefile.in Makefile.am configure aclocal.m4 \\
Rakefile VERSION fluent.conf make_dist.sh \\
\$dst/ || exit 1
cp -f README.md \$dst/README || exit 1
mkdir -p \$dst/ac || exit 1
cp ac/* \$dst/ac/ || exit 1
tar czvf \$dst.tar.gz \$dst || exit 1
rm -rf \$dst
" > make_dist.sh
chmod 755 make_dist.sh
if [ x`uname` = x"Darwin" ]; then
glibtoolize --force --copy
else
libtoolize --force --copy
fi
aclocal
#autoheader
automake --add-missing --copy
autoconf
rmdir deps/jemalloc 2>/dev/null
rmdir deps/ruby 2>/dev/null