Updating Debian version to conform with expected numbering for upgrades

* Moving Debian changelog and Fedora specfile to input files and dynmaically updating versioning from OpenRGB.pro
* Resolves #2919
* Related #2666
This commit is contained in:
Chris 2023-02-14 14:47:26 +11:00 committed by Adam Honse
parent 643e51e71b
commit f8fe2ff7f8
6 changed files with 47 additions and 4 deletions

2
.gitignore vendored
View file

@ -6,6 +6,8 @@ OpenRGB
openrgb openrgb
OpenRGB-x86_64.AppImage OpenRGB-x86_64.AppImage
60-openrgb.rules 60-openrgb.rules
debian/changelog
fedora/OpenRGB.spec
# Directories # Directories
.build/ .build/

View file

@ -109,6 +109,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-32 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-32
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B - dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.*deb - rm -v ../openrgb-dbgsym*.*deb
@ -137,6 +138,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-64 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-64
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage -us -B - dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.*deb - rm -v ../openrgb-dbgsym*.*deb
@ -165,6 +167,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-32 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-32
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B - dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.*deb - rm -v ../openrgb-dbgsym*.*deb
@ -193,6 +196,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage -us -B - dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.*deb - rm -v ../openrgb-dbgsym*.*deb
@ -221,6 +225,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-32 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-32
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage --target-arch i386 -us -B - dpkg-buildpackage --target-arch i386 -us -B
- rm -v ../openrgb-dbgsym*.deb - rm -v ../openrgb-dbgsym*.deb
@ -249,6 +254,7 @@ before_script:
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-64 image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-64
stage: build stage: build
script: script:
- ./scripts/build-package-files.sh debian/changelog
- dpkg-architecture -l - dpkg-architecture -l
- dpkg-buildpackage -us -B - dpkg-buildpackage -us -B
- rm -v ../openrgb-dbgsym*.deb - rm -v ../openrgb-dbgsym*.deb
@ -278,6 +284,7 @@ before_script:
script: script:
- dnf install rpmdevtools dnf-plugins-core -y - dnf install rpmdevtools dnf-plugins-core -y
- rpmdev-setuptree - rpmdev-setuptree
- ./scripts/build-package-files.sh fedora/OpenRGB.spec
- ls /root/ - ls /root/
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS - cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
- cp ../OpenRGB /root/rpmbuild/SOURCES/ -r - cp ../OpenRGB /root/rpmbuild/SOURCES/ -r
@ -310,8 +317,9 @@ before_script:
image: fedora:36 image: fedora:36
stage: build stage: build
script: script:
- dnf install rpmdevtools dnf-plugins-core libcurl-devel -y - dnf install rpmdevtools dnf-plugins-core libcurl-devel qt5-qtbase-devel -y
- rpmdev-setuptree - rpmdev-setuptree
- ./scripts/build-package-files.sh fedora/OpenRGB.spec
- ls /root/ - ls /root/
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS - cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
- cp ../OpenRGB /root/rpmbuild/SOURCES/ -r - cp ../OpenRGB /root/rpmbuild/SOURCES/ -r

View file

@ -34,7 +34,10 @@ greaterThan(QT_MAJOR_VERSION, 4) {
#-----------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------#
# Application Configuration # # Application Configuration #
#-----------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------#
VERSION = 0.81 MAJOR = 0
MINOR = 8
REVISION = 1
VERSION = $$MAJOR"."$$MINOR$$REVISION
TARGET = OpenRGB TARGET = OpenRGB
TEMPLATE = app TEMPLATE = app

View file

@ -1,4 +1,4 @@
openrgb (0.81.1) UNRELEASED; urgency=medium openrgb (__VERSION__) UNRELEASED; urgency=medium
* Builds from git master. See git history for more information. * Builds from git master. See git history for more information.

View file

@ -1,7 +1,7 @@
%global _name OpenRGB %global _name OpenRGB
Name: openrgb Name: openrgb
Version: 0.8.1 Version: __VERSION__
Release: 0%{?dist} Release: 0%{?dist}
Summary: Open source RGB lighting control that doesn't depend on manufacturer software Summary: Open source RGB lighting control that doesn't depend on manufacturer software

30
scripts/build-package-files.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
PROJECT_FILE="OpenRGB.pro"
VERSION_PATTERN="__VERSION__"
INFILE_SUFFIX=".in"
if [ -z "$1" ]; then
echo "ERROR! No file give to parse."
exit 1
fi
INFILE_PATH=${1}${INFILE_SUFFIX}
if [ -e ${INFILE_PATH} ]; then
echo "ERROR! Source file ${INFILE_PATH} missing."
fi
if [ -e ${1} ]; then
echo "Warning: File ${1} exists and will be overwritten"
fi
MAJOR=$(grep MAJOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
MINOR=$(grep MINOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
REVISION=$(grep REVISION\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
#Convert Revision to a nummber in case it is blank in the project file
REVISION=$(( ${REVISION} + 0 ))
PACKAGE_VERSION="${MAJOR}.${MINOR}.${REVISION}"
sed -e "s/${VERSION_PATTERN}/${PACKAGE_VERSION}/g" ${INFILE_PATH} > ${1}