34bce98
Name:           ckb-next
87b0442
Version:        0.4.2
7082d4e
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++
34bce98
BuildRequires:  libappindicator-devel
34bce98
BuildRequires:  libappstream-glib
34bce98
BuildRequires:  libgudev-devel
34bce98
BuildRequires:  pulseaudio-libs-devel
34bce98
BuildRequires:  qt5-qtbase-devel >= 5.2.0
34bce98
BuildRequires:  quazip-qt5-devel >= 0.7.3
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
34bce98
# ckb-next, as the name suggests, is a re-activation and continuation of "ckb"
34bce98
Obsoletes:      ckb
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
34bce98
34bce98
%build
34bce98
%cmake -H. -Bbuild \
34bce98
  -DCMAKE_BUILD_TYPE=Release \
34bce98
  -DSAFE_INSTALL=OFF \
34bce98
  -DSAFE_UNINSTALL=OFF \
34bce98
  -DWITH_SHIPPED_QUAZIP=OFF \
34bce98
  -DCMAKE_INSTALL_PREFIX=%{_prefix} \
34bce98
  -DCMAKE_INSTALL_LIBEXECDIR=libexec \
34bce98
  -DDISABLE_UPDATER=1
34bce98
%cmake --build build --target all -- -j build
34bce98
34bce98
pushd build
34bce98
%make_build
34bce98
popd
34bce98
34bce98
# Color freeze fix
34bce98
sed -e '/^Exec=/cExec=env QT_QPA_PLATFORMTHEME=qt5ct %{_bindir}/ckb-next' -i build/src/gui/ckb-next.desktop
34bce98
34bce98
34bce98
%install
34bce98
install -Dp -m 755 build/bin/ckb-next  %{buildroot}%{_bindir}/ckb-next
34bce98
install -Dp -m 755 build/bin/ckb-next-daemon  %{buildroot}%{_libexecdir}/ckb-next-daemon
34bce98
34bce98
install -d -m 755 %{buildroot}%{_libexecdir}/ckb-next-animations
7082d4e
for ANIM in $(find src/animations/ -mindepth 1 -maxdepth 1 -type d -printf '%%f '); do
34bce98
    install -p -m 755 "build/bin/${ANIM}"  "%{buildroot}%{_libexecdir}/ckb-next-animations/${ANIM}"
34bce98
done
34bce98
34bce98
install -Dp -m 0644 %{SOURCE3} %{buildroot}/%{_presetdir}/99-ckb-next.preset
7082d4e
install -Dp -m 644 linux/udev/99-ckb-next-daemon.rules %{buildroot}%{_udevrulesdir}/99-ckb-next-daemon.rules
34bce98
install -Dp -m 644 linux/systemd/ckb-next-daemon.service.in %{buildroot}%{_unitdir}/ckb-next-daemon.service
34bce98
34bce98
install -Dp -m 644 build/src/gui/ckb-next.png %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/ckb-next.png
34bce98
34bce98
desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ build/src/gui/ckb-next.desktop
34bce98
34bce98
install -Dp -m 0644 %{SOURCE1}  %{buildroot}%{_datadir}/metainfo/ckb-next.appdata.xml
34bce98
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/ckb-next.appdata.xml
34bce98
34bce98
install -Dp -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/ckb-next.1
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
34bce98
%{_libexecdir}/ckb-next-daemon
34bce98
%{_libexecdir}/ckb-next-animations/
34bce98
%{_datadir}/applications/ckb-next.desktop
34bce98
%{_datadir}/metainfo/ckb-next.appdata.xml
34bce98
%{_datadir}/icons/hicolor/**/apps/ckb-next.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
87b0442
* Tue Oct 08 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.2-1
87b0442
- Update to latest upstream release
87b0442
2856de6
* Tue Aug 27 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.1-1
2856de6
- Update to latest upstream release
2856de6
7082d4e
* Sat Mar 09 2019 Artur Iwicki <fedora@svgames.pl> - 0.4.0-1
7082d4e
- Update to latest upstream release
7082d4e
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