--- cauldron/ckb-next/current/SPECS/ckb-next.spec 2019/12/20 20:34:24 1469196 +++ cauldron/ckb-next/current/SPECS/ckb-next.spec 2019/12/20 21:03:52 1469202 @@ -1,19 +1,21 @@ -# Mageia RPM Spec -%undefine _debugsource_packages - Name: ckb-next -Version: 0.3.2 -Release: 8.189 +Version: 0.4.2 +Release: 1 Summary: Corsair RGB keyboard driver for Linux and OS X -Group: Applications/System -License: GPLv2 +Group: System/Configuration +#bundled kissfft library is BSD +License: GPLv2 and BSD + URL: https://github.com/ckb-next/ckb-next -Source0: https://github.com/ckb-next/ckb-next/archive/v%{version}.tar.gz#/ckb-next-%{version}.tar.gz +Source0: https://github.com/ckb-next/ckb-next/archive/v%{version}/%{name}-%{version}.tar.gz # Upstream provides none of the following files Source1: ckb-next.appdata.xml Source2: ckb-next.1 Source3: 99-ckb-next.preset +Source4: README.install.urpmi + +Patch0: ckb-next-0.4.2-fix-daemon-path.patch BuildRequires: cmake BuildRequires: cmake(Qt5Core) >= 5.3 @@ -21,99 +23,70 @@ BuildRequires: cmake(Qt5Network) >= 5.3 BuildRequires: cmake(Qt5Widgets) >= 5.3 BuildRequires: quazip-devel -BuildRequires: openssl-devel -BuildRequires: libgudev-devel -BuildRequires: libappindicator-devel -BuildRequires: systemd-devel -BuildRequires: pulseaudio-devel -BuildRequires: zlib-devel +BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(gudev-1.0) +BuildRequires: pkgconfig(appindicator-0.1) +BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(zlib) BuildRequires: desktop-file-utils BuildRequires: appstream-util BuildRequires: ImageMagick -%{?systemd_requires} -Requires: qt5ct Obsoletes: ckb +Requires(post): rpm-helper >= %{rpmhelper_required_version} +Requires(preun): rpm-helper >= %{rpmhelper_required_version} +Requires(postun): rpm-helper >= %{rpmhelper_required_version} + %description ckb-next is an open-source driver for Corsair keyboards and mice. It aims to bring the features of their proprietary CUE software to the Linux and Mac operating systems. This project is currently a work in progress, but it already supports much of the same functionality, including full RGB animations. +%files +%license LICENSE +%doc CHANGELOG.md FIRMWARE README.md README.install.urpmi +%{_bindir}/* +%{_libexecdir}/%{name}-* +%{_unitdir}/ckb-next-daemon.service +%{_presetdir}/99-ckb-next.preset +%{_datadir}/applications/ckb-next.desktop +%{_datadir}/appdata/ckb-next.appdata.xml +%{_iconsdir}/hicolor/*/apps/ckb-next.png +%{_mandir}/man1/* +%{_udevrulesdir}/*.rules +%{_libdir}/cmake/ckb-next + %prep -%setup -q -n ckb-next-%{version} -# Fedora uses /usr/libexec for daemons -sed -e '/^ExecStart/cExecStart=%{_libexecdir}/ckb-next-daemon' -i linux/systemd/ckb-next-daemon.service.in +%setup -q -n %{name}-%{version} +%autopatch -p0 %build -%cmake -DCMAKE_BUILD_TYPE=Release -DSAFE_INSTALL=OFF -DSAFE_UNINSTALL=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBEXECDIR=libexec -DDISABLE_UPDATER=1 -#cd build -%make_build -#cd .. +%cmake -DCMAKE_BUILD_TYPE=Release \ + -DSAFE_INSTALL=OFF \ + -DSAFE_UNINSTALL=OFF \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \ + -DDISABLE_UPDATER=1 \ + -DUDEV_RULE_DIRECTORY=%{_udevrulesdir} -# Color freeze fix -sed -e '/^Exec=/cExec=env QT_QPA_PLATFORMTHEME=qt5ct /usr/bin/ckb-next' -i src/gui/ckb-next.desktop +%make_build %install -install -m 644 -D linux/udev/99-ckb-daemon.rules %{buildroot}%{_udevrulesdir}/99-ckb-daemon.rules -install -D -m 755 build/bin/ckb-next %{buildroot}%{_bindir}/ckb-next -install -D -m 755 build/bin/ckb-next-daemon %{buildroot}%{_libexecdir}/ckb-next-daemon -install -d %{buildroot}%{_libexecdir}/ckb-next-animations -install -D -m 755 build/bin/gradient %{buildroot}%{_libexecdir}/ckb-next-animations/gradient -install -D -m 755 build/bin/heat %{buildroot}%{_libexecdir}/ckb-next-animations/heat -install -D -m 755 build/bin/mviz %{buildroot}%{_libexecdir}/ckb-next-animations/mviz -install -D -m 755 build/bin/pinwheel %{buildroot}%{_libexecdir}/ckb-next-animations/pinwheel -install -D -m 755 build/bin/rain %{buildroot}%{_libexecdir}/ckb-next-animations/rain -install -D -m 755 build/bin/random %{buildroot}%{_libexecdir}/ckb-next-animations/random -install -D -m 755 build/bin/ripple %{buildroot}%{_libexecdir}/ckb-next-animations/ripple -install -D -m 755 build/bin/wave %{buildroot}%{_libexecdir}/ckb-next-animations/wave -install -m 644 -D build/src/gui/ckb-next.png %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/ckb-next.png -install -Dpm 0644 %{SOURCE3} %{buildroot}/%{_presetdir}/99-ckb-next.preset -install -m 644 -D linux/systemd/ckb-next-daemon.service.in %{buildroot}%{_unitdir}/ckb-next-daemon.service -desktop-file-install --dir=%{buildroot}%{_datadir}/applications build/src/gui/ckb-next.desktop -install -Dpm 0644 \ -%{SOURCE1} %{buildroot}%{_datadir}/appdata/ckb-next.appdata.xml -appstream-util \ -validate-relax --nonet %{buildroot}%{_datadir}/appdata/ckb-next.appdata.xml -install -Dpm 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/ckb-next.1 +%make_install -C build +%__install -Dpm 0644 %{SOURCE1} %{buildroot}%{_datadir}/appdata/ckb-next.appdata.xml +%__install -Dpm 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/ckb-next.1 +%__install -Dpm 0644 %{SOURCE3} %{buildroot}/%{_presetdir}/99-ckb-next.preset +%__install -Dpm 0644 %{SOURCE4} README.install.urpmi +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/ckb-next.appdata.xml %post -%systemd_post ckb-next-daemon.service -if [ $1 -eq 1 ]; then - # starting daemon also at install - systemctl start ckb-next-daemon.service >/dev/null 2>&1 || : - touch --no-create %{_datadir}/icons/hicolor >&/dev/null || : -fi -udevadm control --reload-rules 2>&1 > /dev/null || : +%_post_service %{name}-daemon %preun -%systemd_preun ckb-next-daemon.service +%_preun_service %{name}-daemon %postun -%systemd_postun_with_restart ckb-next-daemon.service -if [ $1 -eq 0 ]; then - touch --no-create %{_datadir}/icons/hicolor >&/dev/null || : - gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : -fi -udevadm control --reload-rules 2>&1 > /dev/null || : - -%posttrans -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - - -%files -%defattr(-,root,root) -%license LICENSE -%doc CHANGELOG.md FIRMWARE README.md -%{_udevrulesdir}/*.rules -%{_bindir}/ckb-next -%{_libexecdir}/ckb-next-daemon -%{_libexecdir}/ckb-next-animations -%{_unitdir}/ckb-next-daemon.service -%{_presetdir}/99-ckb-next.preset -%{_datadir}/applications/ckb-next.desktop -%{_datadir}/appdata/ckb-next.appdata.xml -%{_datadir}/icons/hicolor/*/apps/ckb-next.png -%{_mandir}/man1/ckb-next.1* - +%systemd_postun_with_restart %{name}-daemon