]> git.pld-linux.org Git - packages/em8300.git/blob - em8300.spec
- release 53.1 (rebuild against 2.6.16.53-2)
[packages/em8300.git] / em8300.spec
1 # TODO
2 # - cc
3 #
4 # Conditional build:
5 %bcond_without  dist_kernel     # allow non-distribution kernel
6 %bcond_without  kernel          # don't build kernel modules
7 %bcond_without  up              # don't build UP module
8 %bcond_without  smp             # don't build SMP module
9 %bcond_without  userspace       # don't build userspace tools
10 %bcond_with     verbose         # verbose build (V=1)
11 %bcond_with     grsec_kernel    # build for kernel-grsecurity
12 #
13 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
14 %define alt_kernel      grsecurity
15 %endif
16 #
17 %ifarch sparc
18 # kernel modules won't build on sparc32, no I2C in kernel
19 %undefine       with_kernel
20 %endif
21
22 %if %{without kernel}
23 %undefine       with_dist_kernel
24 %endif
25
26 %define         _rel    53.1
27 Summary:        DXR3 and H+ driver
28 Summary(pl):    Sterowniki dla DXR3 i H+
29 Name:           em8300
30 Version:        0.16.0
31 Release:        %{_rel}
32 License:        GPL
33 Group:          Applications/System
34 Source0:        http://dl.sourceforge.net/dxr3/%{name}-%{version}.tar.gz
35 # Source0-md5:  9e9b769b99927079b4fd6ec423d95049
36 Source1:        %{name}.init
37 Source2:        %{name}.sysconf
38 Patch0:         %{name}-make.patch
39 URL:            http://dxr3.sourceforge.net/
40 %if %{with userspace}
41 BuildRequires:  autoconf >= 2.13
42 BuildRequires:  automake
43 BuildRequires:  gtk+2-devel >= 1:2.0.0
44 BuildRequires:  pkgconfig
45 %endif
46 %if %{with kernel}
47 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.14}
48 BuildRequires:  rpmbuild(macros) >= 1.308
49 %endif
50 Requires(post,preun):   /sbin/chkconfig
51 Provides:       dxr3
52 Obsoletes:      em8300-libs
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %description
56 em8300 is a Linux driver for Creative DXR3 and Sigma Designs
57 Hollywood+ cards. Both cards are hardware MPEG1, MPEG2, AC3 decoders.
58 Additionaly Xine and MPlayer with help of this driver allow you to
59 play all the video formats that they recognise through the tv-out of
60 these cards.
61
62 %description -l pl
63 em8300 pozwala na uruchomienie pod Linuksem kart Creative DXR3 i Sigma
64 Designs Hollywood+. Obie karty, o prawie identycznej konstrukcji s±
65 sprzêtowymi dekoderami MPEG1, MPEG2 i AC3. Programy Xine i MPlayer
66 pozwalaj± przy u¿yciu tego sterownika na odtwarzanie przez wyj¶cie
67 telewizyjne tych kart nie tylko w/w formatów, ale tak¿e wszystkich
68 formatów video, które te programy rozpoznaj±.
69
70 %package devel
71 Summary:        Header file to communicate with em8300 Linux kernel modules
72 Summary(pl):    Plik nag³ówkowy do komunikacji z modu³ami j±dra Linuksa em8300
73 Group:          Development/Libraries
74 Obsoletes:      em8300-static
75
76 %description devel
77 Header file to communicate with em8300 Linux kernel modules.
78
79 %description devel -l pl
80 Plik nag³ówkowy do komunikacji z modu³ami j±dra Linuksa em8300.
81
82 %package gtk
83 Summary:        Utility programs for em8300 using GTK+
84 Summary(pl):    Programy u¿ytkowe em8300 u¿ywaj±ce bibliteki GTK+
85 Group:          X11/Applications
86 Requires:       %{name} = %{version}-%{release}
87
88 %description gtk
89 Utility programs for em8300 using GTK+ toolkit.
90
91 %description gtk -l pl
92 Programy u¿ytkowe em8300 u¿ywaj±ce biblioteki GTK+.
93
94 %package -n kernel%{_alt_kernel}-video-em8300
95 Summary:        em8300 Linux kernel modules
96 Summary(pl):    Modu³y j±dra Linuksa em8300
97 Group:          Base/Kernel
98 Requires(post,postun):  /sbin/depmod
99 %if %{with dist_kernel}
100 %requires_releq_kernel_up
101 Requires(postun):       %releq_kernel_up
102 %endif
103
104 %description -n kernel%{_alt_kernel}-video-em8300
105 em8300 Linux kernel modules.
106
107 %description -n kernel%{_alt_kernel}-video-em8300 -l pl
108 Modu³y j±dra Linuksa em8300.
109
110 %package -n kernel%{_alt_kernel}-smp-video-em8300
111 Summary:        em8300 Linux SMP kernel modules
112 Summary(pl):    Modu³y j±dra Linuksa SMP em8300
113 Group:          Base/Kernel
114 Requires(post,postun):  /sbin/depmod
115 %if %{with dist_kernel}
116 %requires_releq_kernel_smp
117 Requires(postun):       %releq_kernel_smp
118 %endif
119
120 %description -n kernel%{_alt_kernel}-smp-video-em8300
121 em8300 Linux SMP kernel modules.
122
123 %description -n kernel%{_alt_kernel}-smp-video-em8300 -l pl
124 Modu³y j±dra Linuksa SMP em8300.
125
126 %prep
127 %setup -q
128 %patch0 -p0
129
130 %build
131 %if %{with userspace}
132 %{__aclocal} -I autotools
133 %{__autoconf}
134 %{__autoheader}
135 %{__automake}
136 %configure
137 %{__make}
138 %endif
139
140 %if %{with kernel}
141 cd modules
142 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
143         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
144                 exit 1
145         fi
146         install -d o/include/linux
147         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
148         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
149         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
150 %if %{with dist_kernel}
151         %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
152 %endif
153         install -d o/include/config
154         touch o/include/config/MARKER
155         ln -sf %{_kernelsrcdir}/scripts o/scripts
156
157         cp ../include/linux/em8300.h o/include/linux/em8300.h
158
159         %{__make} -C %{_kernelsrcdir} clean \
160                 RCS_FIND_IGNORE="-name '*.ko' -o" \
161                 SYSSRC=%{_kernelsrcdir} \
162                 SYSOUT=$PWD/o \
163                 M=$PWD O=$PWD/o \
164                 %{?with_verbose:V=1}
165         %{__make} -C %{_kernelsrcdir} modules \
166                 CC="%{__cc}" CPP="%{__cpp}" \
167                 SYSSRC=%{_kernelsrcdir} \
168                 SYSOUT=$PWD/o \
169                 M=$PWD O=$PWD/o \
170                 %{?with_verbose:V=1}
171
172         for i in em8300 adv717x bt865; do
173                 mv $i{,-$cfg}.ko
174         done
175 done
176 %endif
177
178 %install
179 rm -rf $RPM_BUILD_ROOT
180
181 %if %{with userspace}
182 %{__make} install \
183         DESTDIR=$RPM_BUILD_ROOT
184
185 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
186 install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
187 %endif
188
189 %if %{with kernel}
190 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/video
191 for i in adv717x bt865 em8300; do
192         install modules/$i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
193                 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/video/$i.ko
194 done
195 %if %{with smp} && %{with dist_kernel}
196 for i in adv717x bt865 em8300; do
197         install modules/$i-smp.ko \
198                 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/video/$i.ko
199 done
200 %endif
201 %endif
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %post
207 /sbin/chkconfig --add %{name}
208 if [ -f /var/lock/subsys/%{name} ]; then
209         /etc/rc.d/init.d/%{name} restart 1>&2
210 else
211         echo "Run \"/etc/rc.d/init.d/%{name} start\" to load %{name} modules."
212 fi
213
214 %preun
215 if [ "$1" = "0" ]; then
216         if [ -f /var/lock/subsys/%{name} ]; then
217                 /etc/rc.d/init.d/%{name} stop 1>&2
218         fi
219         /sbin/chkconfig --del %{name}
220 fi
221
222 %post   -n kernel%{_alt_kernel}-video-em8300
223 %depmod %{_kernel_ver}
224
225 %postun -n kernel%{_alt_kernel}-video-em8300
226 %depmod %{_kernel_ver}
227
228 %post   -n kernel%{_alt_kernel}-smp-video-em8300
229 %depmod %{_kernel_ver}smp
230
231 %postun -n kernel%{_alt_kernel}-smp-video-em8300
232 %depmod %{_kernel_ver}smp
233
234 %if %{with userspace}
235 %files
236 %defattr(644,root,root,755)
237 %doc AUTHORS ChangeLog README modules/README*
238 %attr(755,root,root) %{_bindir}/em8300setup
239 /lib/firmware/em8300.bin
240 %dir %{_datadir}/em8300
241 %{_datadir}/em8300/em8300.pm
242 %attr(755,root,root) %{_datadir}/em8300/*.pl
243 %{_mandir}/man1/em8300setup.1*
244 %attr(754,root,root) /etc/rc.d/init.d/%{name}
245 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
246 # subpackage? (is it usable without alsa?)
247 %{_datadir}/alsa/cards/EM8300.conf
248
249 %files devel
250 %defattr(644,root,root,755)
251 %{_includedir}/linux/em8300.h
252
253 %files gtk
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_bindir}/autocal
256 %attr(755,root,root) %{_bindir}/dhc
257 %attr(755,root,root) %{_bindir}/dxr3view
258 %endif
259
260 %if %{with kernel}
261 %if %{with up} || %{without dist_kernel}
262 %files -n kernel%{_alt_kernel}-video-em8300
263 %defattr(644,root,root,755)
264 /lib/modules/%{_kernel_ver}/kernel/drivers/video/*.ko*
265 %endif
266
267 %if %{with dist_kernel} && %{with smp}
268 %files -n kernel%{_alt_kernel}-smp-video-em8300
269 %defattr(644,root,root,755)
270 /lib/modules/%{_kernel_ver}smp/kernel/drivers/video/*.ko*
271 %endif
272 %endif
This page took 0.044368 seconds and 4 git commands to generate.