%define snap 0 %define rel 7 %define major 7 %define libname %mklibname cec %major %define devname %mklibname cec -d %define staticdevname %mklibname cec -d -s Name: libcec Version: 7.1.1 %if %snap Release: %mkrel -c git%{snap} %rel %else Release: %mkrel %rel %endif Summary: Pulse-Eight CEC adapter control library License: GPLv2+ Group: System/Libraries URL: https://libcec.pulse-eight.com/ %if %snap # rm -rf libcec && git clone git://github.com/Pulse-Eight/libcec.git && cd libcec/ # git archive --prefix=libcec-$(date +%Y%m%d)/ --format=tar HEAD | xz > ../libcec-$(date +%Y%m%d).tar.xz Source0: %name-%{snap}.tar.xz %else Source0: https://github.com/Pulse-Eight/libcec/archive/libcec-%version.tar.gz %endif # from FC, https://github.com/knight-of-ni/libcec/commit/ec1c9acc29636ccfc0686493868a7daeae903339.patch Patch1: libcec-pythonlib.patch # BuildRequires: cmake BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(lockdev) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(p8-platform) BuildRequires: pkgconfig(python3) BuildRequires: swig %description With libcec you can access your Pulse-Eight CEC adapter. %package -n cec-utils Summary: Utilities for Pulse-Eight CEC adapter control Group: System/Kernel and hardware # the binaries require the library, but automatic dependency generation doesn't # catch that Requires: %libname = %version %description -n cec-utils With libcec you can access your Pulse-Eight CEC adapter. This package contains the command-line tools to configure and test your Pulse-Eight CEC adapter. %package -n %libname Summary: Shared library for Pulse-Eight CEC adapter control Group: System/Libraries %description -n %libname With libcec you can access your Pulse-Eight CEC adapter. This package contains the shared library which allows programs to access your Pulse-Eight CEC adapter. %package -n %devname Summary: Development files for %name Group: Development/C Requires: %libname = %version Provides: cec-devel = %version-%release Provides: %name-devel = %version-%release %description -n %devname With libcec you can access your Pulse-Eight CEC adapter. This package contains the files for developing applications which will use libcec. %package -n %staticdevname Summary: Development files for %name Group: Development/C Requires: %devname = %version-%release %description -n %staticdevname With libcec you can access your Pulse-Eight CEC adapter. This package contains the static library (.a) for developing applications which will use libcec. %prep %if %snap %autosetup -p1 -n %name-%{snap} %else %autosetup -p1 -n %{name}-%{name}-%{version} %endif %build %cmake -DHAVE_LINUX_API=ON %cmake_build %install %cmake_install %files -n cec-utils %license LICENSE.md %doc AUTHORS README.md %{_bindir}/cec-client* %{_bindir}/cecc-client* %{_bindir}/pyCecClient %{python3_sitearch}/cec/ %files -n %{libname} %license LICENSE.md %doc AUTHORS README.md %{_libdir}/%name.so.%{major}{,.*} %files -n %{devname} %doc AUTHORS %{_libdir}/%name.so %{_libdir}/pkgconfig/%name.pc %{_includedir}/%name/ %files -n %{staticdevname} %{_libdir}/%name.a