-
Notifications
You must be signed in to change notification settings - Fork 3
/
make-deb.sh
35 lines (31 loc) · 1.11 KB
/
make-deb.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
#!/bin/bash
PACKAGE_NAME=r3bu5
R3BU5_VERSION=2.2
PACKAGE_ARCH=all
DISTRO=$(uname -o)
build_package() {
# define variables depending on detected platform
distr_name=$1
if [ "$distr_name" == "Android" ]; then
platform="Termux"
path_part="data/data/com.termux/files/"
else
platform="Debian"
path_part=""
fi
# print out message with detected platform
echo "Building .deb package for: $platform"
# run preparations and build package
platform=${platform^^}
mkdir -p ./package/DEBIAN
mkdir -p ./package/"$path_part"usr/bin
mkdir -p ./package/"$path_part"usr/opt
cp -rf ./.package/"$platform"/control ./package/DEBIAN/control
mkdir -p package/"$path_part"usr/opt/$PACKAGE_NAME
cp -rf ./LICENSE ./.sites ./.imgs ./r3bu5.sh ./package/"$path_part"usr/opt/$PACKAGE_NAME
cp -rf ./.package/launch.sh ./package/"$path_part"usr/bin/$PACKAGE_NAME
chmod 755 ./package/DEBIAN
dpkg-deb --build ./package $PACKAGE_NAME\_$R3BU5_VERSION\_$PACKAGE_ARCH.deb
}
# launch the build
build_package $DISTRO