# This spec needs to be built once against core for the nouveau version of the script # and once against nonfree for the nvidia version # The script in itself is not nonfree content, but the nonfree repo must be self-contained %if "%{?distro_section}" == "nonfree" %define driver nvidia %else %define driver nouveau %endif %define date 20131127 %define libname %mklibname %{name} %define _provides_exceptions \\.so Name: primus Summary: Minimalistic and efficient OpenGL offloading for Bumblebee Group: System/Kernel and hardware # Primus has no stable release and only a 0.1 tag # Staying with version number 0.1 until another tag is published Version: 0.1 Release: %mkrel -c %{date} 1 URL: https://github.com/amonakov/primus License: ISC Source0: %{name}-master.tar.gz Patch0: %{name}-0.1-mga-libgl-nouveau.patch Patch1: %{name}-0.1-mga-libgl-nvidia.patch BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(x11) Requires: %{libname} = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release} %description Primus is a shared library that provides OpenGL and GLX APIs and implements low-overhead local-only client-side OpenGL offloading via GLX forking, similar to VirtualGL. It intercepts GLX calls and redirects GL rendering to a secondary X display, presumably driven by a faster GPU. On swapping buffers, rendered contents are read back using a PBO and copied onto the drawable it was supposed to be rendered on in the first place. %if "%{?distro_section}" != "nonfree" %files %doc README.md technotes.md %{_mandir}/man1/primusrun.1.xz %{_sysconfdir}/bash_completion.d/%{name} %package -n %{libname} Summary: Shared library for Primus Group: System/Libraries Requires: %{name} %description -n %{libname} Libraries injected by Primus into applications that are ran through it. Lib packages allow installing 32 and 64 bit libraries at the same time. %files -n %{libname} %dir %{_libdir}/%{name} %{_libdir}/%{name}/libGL.so.1 %endif %package %{driver} Summary: primusrun script adapted to %{driver} driver Group: System/Kernel and hardware Requires: %{name} Requires: bumblebee-%{driver} Provides: %{name}-bin %description %{driver} primusrun script patched against the %{driver} driver. %files %{driver} %{_bindir}/primusrun #-------------------------------------------------------------------- %prep %setup -qn primus-master %if "%{?distro_section}" == "nonfree" %patch1 -p1 %else %patch0 -p1 %endif %build LIBDIR=%{_lib} %make CFLAGS="%{optflags}" %install install -Dm755 primusrun %{buildroot}%{_bindir}/primusrun %if "%{?distro_section}" != "nonfree" install -Dm755 %{_lib}/libGL.so.1 %{buildroot}%{_libdir}/%{name}/libGL.so.1 install -Dm644 primusrun.1 %{buildroot}%{_mandir}/man1/primusrun.1 install -Dm644 primus.bash-completion %{buildroot}%{_sysconfdir}/bash_completion.d/%{name} %endif