chore: add xh rpm #74

Merged
unkinben merged 1 commits from benvin/xh into master 2025-12-30 20:49:49 +11:00
3 changed files with 70 additions and 0 deletions

18
rpms/xh/metadata.yaml Normal file
View File

@ -0,0 +1,18 @@
---
arch: amd64
builds:
- image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
release: '1'
repository: [almalinux/el8]
version: 0.25.3
- image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: '1'
repository: [almalinux/el9]
version: 0.25.3
description: A friendly and fast tool for sending HTTP requests (HTTPie reimplementation in Rust)
github: ducaale/xh
homepage: https://github.com/ducaale/xh
license: MIT
maintainer: ducaale
name: xh
platform: linux

14
rpms/xh/resources/build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/bash
set -e
# Download and extract xh
wget -O /app/xh-v${PACKAGE_VERSION}-x86_64-unknown-linux-musl.tar.gz https://github.com/ducaale/xh/releases/download/v${PACKAGE_VERSION}/xh-v${PACKAGE_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar xf /app/xh-v${PACKAGE_VERSION}-x86_64-unknown-linux-musl.tar.gz
mv /app/xh-v${PACKAGE_VERSION}-x86_64-unknown-linux-musl/* /app/
# Process the nfpm.yaml template with environment variables
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
# Build the RPM
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm

View File

@ -0,0 +1,38 @@
# nfpm.yaml
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: ${PACKAGE_ARCH}
platform: ${PACKAGE_PLATFORM}
section: default
priority: extra
description: "${PACKAGE_DESCRIPTION}"
maintainer: ${PACKAGE_MAINTAINER}
homepage: ${PACKAGE_HOMEPAGE}
license: ${PACKAGE_LICENSE}
disable_globbing: false
replaces:
- xh
provides:
- xh
# Files to include in the package
contents:
- src: /app/xh
dst: /usr/bin/xh
file_info:
mode: 0755
owner: root
group: root
# Scripts to run during installation/removal (optional)
# scripts:
# preinstall: ./scripts/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh