forked from teejee2008/timeshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-installers.sh
executable file
·60 lines (42 loc) · 1.49 KB
/
build-installers.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
#!/bin/bash
for prog in pbuilder-dist make dpkg-source ; do
if sh -c "which $prog 2> /dev/null" ; then true ; else echo "You don\'t have $prog, install it" ; exit ; fi
done
backup=`pwd`
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR
. ./BUILD_CONFIG
rm -vf release/*.run
rm -vf release/*.deb
arches=""
if [ -z $1 ]; then
arches="i386 amd64"
# build deb
sh build-deb.sh
else
arches="$1"
# build deb
sh build-deb.sh "$1"
fi
for arch in $arches
do
rm -rfv release/${arch}/files
mkdir -pv release/${arch}/files
echo ""
echo "=========================================================================="
echo " build-installers.sh : $arch"
echo "=========================================================================="
echo ""
dpkg-deb -x release/${pkg_name}-v${pkg_version}-${arch}.deb release/${arch}/files
if [ $? -ne 0 ]; then cd "$backup"; echo "Failed"; exit 1;fi
echo "--------------------------------------------------------------------------"
rm -rfv release/${arch}/${pkg_name}*.* # remove source files created by pbuilder
cp -pv --no-preserve=ownership release/sanity.config release/${arch}/sanity.config
sanity --generate --base-path release/${arch} --out-path release --arch ${arch} --xz
if [ $? -ne 0 ]; then cd "$backup"; echo "Failed"; exit 1; fi
mv -v release/*${arch}.run release/${pkg_name}-v${pkg_version}-${arch}.run
echo "--------------------------------------------------------------------------"
done
cp -vf release/*.run ../PACKAGES/
cp -vf release/*.deb ../PACKAGES/
cd "$backup"