34bce98
Name:           ckb-next
77f2949
Version:        0.5.0
5c85e43
Release:        1%{?dist}
34bce98
Summary:        Unofficial driver for Corsair RGB keyboards
34bce98
34bce98
# ckb-next is GPLv2
34bce98
# The kissfft library (src/libs/kissfft) is BSD
34bce98
License:        GPLv2 and BSD
34bce98
34bce98
URL:            https://github.com/ckb-next/ckb-next
34bce98
Source0:        %{URL}/archive/v%{version}/%{name}-%{version}.tar.gz
34bce98
34bce98
# Upstream provides none of the following files
34bce98
Source1:        ckb-next.appdata.xml
34bce98
Source2:        ckb-next.1
34bce98
Source3:        99-ckb-next.preset
34bce98
34bce98
BuildRequires:  cmake
34bce98
BuildRequires:  desktop-file-utils
34bce98
BuildRequires:  gcc-c++
a2dcda0
BuildRequires:  make
34bce98
BuildRequires:  libappstream-glib
a2dcda0
BuildRequires:  qt5-linguist
a2dcda0
a2dcda0
BuildRequires:  dbusmenu-qt5-devel
a2dcda0
BuildRequires:  libappindicator-devel
34bce98
BuildRequires:  libgudev-devel
a2dcda0
BuildRequires:  libxcb-devel
34bce98
BuildRequires:  pulseaudio-libs-devel
34bce98
BuildRequires:  qt5-qtbase-devel >= 5.2.0
a2dcda0
BuildRequires:  qt5-qtx11extras-devel
34bce98
BuildRequires:  quazip-qt5-devel >= 0.7.3
a2dcda0
BuildRequires:  xcb-util-devel
a2dcda0
BuildRequires:  xcb-util-wm-devel
34bce98
BuildRequires:  zlib-devel
34bce98
34bce98
BuildRequires:  systemd-devel
34bce98
%{?systemd_requires}
34bce98
34bce98
Requires:       qt5-qtbase >= 5.2.0
34bce98
Requires:       qt5ct
34bce98
34bce98
Provides:       bundled(kissfft)
34bce98
77f2949
# ckb-next, as the name suggests, is a re-activation and continuation of "ckb".
77f2949
# The last released version of the original "ckb" was 0.2.7.
77f2949
Obsoletes:      ckb < 0.2.8-0
34bce98
34bce98
34bce98
%description
34bce98
ckb-next is an open-source driver for Corsair keyboards and mice. It aims to
34bce98
bring the features of their proprietary CUE software to the Linux operating
34bce98
system. This project is currently a work in progress, but it already
34bce98
supports much of the same functionality, including full RGB animations.
34bce98
34bce98
34bce98
%prep
34bce98
%setup -q
34bce98
34bce98
# Remove the bundled quazip library
34bce98
rm -rf src/libs/quazip
34bce98
34bce98
# Fedora uses /usr/libexec for daemons
34bce98
sed -e '/^ExecStart/cExecStart=%{_libexecdir}/ckb-next-daemon' -i linux/systemd/ckb-next-daemon.service.in
34bce98
a2dcda0
# Fedora has merged /lib into /usr/lib
a2dcda0
sed -e 's|"/lib/udev/rules.d"|"%{_udevrulesdir}"|g' -i CMakeLists.txt
a2dcda0
34bce98
34bce98
%build
a2dcda0
%cmake \
34bce98
  -DCMAKE_BUILD_TYPE=Release \
a2dcda0
  -DCMAKE_INSTALL_PREFIX=%{_prefix} \
a2dcda0
  -DCMAKE_INSTALL_LIBEXECDIR=libexec \
a2dcda0
  -DDISABLE_UPDATER=1 \
a2dcda0
  -DFORCE_INIT_SYSTEM=systemd \
34bce98
  -DSAFE_INSTALL=OFF \
34bce98
  -DSAFE_UNINSTALL=OFF \
34bce98
  -DWITH_SHIPPED_QUAZIP=OFF \
a2dcda0
  ./
a2dcda0
%cmake_build
34bce98
34bce98
# Color freeze fix
a2dcda0
sed -e '/^Exec=/cExec=env QT_QPA_PLATFORMTHEME=qt5ct %{_bindir}/ckb-next' -i %{_vpath_builddir}/src/gui/ckb-next.desktop
34bce98
34bce98
34bce98
%install
a2dcda0
%cmake_install
34bce98
a2dcda0
# Move the daemon from /usr/bin/ to /usr/libexec
a2dcda0
mv %{buildroot}%{_bindir}/ckb-next-daemon %{buildroot}%{_libexecdir}/ckb-next-daemon
34bce98
a2dcda0
install -Dp -m 0644 %{SOURCE3}  %{buildroot}%{_presetdir}/99-ckb-next.preset
a2dcda0
install -Dp -m 0644 %{SOURCE1}  %{buildroot}%{_datadir}/metainfo/ckb-next.appdata.xml
a2dcda0
install -Dp -m 0644 %{SOURCE2}  %{buildroot}%{_mandir}/man1/ckb-next.1
34bce98
34bce98
a2dcda0
%check
a2dcda0
desktop-file-validate %{buildroot}%{_datadir}/applications/ckb-next.desktop
34bce98
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/ckb-next.appdata.xml
34bce98
34bce98
34bce98
%post
34bce98
%systemd_post ckb-next-daemon.service
34bce98
if [ $1 -eq 1 ]; then
34bce98
    # starting daemon also at install
34bce98
    systemctl start ckb-next-daemon.service >/dev/null 2>&1 || :
34bce98
fi
34bce98
udevadm control --reload-rules 2>&1 > /dev/null || :
34bce98
34bce98
34bce98
%preun
34bce98
%systemd_preun ckb-next-daemon.service
34bce98
34bce98
34bce98
%postun
34bce98
%systemd_postun_with_restart ckb-next-daemon.service
34bce98
udevadm control --reload-rules 2>&1 > /dev/null || :
34bce98
34bce98
34bce98
%files
34bce98
%license LICENSE
34bce98
%doc CHANGELOG.md FIRMWARE README.md
34bce98
%{_bindir}/ckb-next
a2dcda0
%{_bindir}/ckb-next-dev-detect
34bce98
%{_libexecdir}/ckb-next-daemon
34bce98
%{_libexecdir}/ckb-next-animations/
a2dcda0
%{_libdir}/cmake/ckb-next/
34bce98
%{_datadir}/applications/ckb-next.desktop
34bce98
%{_datadir}/metainfo/ckb-next.appdata.xml
34bce98
%{_datadir}/icons/hicolor/**/apps/ckb-next.png
a2dcda0
%{_datadir}/icons/hicolor/**/apps/ckb-next-monochrome.png
77f2949
%{_datadir}/icons/hicolor/**/status/ckb-next_battery*.png
34bce98
%{_mandir}/man1/ckb-next.1*
34bce98
%{_presetdir}/99-ckb-next.preset
34bce98
%{_udevrulesdir}/*.rules
34bce98
%{_unitdir}/ckb-next-daemon.service
34bce98
34bce98
34bce98
%changelog
77f2949
* Fri May 27 2022 Artur Frenszek-Iwicki <fedora@svgames.pl> - 0.5.0-1
77f2949
- Update to v0.5.0
77f2949
5c85e43
* Thu Mar 18 2021 Artur Frenszek-Iwicki <fedora@svgames.pl> - 0.4.4-1
5c85e43
- Update to v0.4.4
5c85e43
2168dfd
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.3-3
2168dfd
- Rebuilt for updated systemd-rpm-macros
2168dfd
  See https://pagure.io/fesco/issue/2583.
2168dfd
995a027
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-2
995a027
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
995a027
a2dcda0
* Sun Dec 20 2020 Artur Frenszek-Iwicki <fedora@svgames.pl> - 0.4.3-1
a2dcda0
- Update to v0.4.3
a2dcda0
- Remove Patch0 (missing "extern" qualifiers - fixed upstream)
a2dcda0
- Simplify the install section (rely on %%cmake_install)
a2dcda0
f31226f
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-4
f31226f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f31226f
2156e2a
* Tue Jan 28 2020 Artur Iwicki <fedora@svgames.pl> - 0.4.2-3
2156e2a
- Add a patch to fix build failures
2156e2a
d762988
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-2
d762988
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d762988
ec50f0e
* Tue Oct 08 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.2-1
ec50f0e
- Update to latest upstream release
ec50f0e
edbb12a
* Tue Aug 27 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.1-1
edbb12a
- Update to latest upstream release
edbb12a
949a189
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
949a189
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
949a189
c3b3062
* Sat Mar 09 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.0-1
c3b3062
- Update to latest upstream release
c3b3062
34bce98
* Sat Feb 16 2019 Artur Iwicki <fedora@svgames.pl> - 0.3.2-4
34bce98
- Use "install -p" (preserve timestamps)
34bce98
- Do not use the bundled quazip library
34bce98
34bce98
* Sat Jan 26 2019 Artur Iwicki <fedora@svgames.pl> - 0.3.2-3
34bce98
- Tidy up the spec file
34bce98
- Remove obsolete scriptlets
34bce98
34bce98
* Tue Oct 16 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.3.2-2
34bce98
- Fixed animations dir
34bce98
34bce98
* Sat Oct 13 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.3.2-1
34bce98
- Update to 0.3.2 release
34bce98
34bce98
* Sun Oct 7 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.3.1-1
34bce98
- Update to 0.3.1 release
34bce98
34bce98
* Sat Jun 16 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.3.0-2
34bce98
- Fixed Epel build
34bce98
- Fixed animations dir
34bce98
34bce98
* Fri Jun 15 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.3.0-1
34bce98
- Update to 0.3.0 release
34bce98
- set QT_QPA_PLATFORMTHEME only for binary
34bce98
34bce98
* Mon Jan 22 2018 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.9-0.1.20180122git2316518
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Sun Dec 17 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.9.20171217git142b307
34bce98
- Update to latest snapshot.
34bce98
- Disable debugsource due to build error with empty file debugsourcefiles.list.
34bce98
34bce98
* Fri Nov 17 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.8.20171111gitb88d8be
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Fri Oct 20 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.7.20171014gitda28864
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Sun Aug 20 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.6.20170820git6af2773
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Wed Jul 26 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.5.20170726git9dc8216
34bce98
- Update to latest snapshot.
34bce98
- Color change freeze workaround by requiring qt5ct and adding to environment.
34bce98
34bce98
* Fri Jul 07 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.4.20170707git1331253
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Fri Jun 23 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.3.20170621gitae7346b
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Thu May 25 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.2.20170525gite54c911
34bce98
- Fix animation path.
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Thu May 18 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.8-0.1.20170518git5a34841
34bce98
- Update to 0.2.8 latest snapshot.
34bce98
34bce98
* Fri Apr 14 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.7-0.7.20170414git565add5
34bce98
- Added systemd preset.
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Sun Feb 19 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.7-0.6.20170219gitb59d179
34bce98
- Changed package name to ckb-next.
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Sun Jan 22 2017 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.7-0.2.20170120git89e8750
34bce98
- Update to latest snapshot.
34bce98
34bce98
* Thu Dec 1 2016 Johan Heikkila <johan.heikkila@gmail.com> - 0.2.6-0.1
34bce98
- Created spec file for Fedora based on the Suse spec file
34bce98
- added appdata file
34bce98
- added man page
34bce98
34bce98
* Thu Aug 25 2016 - aloisio@gmx.com
34bce98
- Update to version 0.2.6
34bce98
- Use external quazip only when available
34bce98
- Replaced ckb-fix-desktop-file.patch with %suse_update_desktop_file
34bce98
- Replaced ckb-daemon-path.patch and ckb-animations-path.patch with macros \
34bce98
  for consistency.
34bce98
34bce98
* Sun Apr 17 2016 - herbert@graeber-clan.de
34bce98
- Add hicolor folder, too
34bce98
34bce98
* Sun Apr 17 2016 - herbert@graeber-clan.de
34bce98
- Fix icon folder
34bce98
34bce98
* Fri Apr 15 2016 - herbert@graeber-clan.de
34bce98
- Initial package
34bce98
- Use /var/run instead of /dev/input for communication with the daemon.
34bce98
- move the daemon and the animations into the libexec folder