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