-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_deb_repo.sh
executable file
·63 lines (50 loc) · 1.63 KB
/
build_deb_repo.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
#!/usr/bin/env bash
set -e
rm -rf deb_repo
if ! [ -e qmk ]; then
echo
echo '*** Building the qmk .deb package:'
echo
./build_deb_package.sh
fi
# Import the GPG key
if [ -n "$QMK_GPG_PRIVATE_KEY" ]; then
echo '*** Importing GPG key...'
echo "$QMK_GPG_PRIVATE_KEY" | gpg --batch --import
else
echo -e '\n*** Warning: Could not import GPG key!\n'
fi
set -x
. /etc/os-release
ARCHITECTURES="i386 amd64 arm arm64"
# Create the repo structure
mkdir -p deb_repo/deb
cp qmk/*.deb deb_repo/deb
cd deb_repo
# Sign the packages
export PATH="$PATH:/usr/share/debdelta"
dpkg-sig -s builder -k 305A22FBF6427314212C61E88B748CC185DF5DA1 deb/*.deb
# Build the repo metadata
for arch in $ARCHITECTURES; do
mkdir -p main/binary-$arch
apt-ftparchive packages deb | sed "s,^Filename: ,Filename: dists/${VERSION_CODENAME}/," > main/binary-${arch}/Packages
gzip -k main/binary-${arch}/Packages
done
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="QMK" \
-o APT::FTPArchive::Release::Label="QMK $ID Package" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Codename="$VERSION_CODENAME" \
-o APT::FTPArchive::Release::Architectures="i386 amd64 arm arm64" \
-o APT::FTPArchive::Release::Components="main" \
release . > Release
# Sign the repo for security
gpg --default-key 305A22FBF6427314212C61E88B748CC185DF5DA1 -abs -o Release.gpg Release
gpg --default-key 305A22FBF6427314212C61E88B748CC185DF5DA1 --clearsign -o InRelease Release
# Debugging information
cd ..
find deb_repo -type f -ls
echo MD5: $(md5sum deb_repo/deb/*.deb)
echo SHA256: $(sha256sum deb_repo/deb/*.deb)
echo Packages:
cat deb_repo/main/binary-amd64/Packages