1 |
shlomif |
265469 |
%bcond_without git |
2 |
|
|
%if %{with git} |
3 |
shlomif |
261203 |
%define gitdate 20120228 |
4 |
shlomif |
265469 |
%endif |
5 |
|
|
# Use nouveau driver by default |
6 |
|
|
%bcond_with nvidia |
7 |
shlomif |
261203 |
|
8 |
|
|
|
9 |
|
|
Name: bumblebee |
10 |
|
|
Summary: Support for NVidia Optimus laptops on Linux |
11 |
|
|
Group: System/Kernel and hardware |
12 |
|
|
Version: 3.0 |
13 |
shlomif |
265765 |
Release: %mkrel 10 |
14 |
shlomif |
261203 |
License: GPLv3 |
15 |
|
|
URL: https://github.com/Bumblebee-Project/bumblebee |
16 |
|
|
# source from git repo git://github.com/Bumblebee-Project/Bumblebee.git |
17 |
|
|
# we need to change to develop branch to allow changing to nouveau without |
18 |
|
|
# using nvidia paths |
19 |
shlomif |
265469 |
Source0: https://github.com/downloads/Bumblebee-Project/Bumblebee/%{name}-%{!?with_git:%{version}}%{?with_git:%{gitdate}}.tar.%{?with_git:xz}%{!?with_git:gz} |
20 |
shlomif |
261203 |
BuildRequires: pkgconfig(x11) |
21 |
|
|
BuildRequires: pkgconfig(glib-2.0) |
22 |
|
|
BuildRequires: pkgconfig(libbsd) |
23 |
|
|
BuildRequires: help2man |
24 |
|
|
Requires(pre): update-alternatives |
25 |
|
|
Requires(post): systemd-units |
26 |
|
|
Requires(preun):systemd-units |
27 |
|
|
Requires(pre): rpm-helper |
28 |
|
|
Requires: virtualgl |
29 |
|
|
%if %{with nvidia} |
30 |
tmb |
262387 |
Suggests: x11-driver-video-nvidia-current |
31 |
shlomif |
261203 |
%else |
32 |
|
|
Requires: x11-driver-video-nouveau |
33 |
|
|
%endif |
34 |
|
|
Requires: kmod(bbswitch) |
35 |
|
|
Requires: kmod(acpi_call) |
36 |
|
|
|
37 |
|
|
%description |
38 |
|
|
Bumblebee daemon is a rewrite of the original Bumblebee service, providing |
39 |
|
|
an elegant and stable means of managing Optimus hybrid graphics chip sets. |
40 |
|
|
A primary goal of this project is to not only enable use of the discrete |
41 |
|
|
GPU for rendering, but also to enable smart power management of the dGPU |
42 |
|
|
when it's not in use. |
43 |
|
|
|
44 |
|
|
%files |
45 |
|
|
%doc README.markdown doc/RELEASE_NOTES_3_0 |
46 |
|
|
%{_sysconfdir}/bash_completion.d/bumblebee |
47 |
|
|
%dir %{_sysconfdir}/bumblebee/ |
48 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/bumblebee.conf |
49 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nouveau |
50 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nvidia |
51 |
|
|
/lib/systemd/system/bumblebeed.service |
52 |
|
|
%{_sbindir}/bumblebeed |
53 |
|
|
%{_bindir}/optirun |
54 |
|
|
%{_bindir}/bumblebee-bugreport |
55 |
|
|
%{_mandir}/man1/bumblebeed.1.* |
56 |
|
|
%{_mandir}/man1/optirun.1.* |
57 |
|
|
|
58 |
|
|
%pre |
59 |
|
|
%_pre_groupadd %{name} |
60 |
shlomif |
265738 |
if [ "$1" -eq "1" ];then |
61 |
|
|
users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') |
62 |
|
|
for user in $users; do |
63 |
shlomif |
261203 |
gpasswd -a $user bumblebee |
64 |
shlomif |
265738 |
done |
65 |
shlomif |
261203 |
/usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf |
66 |
|
|
fi |
67 |
|
|
|
68 |
|
|
%post |
69 |
|
|
%_post_service bumblebeed |
70 |
|
|
# Simple: still needs this since in release 3 services were not set |
71 |
|
|
# enabled and seams that still isnt properly handeled in %%_post_service |
72 |
shlomif |
265738 |
if [ "$1" -ge "1" ]; then |
73 |
shlomif |
261203 |
# Enable (but don't start) the unit by default |
74 |
|
|
/bin/systemctl enable bumblebeed.service |
75 |
|
|
# Start bumblebeed service |
76 |
|
|
/bin/systemctl start bumblebeed.service |
77 |
|
|
fi |
78 |
|
|
|
79 |
|
|
%preun |
80 |
|
|
%_preun_service bumblebeed |
81 |
|
|
|
82 |
|
|
%postun |
83 |
|
|
# We need this since "%%_postun_groupdel %%{name}" doesnt remove the group if |
84 |
|
|
# set to a user |
85 |
shlomif |
265738 |
if [ "$1" -eq "0" ];then |
86 |
|
|
/usr/sbin/groupdel bumblebee |
87 |
|
|
fi |
88 |
shlomif |
261203 |
|
89 |
shlomif |
265765 |
# Simple: we need to ensure bulblebee isnt removed in upgrade |
90 |
|
|
# This doesnt need exist for Mageia 2 |
91 |
|
|
%triggerpostun -- %{name} < 3.0-9 |
92 |
|
|
%_pre_groupadd %{name} |
93 |
|
|
users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') |
94 |
|
|
for user in $users; do |
95 |
|
|
gpasswd -a $user bumblebee |
96 |
|
|
done |
97 |
|
|
|
98 |
shlomif |
261203 |
#-------------------------------------------------------------------- |
99 |
|
|
%prep |
100 |
shlomif |
265469 |
%setup -q%{?with_git:n %{name}} |
101 |
shlomif |
261203 |
|
102 |
|
|
%build |
103 |
shlomif |
265469 |
%{?with_git:NOCONFIGURE=1 autoreconf -fi} |
104 |
shlomif |
261203 |
%configure2_5x \ |
105 |
|
|
%if %{with nvidia} |
106 |
|
|
CONF_DRIVER=nvidia \ |
107 |
shlomif |
265607 |
CONF_DRIVER_MODULE_NVIDIA=nvidia-current \ |
108 |
shlomif |
265469 |
%else |
109 |
shlomif |
265607 |
CONF_DRIVER=nouveau \ |
110 |
shlomif |
261203 |
%endif |
111 |
|
|
%ifarch x86_64 |
112 |
|
|
CONF_LDPATH_NVIDIA=%{_usr}/lib/nvidia-current:%{_libdir}/nvidia-current \ |
113 |
|
|
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 |
114 |
|
|
%else |
115 |
|
|
CONF_LDPATH_NVIDIA=%{_usr}/lib/nvidia-current \ |
116 |
|
|
CONF_MODPATH_NVIDIA=%{_usr}/lib/nvidia-current/xorg,%{_usr}/lib/xorg/modules,%{_usr}/lib/xorg/extra-modules |
117 |
|
|
%endif |
118 |
|
|
|
119 |
|
|
%make |
120 |
|
|
|
121 |
|
|
%install |
122 |
|
|
rm -rf %{buildroot} |
123 |
|
|
%makeinstall_std |
124 |
|
|
|
125 |
|
|
install -D -m644 scripts/systemd/bumblebeed.service %{buildroot}/lib/systemd/system/bumblebeed.service |