Skip to content

Instantly share code, notes, and snippets.

@bobpaul
Last active December 14, 2024 15:39
Show Gist options
  • Save bobpaul/708c7be59ad491ae141c9221e89dfc0d to your computer and use it in GitHub Desktop.
Save bobpaul/708c7be59ad491ae141c9221e89dfc0d to your computer and use it in GitHub Desktop.
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
pkgname=rpm-tools-git
pkgver=4.20.0.r536.gf9f124a67
pkgrel=1
pkgdesc="RPM Package Manager"
arch=('i686' 'x86_64' 'powerpc64le')
url="https://rpm.org/"
license=('GPL')
depends=('glibc' 'elfutils' 'file' 'libarchive' 'libcap' 'lmdb' 'lua' 'nss' 'popt' 'zstd' 'libsequoia' 'libselinux')
makedepends=('git' 'python' 'rpm-tools')
provides=("rpm-tools=$pkgver" 'rpmextract')
conflicts=('rpm-tools' 'rpmextract')
source=("git+https://github.com/rpm-software-management/rpm.git"
"rpmextract.sh::https://gitlab.archlinux.org/archlinux/packaging/packages/rpm-tools/-/raw/main/rpmextract.sh")
sha256sums=('SKIP'
'SKIP')
pkgver() {
cd "rpm"
_tag=$(git tag -l --sort -v:refname | grep -E '^rpm-[0-9\.]+-release' | head -n1)
_rev=$(git rev-list --count $_tag..HEAD)
_hash=$(git rev-parse --short HEAD)
printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^rpm-//;s/-release//'
}
prepare() {
cd rpm
# if rpm-tools is not already installed, build and install first without sequoia to satisfy the circular build dep
# cmake -DWITH_SEQUOIA=OFF -B _build
cmake -B _build
}
check() {
cd "rpm"
cmake --build _build
}
build() {
cd "rpm"
ctest --test-dir _build
}
package() {
cd "rpm/_build"
make DESTDIR="$pkgdir" install
install -Dm755 "$srcdir/rpmextract.sh" -t "$pkgdir/usr/bin"
rm -rf "$pkgdir/usr/var"
}
@bobpaul
Copy link
Author

bobpaul commented Dec 14, 2024

First build must be with cmake -DWITH_SEQUOIA=OFF -B _build during prepare. Then install rpm-tools-git and rebuild with sequoia enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment