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