1 |
akien |
585500 |
# Package should be built first against core, and then against nonfree |
2 |
|
|
# The core build produces the bumblebee and bumblebee-nouveau RPMs, |
3 |
|
|
# whereas the nonfree build produces the bumblebee-nvidia RPM |
4 |
|
|
%if "%{?distro_section}" == "nonfree" |
5 |
|
|
%define driver nvidia |
6 |
|
|
%else |
7 |
|
|
%define driver nouveau |
8 |
|
|
%endif |
9 |
shlomif |
261203 |
|
10 |
akien |
584591 |
Name: bumblebee |
11 |
|
|
Summary: Support for NVIDIA Optimus laptops on Linux |
12 |
|
|
Group: System/Kernel and hardware |
13 |
|
|
Version: 3.2.1 |
14 |
akien |
591358 |
Release: %mkrel 6 |
15 |
akien |
584591 |
License: GPLv3+ |
16 |
|
|
URL: https://github.com/Bumblebee-Project/bumblebee |
17 |
shlomif |
261203 |
# source from git repo git://github.com/Bumblebee-Project/Bumblebee.git |
18 |
akien |
584591 |
Source0: https://github.com/downloads/Bumblebee-Project/Bumblebee/%{name}-%{version}.tar.gz |
19 |
|
|
BuildRequires: pkgconfig(x11) |
20 |
|
|
BuildRequires: pkgconfig(glib-2.0) |
21 |
|
|
BuildRequires: pkgconfig(libbsd) |
22 |
|
|
BuildRequires: help2man |
23 |
|
|
Requires(pre): rpm-helper |
24 |
|
|
Requires(pre): update-alternatives |
25 |
|
|
Requires(post): systemd-units |
26 |
shlomif |
261203 |
Requires(preun):systemd-units |
27 |
akien |
585500 |
Requires: %{name}-bin |
28 |
akien |
591336 |
# VirtualGl is the default bridge for upstream, the alternative being primus |
29 |
|
|
# As of now (3.2.1-5) primus shows better performances and compability, so we use it as default |
30 |
|
|
Suggests: virtualgl |
31 |
|
|
Suggests: %mklibname virtualgl |
32 |
akien |
584591 |
Requires: kmod(bbswitch) |
33 |
shlomif |
261203 |
|
34 |
|
|
%description |
35 |
akien |
584591 |
Bumblebee is an effort to make NVIDIA Optimus enabled laptops work in |
36 |
akien |
591335 |
GNU/Linux systems. These laptops are built in such a way that the NVIDIA |
37 |
akien |
584591 |
graphics card can be used on demand so that battery life is improved and |
38 |
|
|
temperature is kept low. |
39 |
shlomif |
261203 |
|
40 |
akien |
584591 |
It disables the discrete graphics card if no client is detected, and start |
41 |
|
|
an X server making use of NVIDIA card if requested then let software GL |
42 |
|
|
implementations (such as VirtualGL or primus) copy frames to the visible |
43 |
akien |
585512 |
display that runs on the integrated graphics. The ability to use discrete |
44 |
akien |
584591 |
graphics depends on the driver: open source nouveau and proprietary nvidia. |
45 |
|
|
|
46 |
akien |
585500 |
%if "%{?distro_section}" != "nonfree" |
47 |
shlomif |
261203 |
%files |
48 |
akien |
565729 |
%doc README.markdown doc/RELEASE_NOTES_3_2_1 |
49 |
shlomif |
261203 |
%{_sysconfdir}/bash_completion.d/bumblebee |
50 |
|
|
%dir %{_sysconfdir}/bumblebee/ |
51 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nouveau |
52 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.nvidia |
53 |
akien |
585500 |
%config(noreplace) %{_sysconfdir}/bumblebee/xorg.conf.d/10-dummy.conf |
54 |
akien |
590786 |
%{_udevrulesdir}/99-bumblebee-nvidia-dev.rules |
55 |
akien |
585515 |
%{_unitdir}/bumblebeed.service |
56 |
shlomif |
261203 |
%{_bindir}/bumblebee-bugreport |
57 |
|
|
%{_mandir}/man1/bumblebeed.1.* |
58 |
|
|
%{_mandir}/man1/optirun.1.* |
59 |
|
|
|
60 |
|
|
%pre |
61 |
|
|
%_pre_groupadd %{name} |
62 |
shlomif |
265738 |
if [ "$1" -eq "1" ];then |
63 |
|
|
users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') |
64 |
|
|
for user in $users; do |
65 |
shlomif |
261203 |
gpasswd -a $user bumblebee |
66 |
shlomif |
265738 |
done |
67 |
shlomif |
261203 |
/usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf |
68 |
|
|
fi |
69 |
|
|
|
70 |
|
|
%post |
71 |
|
|
%_post_service bumblebeed |
72 |
|
|
# Simple: still needs this since in release 3 services were not set |
73 |
|
|
# enabled and seams that still isnt properly handeled in %%_post_service |
74 |
shlomif |
265738 |
if [ "$1" -ge "1" ]; then |
75 |
shlomif |
261203 |
# Enable (but don't start) the unit by default |
76 |
|
|
/bin/systemctl enable bumblebeed.service |
77 |
|
|
# Start bumblebeed service |
78 |
|
|
/bin/systemctl start bumblebeed.service |
79 |
|
|
fi |
80 |
|
|
|
81 |
|
|
%preun |
82 |
|
|
%_preun_service bumblebeed |
83 |
|
|
|
84 |
|
|
%postun |
85 |
|
|
# We need this since "%%_postun_groupdel %%{name}" doesnt remove the group if |
86 |
|
|
# set to a user |
87 |
shlomif |
265738 |
if [ "$1" -eq "0" ];then |
88 |
|
|
/usr/sbin/groupdel bumblebee |
89 |
|
|
fi |
90 |
akien |
585500 |
%endif |
91 |
shlomif |
261203 |
|
92 |
akien |
585500 |
%package %{driver} |
93 |
|
|
Summary: Bumblebee configuration files and binaries for %{driver} driver |
94 |
|
|
Group: System/Kernel and hardware |
95 |
|
|
Requires: %{name} = %{version} |
96 |
|
|
%if "%{?distro_section}" == "nonfree" |
97 |
|
|
Requires: nvidia |
98 |
akien |
591336 |
Requires: primus-nvidia |
99 |
akien |
585500 |
Conflicts: %{name}-nouveau |
100 |
|
|
%else |
101 |
|
|
Requires: x11-driver-video-nouveau |
102 |
akien |
591336 |
Requires: primus-nouveau |
103 |
akien |
585500 |
Conflicts: %{name}-nvidia |
104 |
|
|
%endif |
105 |
akien |
585512 |
Provides: %{name}-bin = %{version} |
106 |
akien |
585500 |
|
107 |
|
|
%description %{driver} |
108 |
|
|
Bumblebee configuration files and binaries built against |
109 |
|
|
the %{driver} driver. |
110 |
|
|
|
111 |
|
|
%files %{driver} |
112 |
|
|
%config(noreplace) %{_sysconfdir}/bumblebee/bumblebee.conf |
113 |
|
|
%{_sbindir}/bumblebeed |
114 |
|
|
%{_bindir}/optirun |
115 |
|
|
|
116 |
shlomif |
261203 |
#-------------------------------------------------------------------- |
117 |
|
|
%prep |
118 |
akien |
565728 |
%setup -q |
119 |
shlomif |
261203 |
|
120 |
|
|
%build |
121 |
akien |
590786 |
%configure2_5x --with-udev-rules=%{_udevrulesdir} \ |
122 |
akien |
591336 |
CONF_BRIDGE=primus \ |
123 |
akien |
585500 |
%if "%{?distro_section}" == "nonfree" |
124 |
shlomif |
261203 |
CONF_DRIVER=nvidia \ |
125 |
shlomif |
265607 |
CONF_DRIVER_MODULE_NVIDIA=nvidia-current \ |
126 |
shlomif |
265469 |
%else |
127 |
shlomif |
265607 |
CONF_DRIVER=nouveau \ |
128 |
shlomif |
261203 |
%endif |
129 |
|
|
%ifarch x86_64 |
130 |
akien |
591358 |
CONF_LDPATH_NVIDIA=%{_libdir}/nvidia-current:%{_usr}/lib/nvidia-current \ |
131 |
|
|
CONF_MODPATH_NVIDIA=%{_libdir}/nvidia-current/xorg,%{_usr}/lib/nvidia-current/xorg,%{_libdir}/xorg/modules,%{_usr}/lib/xorg/modules \ |
132 |
akien |
585513 |
CONF_PRIMUS_LD_PATH=%{_libdir}/primus:%{_usr}/lib/primus |
133 |
shlomif |
261203 |
%else |
134 |
akien |
584591 |
CONF_LDPATH_NVIDIA=%{_libdir}/nvidia-current \ |
135 |
akien |
591358 |
CONF_MODPATH_NVIDIA=%{_libdir}/nvidia-current/xorg,%{_libdir}/xorg/modules \ |
136 |
akien |
585513 |
CONF_PRIMUS_LD_PATH=%{_libdir}/primus |
137 |
shlomif |
261203 |
%endif |
138 |
|
|
|
139 |
akien |
565728 |
%make CFLAGS="%{optflags}" |
140 |
shlomif |
261203 |
|
141 |
|
|
%install |
142 |
akien |
585500 |
%if "%{?distro_section}" == "nonfree" |
143 |
|
|
install -D -m644 conf/bumblebee.conf %{buildroot}%{_sysconfdir}/bumblebee/bumblebee.conf |
144 |
|
|
install -D -m755 bin/bumblebeed %{buildroot}%{_sbindir}/bumblebeed |
145 |
|
|
install -D -m755 bin/optirun %{buildroot}%{_bindir}/optirun |
146 |
|
|
%else |
147 |
shlomif |
261203 |
%makeinstall_std |
148 |
akien |
585515 |
install -D -m644 scripts/systemd/bumblebeed.service %{buildroot}%{_unitdir}/bumblebeed.service |
149 |
akien |
585500 |
%endif |