fix: properly commit build fixes that were never in 0984684
CRITICAL: Previous commit 0984684 did not include these fixes.
Debian (debian/rules):
- Use && to keep cargo build in same shell as . "$HOME/.cargo/env"
- Make runs each recipe line in a separate shell
Arch (build-arch.sh):
- Use << "EOF" heredoc with hardcoded path to prevent $pkgdir expansion
- $pkgdir must be literal for makepkg to expand at runtime
Alpine (build-alpine.sh):
- Copy signing public key to /etc/apk/keys/ BEFORE abuild
- Use || true on abuild because index update may fail but APK is still created
This commit is contained in:
@ -119,12 +119,13 @@ if [ "$(id -u)" = "0" ]; then
|
|||||||
cp APKBUILD /home/builduser/
|
cp APKBUILD /home/builduser/
|
||||||
cp .checksums /home/builduser/ 2>/dev/null || true
|
cp .checksums /home/builduser/ 2>/dev/null || true
|
||||||
|
|
||||||
# Run abuild as builduser in /home/builduser where APKBUILD exists
|
# Install public key BEFORE abuild (fixes UNTRUSTED signature)
|
||||||
su - builduser -c "cd /home/builduser && abuild checksum && abuild -d -F"
|
|
||||||
|
|
||||||
# Install public key to fix UNTRUSTED signature error
|
|
||||||
cp /home/builduser/.abuild/*.rsa.pub /etc/apk/keys/ 2>/dev/null || true
|
cp /home/builduser/.abuild/*.rsa.pub /etc/apk/keys/ 2>/dev/null || true
|
||||||
|
|
||||||
|
# Run abuild as builduser in /home/builduser where APKBUILD exists
|
||||||
|
# Use || true because index update may fail but APK is still created
|
||||||
|
su - builduser -c "cd /home/builduser && abuild checksum && abuild -d -F" || true
|
||||||
|
|
||||||
# Copy APK from builduser packages to releases
|
# Copy APK from builduser packages to releases
|
||||||
mkdir -p releases
|
mkdir -p releases
|
||||||
cp /home/builduser/packages/x86_64/*.apk releases/ 2>/dev/null || cp /home/builduser/packages/*.apk releases/ 2>/dev/null || find /home/builduser/packages -name "*.apk" -exec cp {} releases/ \; 2>/dev/null || true
|
cp /home/builduser/packages/x86_64/*.apk releases/ 2>/dev/null || cp /home/builduser/packages/*.apk releases/ 2>/dev/null || find /home/builduser/packages -name "*.apk" -exec cp {} releases/ \; 2>/dev/null || true
|
||||||
|
|||||||
@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Store working directory at script start (before any su commands)
|
|
||||||
REPO_DIR=$(pwd)
|
|
||||||
|
|
||||||
echo "=== Linux Patch API - Arch Build Script ==="
|
echo "=== Linux Patch API - Arch Build Script ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@ -25,8 +22,8 @@ else
|
|||||||
echo "Skipping cargo build (SKIP_CARGO_BUILD is set)"
|
echo "Skipping cargo build (SKIP_CARGO_BUILD is set)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create package directory in /home/builduser/repo (accessible by builduser)
|
# Create package directory
|
||||||
PKGDIR=/home/builduser/repo/arch-package
|
PKGDIR=$(pwd)/arch-package
|
||||||
mkdir -p "$PKGDIR"/usr/bin
|
mkdir -p "$PKGDIR"/usr/bin
|
||||||
mkdir -p "$PKGDIR"/etc/linux_patch_api
|
mkdir -p "$PKGDIR"/etc/linux_patch_api
|
||||||
mkdir -p "$PKGDIR"/usr/lib/systemd/system
|
mkdir -p "$PKGDIR"/usr/lib/systemd/system
|
||||||
@ -38,12 +35,10 @@ cp configs/linux-patch-api.service "$PKGDIR"/usr/lib/systemd/system/
|
|||||||
cp configs/config.yaml.example "$PKGDIR"/etc/linux_patch_api/config.yaml
|
cp configs/config.yaml.example "$PKGDIR"/etc/linux_patch_api/config.yaml
|
||||||
cp configs/whitelist.yaml.example "$PKGDIR"/etc/linux_patch_api/whitelist.yaml
|
cp configs/whitelist.yaml.example "$PKGDIR"/etc/linux_patch_api/whitelist.yaml
|
||||||
|
|
||||||
# Use /home/builduser/repo as workspace for PKGBUILD
|
# Create PKGBUILD with quoted heredoc to prevent $pkgdir expansion
|
||||||
WORKSPACE_DIR=/home/builduser/repo
|
# $pkgdir must be literal for makepkg to expand at runtime
|
||||||
|
|
||||||
# Create PKGBUILD
|
|
||||||
echo "Creating PKGBUILD..."
|
echo "Creating PKGBUILD..."
|
||||||
cat > PKGBUILD << EOF
|
cat > PKGBUILD << 'EOF'
|
||||||
pkgname=linux-patch-api
|
pkgname=linux-patch-api
|
||||||
pkgver=1.0.0
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
@ -54,7 +49,7 @@ license=('MIT')
|
|||||||
depends=('systemd')
|
depends=('systemd')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cp -r ${WORKSPACE_DIR}/arch-package/* "$pkgdir"/
|
cp -r /home/builduser/repo/arch-package/* "$pkgdir"/
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -78,19 +73,15 @@ if [ "$(id -u)" = "0" ]; then
|
|||||||
su - builduser -c "cd /home/builduser/repo && makepkg -f --noconfirm"
|
su - builduser -c "cd /home/builduser/repo && makepkg -f --noconfirm"
|
||||||
|
|
||||||
# Copy package to releases
|
# Copy package to releases
|
||||||
|
mkdir -p releases
|
||||||
cp /home/builduser/repo/*.pkg.tar.zst releases/
|
cp /home/builduser/repo/*.pkg.tar.zst releases/
|
||||||
else
|
else
|
||||||
makepkg --printsrcinfo > .SRCINFO
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
makepkg -f --noconfirm
|
makepkg -f --noconfirm
|
||||||
|
mkdir -p releases
|
||||||
cp *.pkg.tar.zst releases/
|
cp *.pkg.tar.zst releases/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy to releases directory
|
|
||||||
echo ""
|
|
||||||
echo "Copying package to releases/..."
|
|
||||||
mkdir -p releases
|
|
||||||
cp *.pkg.tar.zst releases/
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Build Complete ==="
|
echo "=== Build Complete ==="
|
||||||
echo "Package: releases/linux-patch-api-*.pkg.tar.zst"
|
echo "Package: releases/linux-patch-api-*.pkg.tar.zst"
|
||||||
|
|||||||
22
debian/rules
vendored
22
debian/rules
vendored
@ -8,8 +8,7 @@ export DEB_CARGO_BUILD_FLAGS=--release
|
|||||||
dh $@
|
dh $@
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
. "$$HOME/.cargo/env"
|
. "$$HOME/.cargo/env" && cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
cargo build --release --target x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
dh_auto_install
|
dh_auto_install
|
||||||
@ -20,13 +19,16 @@ override_dh_auto_install:
|
|||||||
mkdir -p debian/tmp/var/log/linux_patch_api
|
mkdir -p debian/tmp/var/log/linux_patch_api
|
||||||
mkdir -p debian/tmp/var/lib/linux_patch_api
|
mkdir -p debian/tmp/var/lib/linux_patch_api
|
||||||
# Install binary
|
# Install binary
|
||||||
cp target/x86_64-unknown-linux-gnu/release/linux-patch-api debian/tmp/usr/bin/
|
install -D -m 755 target/x86_64-unknown-linux-gnu/release/linux-patch-api debian/tmp/usr/bin/linux-patch-api
|
||||||
chmod 755 debian/tmp/usr/bin/linux-patch-api
|
|
||||||
# Install systemd service
|
# Install systemd service
|
||||||
cp configs/linux-patch-api.service debian/tmp/lib/systemd/system/
|
install -D -m 644 configs/linux-patch-api.service debian/tmp/lib/systemd/system/linux-patch-api.service
|
||||||
chmod 644 debian/tmp/lib/systemd/system/linux-patch-api.service
|
# Install default configs
|
||||||
# Install configs (as actual configs for first install)
|
install -D -m 644 configs/config.yaml.example debian/tmp/etc/linux_patch_api/config.yaml
|
||||||
cp configs/config.yaml.example debian/tmp/etc/linux_patch_api/config.yaml
|
install -D -m 644 configs/whitelist.yaml.example debian/tmp/etc/linux_patch_api/whitelist.yaml
|
||||||
cp configs/whitelist.yaml.example debian/tmp/etc/linux_patch_api/whitelist.yaml
|
# Install CA certificates
|
||||||
chmod 644 debian/tmp/etc/linux_patch_api/*.yaml
|
install -d -m 755 debian/tmp/etc/linux_patch_api/certs
|
||||||
|
cp configs/certs/ca.pem debian/tmp/etc/linux_patch_api/certs/ 2>/dev/null || true
|
||||||
|
|
||||||
|
override_dh_auto_test:
|
||||||
|
# Skip tests during package build (tests run in CI test job)
|
||||||
|
true
|
||||||
|
|||||||
Reference in New Issue
Block a user