-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·68 lines (68 loc) · 1.9 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
60
61
62
63
64
65
66
67
68
#!/bin/bash
VERSION=$(cat DEBIAN/control | grep 'Version: ' | sed 's/Version: //g')
PAK=$(cat DEBIAN/control | grep 'Package: ' | sed 's/Package: //g')
ARCH="$1"
if [ "$ARCH" == "" ] || [ "$ARCH" == "amd64" ] || [ "$ARCH" == "AMD64" ] || [ "$ARCH" == "AMD" ] || [ "$ARCH" == "amd" ] || [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "x86" ] || [ "$ARCH" == "x64" ]; then
ARCH="amd64"
elif [ "$ARCH" == "ARM" ] || [ "$ARCH" == "arm" ] || [ "$ARCH" == "ARM64" ] || [ "$ARCH" == "arm64" ]; then
ARCH="arm64"
fi
FOLDER="$PAK\_$VERSION\_$ARCH"
FOLDER=$(echo "$FOLDER" | sed 's/\\//g')
mkdir ../"$FOLDER"
##############################################################
# #
# #
# COMPILE ANYTHING NECSSARY HERE #
# #
# #
##############################################################
echo "Building for $ARCH"
##############################################################
# #
# #
# REMEMBER TO DELETE SOURCE FILES FROM TMP #
# FOLDER BEFORE BUILD #
# #
# #
##############################################################
if [ -d bin ]; then
cp -R bin ../"$FOLDER"/bin
fi
if [ -d etc ]; then
cp -R etc ../"$FOLDER"/etc
fi
if [ -d usr ]; then
cp -R usr ../"$FOLDER"/usr
fi
if [ -d lib ]; then
cp -R lib ../"$FOLDER"/lib
fi
if [ -d lib32 ]; then
cp -R lib32 ../"$FOLDER"/lib32
fi
if [ -d lib64 ]; then
cp -R lib64 ../"$FOLDER"/lib64
fi
if [ -d libx32 ]; then
cp -R libx32 ../"$FOLDER"/libx32
fi
if [ -d sbin ]; then
cp -R sbin ../"$FOLDER"/sbin
fi
if [ -d var ]; then
cp -R var ../"$FOLDER"/var
fi
if [ -d opt ]; then
cp -R opt ../"$FOLDER"/opt
fi
cp -R DEBIAN ../"$FOLDER"/DEBIAN
cd ..
# Remove and edit files
sed -i "s/<arch>/$ARCH/g" "$FOLDER"/DEBIAN/control
keep="locale-check-$ARCH"
mv "$FOLDER"/usr/bin/"$keep" "$FOLDER"/usr/bin/locale-check
rm "$FOLDER"/usr/bin/locale-check-*
# done
dpkg-deb --build "$FOLDER"
rm -rf "$FOLDER"