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