%bcond_with git %if %{with git} %define gitdate 20120228 %endif # Use nouveau driver by default %bcond_with nvidia Name: bumblebee Summary: Support for NVidia Optimus laptops on Linux Group: System/Kernel and hardware Version: 3.0.1 Release: %mkrel 2 License: GPLv3 URL: https://github.com/Bumblebee-Project/bumblebee # source from git repo git://github.com/Bumblebee-Project/Bumblebee.git # we need to change to develop branch to allow changing to nouveau without # using nvidia paths Source0: https://github.com/downloads/Bumblebee-Project/Bumblebee/%{name}-%{!?with_git:%{version}}%{?with_git:%{gitdate}}.tar.%{?with_git:xz}%{!?with_git:gz} BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libbsd) BuildRequires: help2man Requires(pre): update-alternatives Requires(post): systemd-units Requires(preun):systemd-units Requires(pre): rpm-helper Requires: virtualgl Requires: %mklibname virtualgl %if %{with nvidia} Suggests: x11-driver-video-nvidia-current %else Requires: x11-driver-video-nouveau %endif Requires: kmod(bbswitch) Requires: kmod(acpi_call) %description Bumblebee daemon is a rewrite of the original Bumblebee service, providing an elegant and stable means of managing Optimus hybrid graphics chip sets. A primary goal of this project is to not only enable use of the discrete GPU for rendering, but also to enable smart power management of the dGPU when it's not in use. %files %doc README.markdown doc/RELEASE_NOTES_3_0_1 %{_sysconfdir}/bash_completion.d/bumblebee %dir %{_sysconfdir}/bumblebee/ %config(noreplace) %{_sysconfdir}/bumblebee/bumblebee.conf %config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nouveau %config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nvidia /lib/systemd/system/bumblebeed.service %{_sbindir}/bumblebeed %{_bindir}/optirun %{_bindir}/bumblebee-bugreport %{_mandir}/man1/bumblebeed.1.* %{_mandir}/man1/optirun.1.* %pre %_pre_groupadd %{name} if [ "$1" -eq "1" ];then users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') for user in $users; do gpasswd -a $user bumblebee done /usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf fi %post %_post_service bumblebeed # Simple: 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 # Simple: we need to ensure bumblebee group isnt removed when upgrading # This doesnt need exist for Mageia 2 %triggerpostun -- %{name} < 3.0-9 %_pre_groupadd %{name} users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') for user in $users; do gpasswd -a $user bumblebee done #-------------------------------------------------------------------- %prep %setup -q%{?with_git:n %{name}} %build %{?with_git:NOCONFIGURE=1 autoreconf -fi} %configure2_5x \ %if %{with nvidia} CONF_DRIVER=nvidia \ CONF_DRIVER_MODULE_NVIDIA=nvidia-current \ %else CONF_DRIVER=nouveau \ %endif %ifarch x86_64 CONF_LDPATH_NVIDIA=%{_usr}/lib/nvidia-current:%{_libdir}/nvidia-current \ CONF_MODPATH_NVIDIA=%{_usr}/lib/nvidia-current/xorg,%{_libdir}/nvidia-current/xorg,%{_usr}/lib/xorg/modules,%{_libdir}/xorg/modules,%{_usr}/lib/xorg/extra-modules,%{_usr}/xorg/extra-modules %else CONF_LDPATH_NVIDIA=%{_usr}/lib/nvidia-current \ CONF_MODPATH_NVIDIA=%{_usr}/lib/nvidia-current/xorg,%{_usr}/lib/xorg/modules,%{_usr}/lib/xorg/extra-modules %endif %make %install rm -rf %{buildroot} %makeinstall_std install -D -m644 scripts/systemd/bumblebeed.service %{buildroot}/lib/systemd/system/bumblebeed.service