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