So I have recently bought two identical monitor and I told the seller to calibrate both of them. The seller gave me 2 *.icm files. But it is impossible to import directly in dom0 as everything is greyed out and my monitor did not even detected in XFCE's Color Profiles GUI. After a bit of research, it turns out that I need to install a program called xiccd, but it is not available in Fedora 42 repo. So I decided to build the package myself using its original source. I do all of these in a dispVM, but if you're paranoid about the internet traffic, just set firewall rules because this script needs access to github to grab the source files of xiccd and some dependencies needs to be installed from the repo. But firstly please bear with me if you find any error in this script, I stole this script from David King's github and modified a little bit.
mkrpms.sh
#!/usr/bin/env bash
SPECFILE="xiccd.spec"
set -e
# Get the full path to the spec file
SPECFILE=$(dirname "$(realpath "$0")")/$SPECFILE
MY_HOME=/home/$(env | grep SUDO_USER | sed 's/SUDO_USER=//g')
# Parse the package name, version and release out of the spec file
NAME=$(sed -n 's/^Name:[[:space:]]*//p' "$SPECFILE")
VERSION=$(sed -n 's/^Version:[[:space:]]*//p' "$SPECFILE")
RELEASE=$(sed -n 's/^Release:[[:space:]]*//;s/%{?dist}//p' "$SPECFILE")
ARCH=$(sed -n 's/^BuildArch:[[:space:]]*//p' "$SPECFILE")
# Create output directory
mkdir -p ${MY_HOME}/rpmbuild/RPMS/${ARCH}/
mkdir -p ${MY_HOME}/rpmbuild/SRPMS/
echo -e "\nUpdating system software and installing required dependencies ..."
dnf -y upgrade
dnf -y install wget gcc-c++ make autoconf automake libX11-devel libXrandr-devel glib2-devel colord-devel rpm-build
# Get the source file
SOURCE0=$(sed -n 's/^Source0:[[:space:]]*//p' "$SPECFILE")
SOURCE0=$(echo "$SOURCE0" | sed "s/%{name}/${NAME}/;s/%{version}/${VERSION}/")
wget -O "${HOME}/rpmbuild/SOURCES/${SOURCE0}" "https://github.com/agalakhov/xiccd/archive/v${VERSION}.tar.gz"
# Build the packages. Try twice, in case of an Access Exception, which happens occasionally
if ! rpmbuild -ba "$SPECFILE"; then
echo -e "\nrpmbuild failed, retrying rpmbuild ..."
rpmbuild -ba "$SPECFILE"
fi
echo -e "\nCopying RPM files to host system ..."
mv ${HOME}/rpmbuild/RPMS/${ARCH}/${NAME}-${VERSION}-${RELEASE}.*.${ARCH}.rpm ${MY_HOME}/rpmbuild/RPMS/${ARCH}/
mv ${HOME}/rpmbuild/SRPMS/${NAME}-${VERSION}-${RELEASE}.*.src.rpm ${MY_HOME}/rpmbuild/SRPMS/
echo -e " OK!"
Create xiccd.spec with the following contents xiccd.spec
# A RPM SPEC File For Building xiccd RPM Packages
#
# Copyright (C) 2020 David King <dave@daveking.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Name: xiccd
Version: 0.4.1
Release: 2%{?dist}
Summary: A simple bridge between colord and X
License: GPLv3
URL: https://github.com/agalakhov/xiccd
Source0: %{name}-%{version}.tar.gz
BuildArch: x86_64
Requires: xfce4-settings >= 4.14
Requires: colord >= 1.4.4
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libX11-devel
BuildRequires: libXrandr-devel
BuildRequires: glib2-devel
BuildRequires: colord-devel
%description
xiccd is a simple bridge between colord and X. It is used to enable the
xfce4-color-settings tool in the XFCE desktop. This allows for simple
configuration of the color profiles that the colord daemon loads for
displays attached to these systems.
%prep
%setup
%build
touch NEWS README AUTHORS
git init
git config user.email "user@example.com"
git config user.name "user"
git add .
git commit -m %{version}
autoreconf -i
./configure --prefix=/usr
make %{?_smp_mflags}
%install
make PREFIX=/usr DESTDIR=%{?buildroot} install
mkdir -p %{buildroot}/etc/xdg/autostart
mv %{buildroot}/usr/etc/xdg/autostart/xiccd.desktop %{buildroot}/etc/xdg/autostart/
%files
/usr/share/doc/xiccd/README.md
%license COPYING
/usr/bin/xiccd
/etc/xdg/autostart/xiccd.desktop
/usr/share/man/man8/xiccd.8.gz
%changelog
* Fri Feb 28 2020 David King <dave@daveking.com> - 0.3.0-1
Initial Version
* Fri Feb 28 2020 David King <dave@daveking.com> - 0.3.0-2
Correct placement of xiccd.desktop
Finally lets build it sudo ./mkrpms.sh
sudo rpm -Uvh xiccd.blah.blah.rpmxiccd -VCredits:
It would be a pleasure if anyone care enough to correct my bash script mod and host it to github or somewhere as I dont have github