diff --git a/.gitignore b/.gitignore index 7c4d76ee..7e849296 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ OpenRGB openrgb OpenRGB-x86_64.AppImage 60-openrgb.rules +debian/changelog +fedora/OpenRGB.spec # Directories .build/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90381c2e..f64907fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,6 +109,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-32 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage --target-arch i386 -us -B - rm -v ../openrgb-dbgsym*.*deb @@ -137,6 +138,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:buster-64 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage -us -B - rm -v ../openrgb-dbgsym*.*deb @@ -165,6 +167,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-32 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage --target-arch i386 -us -B - rm -v ../openrgb-dbgsym*.*deb @@ -193,6 +196,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bullseye-64 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage -us -B - rm -v ../openrgb-dbgsym*.*deb @@ -221,6 +225,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-32 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage --target-arch i386 -us -B - rm -v ../openrgb-dbgsym*.deb @@ -249,6 +254,7 @@ before_script: image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-64 stage: build script: + - ./scripts/build-package-files.sh debian/changelog - dpkg-architecture -l - dpkg-buildpackage -us -B - rm -v ../openrgb-dbgsym*.deb @@ -278,6 +284,7 @@ before_script: script: - dnf install rpmdevtools dnf-plugins-core -y - rpmdev-setuptree + - ./scripts/build-package-files.sh fedora/OpenRGB.spec - ls /root/ - cp fedora/OpenRGB.spec /root/rpmbuild/SPECS - cp ../OpenRGB /root/rpmbuild/SOURCES/ -r @@ -310,8 +317,9 @@ before_script: image: fedora:36 stage: build script: - - dnf install rpmdevtools dnf-plugins-core libcurl-devel -y + - dnf install rpmdevtools dnf-plugins-core libcurl-devel qt5-qtbase-devel -y - rpmdev-setuptree + - ./scripts/build-package-files.sh fedora/OpenRGB.spec - ls /root/ - cp fedora/OpenRGB.spec /root/rpmbuild/SPECS - cp ../OpenRGB /root/rpmbuild/SOURCES/ -r diff --git a/OpenRGB.pro b/OpenRGB.pro index 587dddb4..f5f84123 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -34,7 +34,10 @@ greaterThan(QT_MAJOR_VERSION, 4) { #-----------------------------------------------------------------------------------------------# # Application Configuration # #-----------------------------------------------------------------------------------------------# -VERSION = 0.81 +MAJOR = 0 +MINOR = 8 +REVISION = 1 +VERSION = $$MAJOR"."$$MINOR$$REVISION TARGET = OpenRGB TEMPLATE = app diff --git a/debian/changelog b/debian/changelog.in similarity index 74% rename from debian/changelog rename to debian/changelog.in index fb0fef91..e7f8b732 100644 --- a/debian/changelog +++ b/debian/changelog.in @@ -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. diff --git a/fedora/OpenRGB.spec b/fedora/OpenRGB.spec.in similarity index 98% rename from fedora/OpenRGB.spec rename to fedora/OpenRGB.spec.in index b67de899..169160cb 100644 --- a/fedora/OpenRGB.spec +++ b/fedora/OpenRGB.spec.in @@ -1,7 +1,7 @@ %global _name OpenRGB Name: openrgb -Version: 0.8.1 +Version: __VERSION__ Release: 0%{?dist} Summary: Open source RGB lighting control that doesn't depend on manufacturer software diff --git a/scripts/build-package-files.sh b/scripts/build-package-files.sh new file mode 100755 index 00000000..7d08f3dc --- /dev/null +++ b/scripts/build-package-files.sh @@ -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}