-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·54 lines (47 loc) · 2.16 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
#!/bin/bash
GPG_KEY="F3594A65343002C55E35FB1E9E7E89B50CCF8DAA"
OUTPUT_DIR="publish"
ARCHS="iphoneos-arm"
script_full_path=$(dirname "$0")
cd "$script_full_path" || exit 1
rm -rf $OUTPUT_DIR
mkdir $OUTPUT_DIR
echo "[*] Generating Packages..."
apt-ftparchive packages ./pool > $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
echo "[*] Generating Contents"
for arch in ${ARCHS}; do
apt-ftparchive contents ./pool/"${arch}" > $OUTPUT_DIR/Contents-"${arch}"
zstd -q -c19 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".zst
xz -c9 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".xz
bzip2 -c9 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".bz2
gzip -nc9 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".gz
lzma -c9 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".lzma
lz4 -c9 $OUTPUT_DIR/Contents-"${arch}" > $OUTPUT_DIR/Contents-"${arch}".lz4
done
echo "[*] Generating Release..."
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="palera1n Legacy" \
-o APT::FTPArchive::Release::Label="palera1n-legacy" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Version="1.0" \
-o APT::FTPArchive::Release::Codename="palera1n-legacy-repo" \
-o APT::FTPArchive::Release::Architectures="${ARCHS}" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Description="palera1n's legacy repo" \
release $OUTPUT_DIR > $OUTPUT_DIR/Release
echo "[*] Signing Release using GPG Key..."
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
echo "[*] Copying files..."
cp -R pool "$OUTPUT_DIR"
cp *.png "$OUTPUT_DIR"
cp index.html "$OUTPUT_DIR"
mkdir "$OUTPUT_DIR/styles"
cp -R styles/* "$OUTPUT_DIR/styles"
echo "[*] Done!"