-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·61 lines (60 loc) · 1.49 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
#!/bin/bash
VERSION=$(cat DEBIAN/control | grep 'Version: ' | sed 's/Version: //g')
PAK=$(cat DEBIAN/control | grep 'Package: ' | sed 's/Package: //g')
ARCH=$(cat DEBIAN/control | grep 'Architecture: '| sed 's/Architecture: //g')
FOLDER="$PAK\_$VERSION\_$ARCH"
FOLDER=$(echo "$FOLDER" | sed 's/\\//g')
mkdir ../"$FOLDER"
##############################################################
# #
# #
# COMPILE ANYTHING NECSSARY HERE #
# #
# #
##############################################################
##############################################################
# #
# #
# REMEMBER TO DELETE SOURCE FILES FROM TMP #
# FOLDER BEFORE BUILD #
# AND BINARY FILES FROM SOURCE DIR
# #
# #
##############################################################
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 ..
#DELETE STUFF HERE
#build the shit
#build config
dpkg-deb --build "$FOLDER"
rm -rf "$FOLDER"