10 |
Summary: Support for NVidia Optimus laptops on Linux |
Summary: Support for NVidia Optimus laptops on Linux |
11 |
Group: System/Kernel and hardware |
Group: System/Kernel and hardware |
12 |
Version: 3.0 |
Version: 3.0 |
13 |
Release: %mkrel 8 |
Release: %mkrel 9 |
14 |
License: GPLv3 |
License: GPLv3 |
15 |
URL: https://github.com/Bumblebee-Project/bumblebee |
URL: https://github.com/Bumblebee-Project/bumblebee |
16 |
# source from git repo git://github.com/Bumblebee-Project/Bumblebee.git |
# source from git repo git://github.com/Bumblebee-Project/Bumblebee.git |
57 |
|
|
58 |
%pre |
%pre |
59 |
%_pre_groupadd %{name} |
%_pre_groupadd %{name} |
|
users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') |
|
|
echo "Adding members from group(s) '$users' to 'bumblebee':" |
|
|
echo $users |
|
|
for user in $users; do |
|
|
gpasswd -a $user bumblebee |
|
|
done |
|
60 |
if [ "$1" -eq "1" ];then |
if [ "$1" -eq "1" ];then |
61 |
|
users=$(getent passwd | awk -F: '$3 >= 500 && $3 < 60000 {print $1}') |
62 |
|
for user in $users; do |
63 |
|
gpasswd -a $user bumblebee |
64 |
|
done |
65 |
/usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf |
/usr/sbin/update-alternatives --set gl_conf %{_sysconfdir}/ld.so.conf.d/GL/standard.conf |
66 |
fi |
fi |
67 |
|
|
69 |
%_post_service bumblebeed |
%_post_service bumblebeed |
70 |
# Simple: still needs this since in release 3 services were not set |
# Simple: still needs this since in release 3 services were not set |
71 |
# enabled and seams that still isnt properly handeled in %%_post_service |
# enabled and seams that still isnt properly handeled in %%_post_service |
72 |
if [ $1 -ge 1 ]; then |
if [ "$1" -ge "1" ]; then |
73 |
# Enable (but don't start) the unit by default |
# Enable (but don't start) the unit by default |
74 |
/bin/systemctl enable bumblebeed.service |
/bin/systemctl enable bumblebeed.service |
75 |
# Start bumblebeed service |
# Start bumblebeed service |
82 |
%postun |
%postun |
83 |
# We need this since "%%_postun_groupdel %%{name}" doesnt remove the group if |
# We need this since "%%_postun_groupdel %%{name}" doesnt remove the group if |
84 |
# set to a user |
# set to a user |
85 |
/usr/sbin/groupdel bumblebee |
if [ "$1" -eq "0" ];then |
86 |
|
/usr/sbin/groupdel bumblebee |
87 |
|
fi |
88 |
|
|
89 |
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
90 |
%prep |
%prep |