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