# Package should be built first against core, and then against nonfree # The core build produces the bumblebee and bumblebee-nouveau RPMs, # whereas the nonfree build produces the bumblebee-nvidia-current and -nvidia340 RPMs # Increment bigrel when snapshot changes, snaprel for a new release of the same snapshot %define date 20150120 %define bigrel 15 %define snaprel 2 Name: bumblebee Summary: Daemon managing Nvidia Optimus hybrid graphics cards Group: System/Kernel and hardware Version: 3.2.1 Release: %mkrel %{bigrel}.%{date}.%{snaprel} License: GPLv3+ URL: https://github.com/Bumblebee-Project/bumblebee # Taken from tip of https://github.com/Bumblebee-Project/Bumblebee/tree/develop Source0: %{name}-%{version}+%{date}.tar.xz BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libbsd) BuildRequires: help2man Requires(pre): rpm-helper Requires(pre): update-alternatives Requires(post): systemd-units Requires(preun):systemd-units Requires: kmod(bbswitch.ko) Requires: %{name}-bin # VirtualGl is the default bridge for upstream, the alternative being primus # As of now (3.2.1-5) primus shows better performances and compability, so we use it as default Recommends: virtualgl Recommends: %mklibname virtualgl # Files were moved Conflicts: %{name}-nouveau < 3.2.1-15 Conflicts: %{name}-nvidia < 3.2.1-15 %description Bumblebee is an effort to make NVIDIA Optimus enabled laptops work in GNU/Linux systems. These laptops are built in such a way that the NVIDIA graphics card can be used on demand so that battery life is improved and temperature is kept low. It disables the discrete graphics card if no client is detected, and start an X server making use of NVIDIA card if requested then let software GL implementations (such as VirtualGL or primus) copy frames to the visible display that runs on the integrated graphics. The ability to use discrete graphics depends on the driver: open source nouveau and proprietary nvidia. #-------------------------------------------------------------------- %if "%{?distro_section}" != "nonfree" # Core build %files %doc README.install.urpmi README.markdown doc/RELEASE_NOTES_3_2_1 %{_sysconfdir}/bash_completion.d/bumblebee %{_sysconfdir}/modprobe.d/%{name}.conf %dir %{_sysconfdir}/bumblebee/ %config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nouveau %config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nvidia %config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.d/10-dummy.conf %{_udevrulesdir}/99-bumblebee-nvidia-dev.rules %{_unitdir}/bumblebeed.service %{_sbindir}/bumblebeed %{_bindir}/bumblebee-bugreport %{_bindir}/optirun %{_mandir}/man1/bumblebeed.1.* %{_mandir}/man1/optirun.1.* %pre %_pre_groupadd %{name} if [ "$1" -eq "1" ]; then /usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf fi %post %_post_service bumblebeed # simplew: still needs this since in release 3 services were not set # enabled and seams that still isnt properly handeled in %%_post_service if [ "$1" -ge "1" ]; then # Enable (but don't start) the unit by default /bin/systemctl enable bumblebeed.service # Start bumblebeed service /bin/systemctl start bumblebeed.service fi %preun %_preun_service bumblebeed %postun # We need this since "%%_postun_groupdel %%{name}" doesnt remove the group if # set to a user if [ "$1" -eq "0" ];then /usr/sbin/groupdel bumblebee fi #-------------------------------------------------------------------- %package nouveau Summary: Bumblebee configuration files and binaries for nouveau driver Group: System/Kernel and hardware Requires: %{name} = %{version} Requires: x11-driver-video-nouveau Requires: primus-nouveau Conflicts: %{name}-nvidia Provides: %{name}-bin = %{version} %description nouveau Bumblebee configuration files and binaries built against the nouveau driver. %files nouveau %config(noreplace) %{_sysconfdir}/bumblebee/bumblebee.conf #-------------------------------------------------------------------- %else %define debug_package %{nil} # Nonfree build %package nvidia Summary: Bumblebee configuration files and binaries for nvidia-current driver Group: System/Kernel and hardware Requires: %{name} = %{version} Requires: x11-driver-video-nvidia-current Requires: primus-nvidia Conflicts: %{name}-nouveau Provides: %{name}-bin = %{version} %description nvidia Bumblebee configuration files and binaries built against the nvidia-current driver. %files nvidia %config(noreplace) %{_sysconfdir}/bumblebee/bumblebee.conf %{_bindir}/nvidia-settings-bumblebee %endif #-------------------------------------------------------------------- %prep %setup -q -n %{name}-%{version}+%{date} %build autoreconf -vfi %configure2_5x \ --with-udev-rules=%{_udevrulesdir} \ CONF_BRIDGE=primus \ %if "%{?distro_section}" == "nonfree" CONF_DRIVER=nvidia \ CONF_DRIVER_MODULE_NVIDIA=nvidia-current \ %else CONF_DRIVER=nouveau \ %endif %ifarch x86_64 CONF_LDPATH_NVIDIA=%{_libdir}/nvidia-current:%{_usr}/lib/nvidia-current \ CONF_MODPATH_NVIDIA=%{_libdir}/nvidia-current/xorg,%{_usr}/lib/nvidia-current/xorg,%{_libdir}/xorg/modules,%{_usr}/lib/xorg/modules \ CONF_PRIMUS_LD_PATH=%{_libdir}/primus:%{_usr}/lib/primus %else CONF_LDPATH_NVIDIA=%{_libdir}/nvidia-current \ CONF_MODPATH_NVIDIA=%{_libdir}/nvidia-current/xorg,%{_libdir}/xorg/modules \ CONF_PRIMUS_LD_PATH=%{_libdir}/primus %endif %make %install %if "%{?distro_section}" != "nonfree" %makeinstall_std install -D -m644 scripts/systemd/bumblebeed.service %{buildroot}%{_unitdir}/bumblebeed.service install -d %{buildroot}%{_sysconfdir}/modprobe.d cat << EOF > %{buildroot}%{_sysconfdir}/modprobe.d/%{name}.conf blacklist nvidia-current blacklist nouveau # Map removal of modules to correct command # This allows modprobe -r nvidia to work remove nvidia rmmod nvidia # Needed for bumblebee as it tries to remove nvidia-current, which is the module # load name. The driver is still "nvidia" once loaded, thus the removal fails. remove nvidia-current rmmod nvidia # Switch card off when booting, on when unloading bbswitch (shutdown) options bbswitch load_state=0 unload_state=1 EOF # Tell users to add themselves to the bumblebee group on new installs cat << EOF > README.install.urpmi To be able to use bumblebee via the 'optirun' or 'primusrun' commands, user accounts must be part of the "bumblebee" group. You can add yourself (or any user) to the "bumblebee" group with: # gpasswd -a <username> bumblebee For more information, please refer to https://wiki.mageia.org/en/Bumblebee. EOF %else install -D -m644 conf/bumblebee.conf %{buildroot}%{_sysconfdir}/bumblebee/bumblebee.conf # Create nvidia-settings launcher script cat << EOF > nvidia-settings-bumblebee #!/bin/sh optirun -b none %{_libdir}/nvidia-current/bin/nvidia-settings -c :8 EOF install -D -m755 nvidia-settings-bumblebee %{buildroot}%{_bindir}/nvidia-settings-bumblebee %endif %changelog * Sat Nov 28 2015 akien <akien> 3.2.1-15.20150120.2.mga5 + Revision: 906835 - Drop the hack that automatically adds users with UID>=500 to the bumblebee group o It is replaced by a README.install.urpmi which tells the user to it themselves - Increase main release for bogus conflict - Move optirun and bumblebeed binaries to main package (same size, not 100%% identical according to diff but core binaries seem to work fine for nvidia driver) - Improve modprobe config file to properly unload the nvidia module (patch by luke_nukem, mga#16094) - Simplify the spec file a bit regarding core/nonfree builds * Tue Feb 24 2015 akien <akien> 3.2.1-14.20150120.2.mga5.nonfree + Revision: 816834 - Fix name of blacklisted nvidia-current module * Wed Feb 18 2015 akien <akien> 3.2.1-14.20150120.1.mga5 + Revision: 815645 - Blacklist nvidia and nouveau to let bumblebee handle them - New snapshot 20150120 * Sat Jan 10 2015 akien <akien> 3.2.1-13.20150101.1.mga5 + Revision: 809724 - 20150101 snapshot from develop branch * Wed Oct 15 2014 umeabot <umeabot> 3.2.1-12.mga5 + Revision: 744598 - Second Mageia 5 Mass Rebuild * Wed Sep 24 2014 tmb <tmb> 3.2.1-11.mga5 + Revision: 724179 - adapt to new kmod provides * Tue Sep 16 2014 umeabot <umeabot> 3.2.1-10.mga5.nonfree + Revision: 678248 - Mageia 5 Mass Rebuild + tv <tv> - s/uggests:/Recommends:/ * Thu Mar 13 2014 akien <akien> 3.2.1-9.mga5.nonfree + Revision: 602744 - Restrict nvidia-settings-bumblebee script to bumblebee-nvidia only (and not bumblebee-nouveau) * Wed Mar 12 2014 akien <akien> 3.2.1-8.mga5.nonfree + Revision: 602718 - Rename nvidia-settings script to prevent conflict with actual binary * Wed Mar 12 2014 akien <akien> 3.2.1-7.mga5.nonfree + Revision: 602593 - Add nvidia-settings launcher script to bumblebee-nvidia * Fri Feb 14 2014 akien <akien> 3.2.1-6.mga5.nonfree + Revision: 591358 - Repair buggy modpath introduced in r590786 - Remove inefficient linking of virtualgl's fakelib * Fri Feb 14 2014 akien <akien> 3.2.1-5.mga5 + Revision: 591336 - Switching default bridge to primus which shows overall better performance - virtualgl now as Suggests, and primus as Requires * Fri Feb 07 2014 akien <akien> 3.2.1-4.mga5.nonfree + Revision: 585515 - Enable primus-specific configuration and add it as a Suggests - Move /lib to /usr/lib - Versioned Provides - Adapt spec to package both nouveau (core) and nvidia (nonfree) versions - Remove %%triggerpostun needed only for bumblebee < 3.0-9 (never submitted to a stable mga release) - Replace description with Debian's - Update to upstream 3.2.1: https://raw.github.com/Bumblebee-Project/Bumblebee/master/doc/RELEASE_NOTES_3_2_1 - Changelog for 3.1: https://raw.github.com/Bumblebee-Project/Bumblebee/master/doc/RELEASE_NOTES_3_2 - Changelog for 3.2: https://raw.github.com/Bumblebee-Project/Bumblebee/master/doc/RELEASE_NOTES_3_1 * Fri Jan 11 2013 umeabot <umeabot> 3.0.1-2.mga3 + Revision: 347224 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Wed Sep 26 2012 shlomif <shlomif> 3.0.1-1.mga3 + Revision: 298415 - New version 3.0.1 * Wed Sep 05 2012 shlomif <shlomif> 3.0-11.mga3 + Revision: 288592 - Add a dependency on libvirtualgl. - Spelling correction in the comment - Fix by simple to the group deletion. * Sun Jul 01 2012 shlomif <shlomif> 3.0-9.mga3 + Revision: 265738 - Prevent group from getting deleted. Thanks to simplew. * Sat Jun 30 2012 shlomif <shlomif> 3.0-8.mga3 + Revision: 265607 - Add trailing backslashes - thanks to simplew * Sat Jun 30 2012 shlomif <shlomif> 3.0-7.mga3 + Revision: 265470 - Bump the release - Made nouveau the default. Patch thanks to simplew. * Wed Jun 20 2012 tmb <tmb> 3.0-6.mga3 + Revision: 262387 - switch requires to suggests on x11-driver-video-nvidia-current as core must be selfcontained so a core package cant require nonfree packgage * Sun Jun 17 2012 shlomif <shlomif> 3.0-5.mga3 + Revision: 261203 - imported package bumblebee