-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·66 lines (58 loc) · 2.17 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
#!/bin/bash
GPG_KEY="EF6B6FC67D601586841C19EB83EFDEAEB3541290"
OUTPUT_DIR="."
script_full_path=$(dirname "$0")
cd "$script_full_path" || exit 1
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR/{rootful,rootless}
dirs=(./pool ./pool/iphoneos-arm ./pool/iphoneos-arm64)
set_arch_vars() {
case $(basename "$1") in
pool)
output_dir=$OUTPUT_DIR
extra=(extra_packages*)
;;
iphoneos-arm)
output_dir=$OUTPUT_DIR/rootful
extra=(extra_packages_rootful)
;;
iphoneos-arm64)
output_dir=$OUTPUT_DIR/rootless
extra=(extra_packages_rootless)
;;
esac
}
echo "[*] Generando paquetes..."
for d in "${dirs[@]}"; do
set_arch_vars "$d"
apt-ftparchive packages "$d" > $output_dir/Packages
echo >> $output_dir/Packages
cat "${extra[@]}" >> $output_dir/Packages 2>/dev/null
zstd -q -c19 $output_dir/Packages > $output_dir/Packages.zst
xz -c9 $output_dir/Packages > $output_dir/Packages.xz
bzip2 -c9 $output_dir/Packages > $output_dir/Packages.bz2
gzip -nc9 $output_dir/Packages > $output_dir/Packages.gz
lzma -c9 $output_dir/Packages > $output_dir/Packages.lzma
lz4 -c9 $output_dir/Packages > $output_dir/Packages.lz4
done
echo "[*] Generando release..."
for d in "${dirs[@]}"; do
set_arch_vars "$d"
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="DeciBelioS - REPO" \
-o APT::FTPArchive::Release::Label="DeciBelioS - REPO" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Version="1.0" \
-o APT::FTPArchive::Release::Codename="decibelios-repo" \
-o APT::FTPArchive::Release::Architectures="iphoneos-arm iphoneos-arm64" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Description="DeciBelioS - REPO" \
release $output_dir > $output_dir/Release
done
echo "[*] Firma de release mediante clave GPG..."
for d in "${dirs[@]}"; do
set_arch_vars "$d"
gpg -abs -u $GPG_KEY -o $output_dir/Release.gpg $output_dir/Release
gpg -abs -u $GPG_KEY --clearsign -o $output_dir/InRelease $output_dir/Release
done
echo "[*] ¡Hecho!"