-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·60 lines (51 loc) · 2 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
#!/bin/bash
GPG_KEY_FINGERPRINT="0B0F7A231A84F7EE9B8128CABEBCAB631F88D239"
OUTPUT_DIR="publish"
cd "$(dirname "$0")" || exit 1
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR/{rootrw,rootless}
dirs=(./pool ./pool/iphoneos-arm ./pool/iphoneos-arm64)
set_arch_vars() {
case $(basename "$1") in
pool)
output_dir=$OUTPUT_DIR
;;
iphoneos-arm)
output_dir=$OUTPUT_DIR/rootrw
;;
iphoneos-arm64)
output_dir=$OUTPUT_DIR/rootless
;;
esac
}
for dir in "${dirs[@]}"; do
set_arch_vars "$dir"
apt-ftparchive packages "$dir" > "$output_dir/Packages"
echo >> "$output_dir/Packages"
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
for dir in "${dirs[@]}"; do
set_arch_vars "$dir"
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="Echo's Repo" \
-o APT::FTPArchive::Release::Label="Echo's Repo" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Version="1.0" \
-o APT::FTPArchive::Release::Codename="echos-repo" \
-o APT::FTPArchive::Release::Architectures="iphoneos-arm iphoneos-arm64" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Description="A repo for small but helpful tweaks. Made by CallMeEcho" \
release "$output_dir" > "$output_dir/Release"
done
for dir in "${dirs[@]}"; do
set_arch_vars "$dir"
gpg -abs -u "$GPG_KEY_FINGERPRINT" -o "$output_dir/Release.gpg" "$output_dir/Release"
gpg -abs -u "$GPG_KEY_FINGERPRINT" --clearsign -o "$output_dir/InRelease" "$output_dir/Release"
done
cp -R pool "$OUTPUT_DIR"
cp -R static/* "$OUTPUT_DIR"