-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sh
executable file
·59 lines (59 loc) · 1.04 KB
/
build.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
#!/usr/bin/env bash
# build deb package
if [ $# -lt 1 ]; then
echo "error.. need args"
exit 1
fi
echo "commond is $0"
echo "args are:"
for arg in "$@"
do
echo $arg
done
cd ..
# remove top deb and tar.gz file
if [ -d "*.deb" ]; then
rm *.deb
fi
if [ -d "*.tar.gz" ]; then
rm *.tar.gz
fi
project=shadowsocks-client
dir="$project-$1"
if [ -d "$dir" ]; then
echo "remove dir $dir"
rm -r $dir
fi
mkdir $dir
filelist=`ls $project`
# copy file to dir except build and bak
for file in $filelist
do
if [ $file = "cmake-build-debug" ]; then
echo "ignore"
continue
fi
if [[ $file = "debian.bak" ]]; then
echo "ignore"
continue
fi
cp -rp $project/$file $dir/
done
echo "copy done"
# begin build
tar -cvzf "$dir.tar.gz" $dir
cd $dir
dh_make -f "../$dir.tar.gz" -c gpl3 -s -y
filelist=`ls ../$project/debian.bak`
for file in $filelist
do
target_file="debian/$file"
echo $file,$target_file
if [ -d "$target_file" ]; then
rm $target_file
fi
cp ../$project/debian.bak/$file $target_file
echo "copy $file"
done
dpkg-buildpackage -us -uc -b
echo "done"