-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.sh
executable file
·113 lines (95 loc) · 2.63 KB
/
functions.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# source version info
function source_version_info {
if [ -f VERSION ]; then
. ./VERSION
else
echo "No VERSION-File, exit!"
exit 1
fi
if [ -f FLAVOUR ]; then
. ./FLAVOUR
else
echo "No FLAVOUR-File, exit!"
exit 1
fi
}
# eventually cleanup old builds
function cleanup_old_builds {
if [ -f ./debian/rules ]; then
debclean -d
rm debian/rules
echo "old builds cleaned up, run bootstrap again!"
return 1
fi
}
# debian cleanup
# ==============
function debian_cleanup {
rm -vrf debian/siduction-live-settings-*-*
rm -vrf debian/siduction-settings-*-*
rm -vf debian/files
rm -vf debian/*.init
rm -vf debian/*.install
rm -vf debian/*.lintian-overrides
rm -vf debian/*.log
rm -vf debian/*.postinst
rm -vf debian/*.preinst
rm -vf debian/*.postrm
rm -vf debian/*.service
}
# debian changelog
# ================
function debian_changelog {
if [ ! -f debian/changelog ]; then
sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
-e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
-e "s/\@VERSION\@/${VERSION}/g" \
-e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
-e "s/\@DISPLAY\@/${DISPLAY}/g" \
./debtemplate/changelog \
> ./debian/changelog
fi
}
# basic control
# =============
function basic_control {
sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
-e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
-e "s/\@VERSION\@/${VERSION}/g" \
-e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
-e "s/\@DISPLAY\@/${DISPLAY}/g" \
./debtemplate/control \
> ./debian/control
}
# grub template
# =============
function grub_template {
mkdir -p ./etc/default/grub.d
sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
-e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
-e "s/\@VERSION\@/${VERSION}/g" \
-e "s/\@FLAVOUR\@/${1}/g" \
-e "s/\@DISPLAY\@/${DISPLAY}/g" \
./template/etc/default/grub.d/siduction.cfg \
> ./etc/default/grub.d/siduction.cfg
}
# debian rules
# ============
function debian_rules {
sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
-e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
-e "s/\@VERSION\@/${VERSION}/g" \
-e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
-e "s/\@DISPLAY\@/${DISPLAY}/g" \
./debtemplate/rules \
> ./debian/rules
chmod 755 debian/rules
}
# debian_foo_basics
# =================
function debian_foo_basics {
mkdir -p ./debian/source
echo 1.0 > ./debian/source/format
echo 9 > ./debian/compat
}