#Based on spec from bero of openmandriva %define major 1 %define libname %mklibname evdi %define devname %mklibname evdi -d Name: evdi Version: 1.14.8 Release: %mkrel 1 Source0: https://github.com/DisplayLink/evdi/archive/refs/tags/v%{version}.tar.gz?/%{name}-%{version}.tar.gz Summary: Extensible Virtual Display Interface URL: https://github.com/evdi/evdi License: MIT Group: System/Libraries BuildRequires: make BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(python3) BuildRequires: python3dist(pybind11) %description The Extensible Virtual Display Interface (EVDI) is a Linux kernel module that enables management of multiple screens, allowing user-space programs to take control over what happens with the image. It is essentially a virtual display you can add, remove and receive screen updates for, in an application that uses the libevdi library. It is needed primarily for DisplayLink driver. %package -n %{libname} Summary: Extensible Virtual Display Interface Group: System/Libraries %description -n %{libname} The Extensible Virtual Display Interface (EVDI) is a Linux kernel module that enables management of multiple screens, allowing user-space programs to take control over what happens with the image. It is essentially a virtual display you can add, remove and receive screen updates for, in an application that uses the libevdi library. It is needed primarily for DisplayLink driver. %package -n %{devname} Summary: Development files for %{name} Group: Development/C Requires: %{libname} = %{EVRD} %description -n %{devname} Development files (Headers etc.) for %{name}. The Extensible Virtual Display Interface (EVDI) is a Linux kernel module that enables management of multiple screens, allowing user-space programs to take control over what happens with the image. It is essentially a virtual display you can add, remove and receive screen updates for, in an application that uses the libevdi library. It is needed primarily for DisplayLink driver. %package -n dkms-%{name} Summary: A kernel module that enables management of multiple screens Group: System/Kernel and hardware License: GPLv2 Provides: kmod(evdi.ko) = %{version} Requires: dkms Requires(post): dkms Requires(preun): dkms %description -n dkms-%{name} %{summary} %package -n python-%{name} Summary: Python bindings for the EVDI library Group: System/Libraries Requires: %{libname} = %{EVRD} %description -n python-%{name} Python bindings for the EVDI library The Extensible Virtual Display Interface (EVDI) is a Linux kernel module that enables management of multiple screens, allowing user-space programs to take control over what happens with the image. It is essentially a virtual display you can add, remove and receive screen updates for, in an application that uses the libevdi library. It is needed primarily for DisplayLink driver. %prep %autosetup -p1 %build "CFLAGS="%{optflags} -I../module" %make_build -C library CFLAGS="%{optflags}" %make_build -C library %if "%{_lib}" != "lib" #sed -i -e 's,/usr/lib/py,%{_libdir}/py,' pyevdi/Makefile %endif #CXXFLAGS="%{optflags} -I../module -I../library" %make_build -C pyevdi CXXFLAGS="%{optflags}" %make_build -C pyevdi %install %make_install -C library LIBDIR=%{_libdir} %make_install -C pyevdi LIBDIR=%{python_sitearch}/%{name} mkdir -p %{buildroot}%{_includedir} cp library/*.h %{buildroot}%{_includedir}/ install -d -m755 %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release} install -d -m755 %{buildroot}%{_sysconfdir}/modules-load.d cp -r module/* %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release} echo "%{name}" > %{buildroot}%{_sysconfdir}/modules-load.d/%{name}.conf %post -n dkms-%{name} dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade true #The module is not loaded the after build #But should be loaded by the displaylink package #modprobe evdi %preun -n dkms-%{name} dkms remove -m %{name} -v %{version}-%{release} --all --rpm_safe_upgrade true %files -n %{libname} # The .so file is intentionally here, it's dlopened # by DisplayLinkManager and possibly others %{_libdir}/*.so %{_libdir}/*.so.%{major}* %files -n %{devname} %{_includedir}/* %files -n dkms-%{name} %{_usrsrc}/%{name}-%{version}-%{release} %{_sysconfdir}/modules-load.d/%{name}.conf %files -n python-%{name} %{python_sitearch}/%{name}/*