Repository navigation
Expand file tree
/
Copy pathstart.sh
More file actions
61 lines (52 loc) · 1.58 KB
/
Copy pathstart.sh
File metadata and controls
61 lines (52 loc) · 1.58 KB
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
#!/bin/bash
errlog(){
echo $1
exit 1
}
export dscflag="dsc"
if [[ "$DEB_BUILD_OPTIONS" == *"nodsc"* ]];then
dscflag="nodsc"
fi
exec_build(){
echo "install depends"
apt update
yes |mk-build-deps --install --remove
if [ -f "Makefile" ];then
echo "clean "
make clean || echo ok
echo "build deb in `pwd` "
make deb || errlog "build deb error"
# We need copy deb files first beacuse of deb will be clean when dsc build
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
if [ $dscflag == "dsc" ];then
make dsc || errlog "build dsc error"
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
fi
else
dpkg-buildpackage -b -us -uc -S -d ||errlog "build dsc error"
# We need copy deb files first beacuse of deb will be clean when dsc build
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
if [ $dscflag == "dsc" ];then
dpkg-buildpackage -b -us -uc ||errlog "build deb error"
cp ../*.deb ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* $PKGDIR
fi
fi
}
if [ ! -d "$PKGDIR" ];then
errlog "$PKGDIR dir is not existd,Exitting !"
fi
if [ -f "$PKGDIR/../autobuild.sh" ];then
cd $PKGDIR/../
bash autobuild.sh
else
# Rust not need copy
if [ ! -f "Cargo.toml" ];then
cd $PKGDIR
exec_build
else
mkdir /build/
rsync -ra $PKGDIR /build
cd /build/data
exec_build
fi
fi