summaryrefslogtreecommitdiff
path: root/build-packages.sh
blob: b1eb05a2dbc4c696a8ef7d1439b9e6bdaff515f7 (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
#!/bin/sh

# requires devtools, devtools32 (for extra-i686-build)
# if debug variants of extra-* exist, use them (I have a custom script for this)

rm -rf artifacts/

for buildarch in x86_64 i686; do
    extradir=artifacts/${buildarch}-extracted

    if command -v debug-${buildarch}-build; then
        debug-${buildarch}-build
    else
        extra-${buildarch}-build
    fi

    CARCH=${buildarch} makepkg --packagelist | while read -r pkgfile; do
        if bsdtar -tf "${pkgfile}" usr/bin/pacman-static > /dev/null 2>&1; then
            mkdir -p ${extradir}
            bsdtar --strip-components 2 -C ${extradir} -xf "${pkgfile}" usr/bin/pacman-static
            break
        fi
    done

    xz -ke ${extradir}/pacman-static
    gpg --detach-sign ${extradir}/pacman-static
    gpg --detach-sign ${extradir}/pacman-static.xz
done