]> git.pld-linux.org Git - packages/nvidiabl.git/blob - nvidiabl.spec
- x32 rebuild
[packages/nvidiabl.git] / nvidiabl.spec
1 #
2 # Conditional build:
3 %bcond_without  verbose         # verbose build (V=1)
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  userspace       # don't build userspace programs
6 %bcond_without  dkms            # build dkms package
7
8 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
9 %{error:kernel and userspace cannot be built at the same time on PLD builders}
10 exit 1
11 %endif
12
13 %if %{without userspace}
14 %undefine       with_dkms
15 %endif
16
17 # nothing to be placed to debuginfo package
18 %define         _enable_debug_packages  0
19
20 %define         _duplicate_files_terminate_build        0
21
22 %define         rel     5
23 %define         pname   nvidiabl
24 Summary:        Linux driver for nVidia display back-lights
25 Summary(pl.UTF-8):      Sterownik dla Linuksa do podświetlania wyświetlacza dla kart firmy nVidia
26 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
27 Version:        0.87
28 Release:        %{rel}%{?_pld_builder:@%{_kernel_ver_str}}
29 License:        GPL v2+
30 Group:          Base/Kernel
31 Source0:        https://github.com/guillaumezin/nvidiabl/archive/v%{version}.tar.gz?/%{pname}-%{version}.tgz
32 Source1:        modprobe.conf
33 Patch0:         nvidiabl-dkmsconf.patch
34 # Source0-md5:  e9418d3e500172d79680e44ad0f85743
35 URL:            https://github.com/guillaumezin/nvidiabl
36 BuildRequires:  rpmbuild(macros) >= 1.701
37 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 This driver drives the smartdimmer register found on modern mobile
42 nVidia graphics adapters such as NV40, NV41, NV43, NV44, NV46, NV47,
43 NV49, NV4B, C51, G84, G86, G92, G94, G96, GT200 architectures to
44 adjust the display backlight.
45
46 On Apple machines this driver allows more fine-grained brightness
47 adjustment than the (mbp_nvidia_bl) driver and is generally preferred.
48
49 %description -l pl.UTF-8
50 Ten sterownik steruje rejestrem "smartdimmer" obecnym we współczesnych
51 mobilnych kartach graficznych firmy nVidia (takich jak architektury
52 NV40, NV41, NV43, NV44, NV46, NV47, NV49, NV4B, C51, G84, G86, G92,
53 G94, G96, GT200), służącym do regulacji podświetlenia wyświetlacza.
54
55 Na komputerach firmy Apple ten sterownik pozwala na dokładniejsze
56 ustawianie jasności niż sterownik mbp_nvidia_bl i ogólnie jest
57 zalecany.
58
59 %package -n dkms-%{pname}
60 Summary:        DKMS-ready driver for nVidia display back-lights
61 Summary(pl.UTF-8):      Sterownik zgodny z DKMS do podświetlania wyświetlacza dla kart firmy nVidia
62 License:        GPL v2+
63 Group:          Base/Kernel
64 Requires(pre,post):     dkms
65 %if "%{_rpmversion}" >= "5"
66 BuildArch:      noarch
67 %endif
68
69 %description -n dkms-%{pname}
70 This package contains a DKMS-ready driver for nVidia laptop display
71 back-lights.
72
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-dkms (mbp_nvidia_bl) driver and is
80 generally preferred.
81
82 %description -n dkms-%{pname} -l pl.UTF-8
83 Ten pakiet zawiera zgodny z DKMS sterownik do podświetlania
84 wyświetlacza laptopów z kartą graficzną firmy nVidia.
85
86 Ten sterownik steruje rejestrem "smartdimmer" obecnym we współczesnych
87 mobilnych kartach graficznych firmy nVidia (takich jak architektury
88 NV40, NV41, NV43, NV44, NV46, NV47, NV49, NV4B, C51, G84, G86, G92,
89 G94, G96, GT200), służącym do regulacji podświetlenia wyświetlacza.
90
91 Na komputerach firmy Apple ten sterownik pozwala na dokładniejsze
92 ustawianie jasności niż sterownik mbp_nvidia_bl i ogólnie jest
93 zalecany.
94
95 %define kernel_pkg()\
96 %package -n kernel%{_alt_kernel}-video-nvidiabl\
97 Summary:        Linux driver for nVidia display back-lights\
98 Summary(pl.UTF-8):      Sterownik dla Linuksa do podświetlania wyświetlacza dla kart firmy nVidia\
99 Release:        %{rel}@%{_kernel_ver_str}\
100 Group:          Base/Kernel\
101 Requires(post,postun):  /sbin/depmod\
102 %requires_releq_kernel\
103 Requires(postun):       %releq_kernel\
104 \
105 %description -n kernel%{_alt_kernel}-video-nvidiabl\
106 This driver drives the smartdimmer register found on modern mobile\
107 nVidia graphics adapters such as NV40, NV41, NV43, NV44, NV46, NV47,\
108 NV49, NV4B, C51, G84, G86, G92, G94, G96, GT200 architectures to\
109 adjust the display backlight.\
110 \
111 On Apple machines this driver allows more fine-grained brightness\
112 adjustment than the (mbp_nvidia_bl) driver and is generally preferred.\
113 \
114 %description -n kernel%{_alt_kernel}-video-nvidiabl -l pl.UTF-8\
115 Ten sterownik steruje rejestrem "smartdimmer" obecnym we współczesnych\
116 mobilnych kartach graficznych firmy nVidia (takich jak architektury\
117 NV40, NV41, NV43, NV44, NV46, NV47, NV49, NV4B, C51, G84, G86, G92,\
118 G94, G96, GT200), służącym do regulacji podświetlenia wyświetlacza.\
119 \
120 Na komputerach firmy Apple ten sterownik pozwala na dokładniejsze\
121 ustawianie jasności niż sterownik mbp_nvidia_bl i ogólnie jest\
122 zalecany.\
123 \
124 %if %{with kernel}\
125 %files -n kernel%{_alt_kernel}-video-nvidiabl\
126 %defattr(644,root,root,755)\
127 /lib/modules/%{_kernel_ver}/misc/*.ko*\
128 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/%{pname}.conf\
129 %endif\
130 \
131 %post   -n kernel%{_alt_kernel}-video-nvidiabl\
132 %depmod %{_kernel_ver}\
133 \
134 %postun -n kernel%{_alt_kernel}-video-nvidiabl\
135 %depmod %{_kernel_ver}\
136 %{nil}
137
138 %define build_kernel_pkg()\
139 %build_kernel_modules -m nvidiabl\
140 %install_kernel_modules -D installed -m nvidiabl -d misc\
141 %{nil}
142
143 %{?with_kernel:%{expand:%create_kernel_packages}}
144
145 %prep
146 %setup -qn %{pname}-%{version}
147 %patch0 -p1
148
149 %build
150 %{?with_kernel:%{expand:%build_kernel_packages}}
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT/etc/modprobe.d
155
156 %if %{with kernel}
157 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/modprobe.d/%{pname}.conf
158 cp -a installed/* $RPM_BUILD_ROOT
159 %endif
160
161 %if %{with dkms}
162 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
163 cp -p Makefile *.[ch] $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
164 sed -e 's|@pname@|%{pname}|g' -e 's|@MODVERSION@|%{version}-%{rel}|g' \
165         dkms.conf > $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}/dkms.conf
166 %endif
167
168 %clean
169 rm -rf $RPM_BUILD_ROOT
170
171 %post -n dkms-%{pname}
172 %{_sbindir}/dkms add -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
173 %{_sbindir}/dkms build -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
174 %{_sbindir}/dkms install -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade || :
175
176 %preun -n dkms-%{pname}
177 %{_sbindir}/dkms remove -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
178
179 %if %{with dkms}
180 %files -n dkms-%{pname}
181 %defattr(644,root,root,755)
182 %{_usrsrc}/%{pname}-%{version}-%{rel}
183 %endif
This page took 0.056482 seconds and 3 git commands to generate.