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