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