summaryrefslogtreecommitdiff
path: root/sign.sh
blob: 18ef181dfc30628220eb937248db266664c634fa (plain)
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
#!/bin/bash
set -e
shopt -s extglob nullglob

PKG_BASE=$(dirname "$(realpath "$0")")
cd "${PKG_BASE}"
PKG_RVSN=1

PKG_REPO="${PKG_BASE}/apt/"

cd "${PKG_REPO}/dists/ios/"

for PKG_CFTARG in */ */*/binary*/; do
    pushd ${PKG_CFTARG}
        {
        cat <<EOF
Origin: Bingner/Elucubratus
Label: Bingner/Elucubratus
Suite: stable
Version: 1.0r${PKG_RVSN}
Codename: ios
Architectures: iphoneos-arm
Components: main
Description: Distribution of Unix Software for iPhoneOS
Support: https://cydia.saurik.com/api/support/*
MD5Sum:
EOF

        find * -type f | grep -v Release | while read -r line; do
            echo " $(md5sum "${line}" | cut -d ' ' -f 1) $(stat -f %z "${line}" | cut -d $'\t' -f 1) ${line}"
        done

        } >"Release"

        rm -f Release.gpg InRelease
        if [[ ${PKG_CFTARG} == *iphoneos-arm* ]] || [[ -d main/binary-iphoneos-arm/ ]]; then
            gpg -abs -o Release.gpg Release
            gpg -as --clear-sign -o InRelease Release
        fi
    popd
done
diff -x Release.gpg -x InRelease -x Release -x Packages.xz -x Packages.bz2 -ur "${PKG_BASE}/apt-old/" "${PKG_REPO}"