diff --git a/rpms/xh/metadata.yaml b/rpms/xh/metadata.yaml new file mode 100644 index 0000000..672f86e --- /dev/null +++ b/rpms/xh/metadata.yaml @@ -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 diff --git a/rpms/xh/resources/build.sh b/rpms/xh/resources/build.sh new file mode 100755 index 0000000..b3bc86d --- /dev/null +++ b/rpms/xh/resources/build.sh @@ -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 \ No newline at end of file diff --git a/rpms/xh/resources/nfpm.yaml b/rpms/xh/resources/nfpm.yaml new file mode 100644 index 0000000..dfdfc6b --- /dev/null +++ b/rpms/xh/resources/nfpm.yaml @@ -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