diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 57c26ca3184..67b67d54007 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -26,6 +26,7 @@ jobs: echo "LNAV_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV echo "LNAV_VERSION_NUMBER=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV echo "version is: ${{ env.LNAV_VERSION }}" + make -C release lnav.spec - name: build RPM package id: rpm uses: tstack/rpmbuild@master diff --git a/docs/02_downloads.md b/docs/02_downloads.md index 7bf23c942d1..9c44192936a 100644 --- a/docs/02_downloads.md +++ b/docs/02_downloads.md @@ -19,6 +19,13 @@ Install from the [Snap Store](https://snapcraft.io/lnav): $ sudo snap install lnav ``` +Install RPMs from [Package Cloud](https://packagecloud.io/tstack/lnav): + +```console +$ curl -s https://packagecloud.io/install/repositories/tstack/lnav/script.rpm.sh | sudo bash +$ sudo yum install lnav +``` + ## MacOS diff --git a/release/Makefile b/release/Makefile index cd91b15abd7..f14174071b2 100644 --- a/release/Makefile +++ b/release/Makefile @@ -100,3 +100,6 @@ push: clean: cd vagrant-static && vagrant destroy -f rm -rf vagrant-static/pkgs + +lnav.spec: lnav.spec.in makespec.sh + ./makespec.sh < lnav.spec.in > $@ diff --git a/release/lnav.spec b/release/lnav.spec.in similarity index 98% rename from release/lnav.spec rename to release/lnav.spec.in index dd5f254aab9..3e4e299dc12 100644 --- a/release/lnav.spec +++ b/release/lnav.spec.in @@ -15,7 +15,7 @@ # published by the Open Source Initiative. Name: lnav -Version: 0.11.2 +Version: @@LNAV_VERSION_NUMBER@@ Release: 0 Summary: Logfile Navigator License: BSD-2-Clause diff --git a/release/makespec.sh b/release/makespec.sh new file mode 100755 index 00000000000..a6cb6fc654d --- /dev/null +++ b/release/makespec.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +DEFAULT_VERSION=$(head -1 ../configure.ac | cut -d, -f2) +DEFAULT_VERSION=${DEFAULT_VERSION#[} +DEFAULT_VERSION=${DEFAULT_VERSION%]} + +if [ "$GITHUB_REF_TYPE" == 'tag' ]; then + export LNAV_VERSION_NUMBER=${GITHUB_REF#refs/tags/v} +else + export LNAV_VERSION_NUMBER="${DEFAULT_VERSION}^"$(date +%Y%m%d).git$(git rev-parse --short HEAD) +fi + +sed -e "s/@@LNAV_VERSION_NUMBER@@/${LNAV_VERSION_NUMBER}/g"