]> git.pld-linux.org Git - packages/nvidiabl.git/blob - nvidiabl.spec
add dkms-nvidiabl package, bcond off for now
[packages/nvidiabl.git] / nvidiabl.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_with     verbose         # verbose build (V=1)
6 %bcond_with     dkms    # build dkms package
7
8 # nothing to be placed to debuginfo package
9 %define         _enable_debug_packages  0
10
11 %define         rel     2
12 %define         modname nvidiabl
13 Summary:        Linux driver for nVidia display back-lights
14 Name:           %{modname}%{_alt_kernel}
15 Version:        0.81
16 Release:        %{rel}
17 License:        GPL v2+
18 URL:            https://github.com/guillaumezin/nvidiabl
19 Source0:        https://github.com/guillaumezin/nvidiabl/archive/v%{version}.tar.gz?/%{modname}-%{version}.tgz
20 # Source0-md5:  f72d90c0fe34b36a0ff3b6d7034e99c4
21 Patch0:         nvidiabl-dkmsconf.patch
22 Group:          Base/Kernel
23 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
24 BuildRequires:  rpmbuild(macros) >= 1.379
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 This driver drives the smartdimmer register found on modern mobile
29 nVidia graphics adapters such as NV40, NV41, NV43, NV44, NV46, NV47,
30 NV49, NV4B, C51, G84, G86, G92, G94, G96, GT200 architectures to
31 adjust the display backlight.
32
33 On Apple machines this driver allows more fine-grained brightness
34 adjustment than the (mbp_nvidia_bl) driver and is generally preferred.
35
36 %package -n dkms-%{modname}
37 Summary:        DKMS-ready driver for nVidia display back-lights
38 License:        GPL v2+
39 Group:          Base/Kernel
40 Requires(pre):  dkms
41 Requires(post): dkms
42 %if "%{_rpmversion}" >= "5"
43 BuildArch:      noarch
44 %endif
45
46 %description -n dkms-%{modname}
47 This package contains a DKMS-ready driver for nvidia laptop display
48 back-lights.
49
50 This driver drives the smartdimmer register found on modern mobile
51 Nvidia graphics adapters such as NV40, NV41, NV43, NV44, NV46, NV47,
52 NV49, NV4B, C51, G84, G86, G92, G94, G96, GT200 architectures to
53 adjust the display backlight.
54
55 On Apple machines this driver allows more fine-grained brightness
56 adjustment than the mbp-nvidia-bl-dkms (mbp_nvidia_bl) driver and is
57 generally preferred.
58
59
60 %package -n kernel%{_alt_kernel}-video-nvidiabl
61 Summary:        Linux driver for nVidia display back-lights
62 Summary(pl.UTF-8):      Sterownik dla Linuksa do nvidiabl
63 Release:        %{rel}@%{_kernel_ver_str}
64 Group:          Base/Kernel
65 Requires(post,postun):  /sbin/depmod
66 %if %{with dist_kernel}
67 %requires_releq_kernel
68 Requires(postun):       %releq_kernel
69 %endif
70
71 %description -n kernel%{_alt_kernel}-video-nvidiabl
72 This driver drives the smartdimmer register found on modern mobile
73 nVidia graphics adapters such as NV40, NV41, NV43, NV44, NV46, NV47,
74 NV49, NV4B, C51, G84, G86, G92, G94, G96, GT200 architectures to
75 adjust the display backlight.
76
77 On Apple machines this driver allows more fine-grained brightness
78 adjustment than the (mbp_nvidia_bl) driver and is generally preferred.
79
80 %description -n kernel%{_alt_kernel}-video-nvidiabl -l pl.UTF-8
81 Sterownik dla Linuksa do nvidiabl.
82
83 Ten pakiet zawiera moduł jądra Linuksa.
84
85 %prep
86 %setup -qn %{modname}-%{version}
87 %patch0 -p1
88
89 %build
90 %if %{with kernel}
91 %build_kernel_modules -m nvidiabl
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96 %if %{with kernel}
97 %install_kernel_modules -m nvidiabl -d misc
98 %endif
99
100 %if %{with dkms}
101 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{modname}-%{version}-%{rel}
102 cp -a Makefile *.[ch] $RPM_BUILD_ROOT%{_usrsrc}/%{modname}-%{version}-%{rel}
103 sed -e 's|@MODNAME@|%{modname}|g' -e 's|@MODVERSION@|%{version}-%{rel}|g' \
104         dkms.conf > $RPM_BUILD_ROOT%{_usrsrc}/%{modname}-%{version}-%{rel}/dkms.conf
105 %endif
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %post -n dkms-%{modname}
111 %{_sbindir}/dkms add -m %{modname} -v %{version}-%{rel} --rpm_safe_upgrade && \
112 %{_sbindir}/dkms build -m %{modname} -v %{version}-%{rel} --rpm_safe_upgrade && \
113 %{_sbindir}/dkms install -m %{modname} -v %{version}-%{rel} --rpm_safe_upgrade || :
114
115 %preun -n dkms-%{modname}
116 %{_sbindir}/dkms remove -m %{modname} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
117
118 %post   -n kernel%{_alt_kernel}-video-nvidiabl
119 %depmod %{_kernel_ver}
120
121 %postun -n kernel%{_alt_kernel}-video-nvidiabl
122 %depmod %{_kernel_ver}
123
124 %if %{with dkms}
125 %files -n dkms-%{modname}
126 %defattr(644,root,root,755)
127 %{_usrsrc}/%{modname}-%{version}-%{rel}
128 %endif
129
130 %if %{with kernel}
131 %files -n kernel%{_alt_kernel}-video-nvidiabl
132 %defattr(644,root,root,755)
133 /lib/modules/%{_kernel_ver}/misc/*.ko*
134 %endif
This page took 0.035921 seconds and 4 git commands to generate.