]> git.pld-linux.org Git - packages/mythtv.git/blob - mythtv.spec
- rel 1
[packages/mythtv.git] / mythtv.spec
1 # TODO
2 # - bconds: altivec joystick lcd
3 # - lcd? (app-misc/lcdproc)
4 # - icons for desktop entries
5 # - alpha, sparc, ppc arches?
6 #
7 # Specfile for MythTV
8 #
9 #  MythTV now uses a fairly intelligent cpu-detection script, so if you are
10 #  building an rpm by hand on the machine it will be used on, I encourage you
11 #  to use "--with cpu_autodetect" to let mythtv decide for you.
12 #
13 # Conditional build:
14 %bcond_with     cpu_autodetect  # enable CPU autodetection at compile time (sets "-march", "-mcpu" compile flags really)
15 %bcond_without  lirc            # lirc support
16 %bcond_without  alsa            # alsa support
17 %bcond_without  oss             # oss support
18 %bcond_without  arts            # arts support
19 %bcond_without  jack            # jack audio connection kit
20 %bcond_without  opengl          # opengl vsync
21 %bcond_with     dvb             # DVB support # invalid option
22 %bcond_without  xrandr          # disable X11 resolution switching
23 %bcond_with     ivtv            # ivtv support (PVR-250, PVR-350) NFY
24 %bcond_with     firewire        # ieee1394 (NFY)
25 %bcond_without  xvmc            # do not use XvMCW
26 %bcond_with     mmx                     # enable mmx
27
28 # enable mmx automatically on arches having it
29 %ifarch %{ix86} %{x8664}
30 %ifnarch i386 i486 i586 i686
31 %define with_mmx 1
32 %endif
33 %endif
34
35 #define _snap 20060905
36 #define _rev 11046
37 %define _rel 1
38 Summary:        A personal video recorder (PVR) application
39 Summary(pl.UTF-8):      Osobista aplikacja do nagrywania obrazu (PVR)
40 Name:           mythtv
41 Version:        0.20
42 Release:        %{?_snap:0.%{_snap}.%{_rev}.}%{_rel}
43 License:        GPL v2
44 Group:          Applications/Multimedia
45 #Source0:       http://www.mythtv.org/mc/%{name}-%{version}.tar.bz2
46 Source0:        %{name}-%{version}-fix.tar.bz2
47 # Source0-md5:  8901d3962eb58d1dd9ec2cd3bdbdfb76
48 #Source0:       %{name}-%{_snap}.%{_rev}.tar.bz2
49 Source1:        mythbackend.sysconfig
50 Source2:        mythbackend.init
51 Source3:        mythbackend.logrotate
52 Source5:        mythfrontend.desktop
53 #Patch100:              %{name}-branch.diff
54 Patch0:         %{name}-lib64.patch
55 Patch1:         mythtv-configure.patch
56 Patch2:         %{name}-mythstream.patch
57 Patch3:         %{name}-ldconfig.patch
58 #Patch4:                %{name}-pl.patch
59 Patch5:         %{name}-sbinpath.patch
60 Patch7:         %{name}-optflags.patch
61 Patch8:         mythtv-dvdnav-shared.patch
62 URL:            http://www.mythtv.org/
63 #BuildRequires: DirectFB-devel
64 #BuildRequires: XFree86-devel
65 %{?with_alsa:BuildRequires:     alsa-lib-devel}
66 %{?with_arts:BuildRequires:     arts-devel >= 13:0.9.5}
67 BuildRequires:  freetype-devel >= 1:2.0.0
68 %{?with_jack:BuildRequires:     jack-audio-connection-kit-devel}
69 BuildRequires:  lame-libs-devel
70 %{?with_xvmc:BuildRequires:     xorg-lib-libXvMC-devel}
71 %{?with_firewire:BuildRequires: libavc1394-devel}
72 %{?with_dvb:BuildRequires:      libdvb-devel}
73 BuildRequires:  libdvdnav-devel
74 %{?with_firewire:BuildRequires: libiec61883-devel}
75 %{?with_firewire:BuildRequires: libraw1394-devel}
76 BuildRequires:  linux-libc-headers >= 7:2.6.10
77 %{?with_lirc:BuildRequires:     lirc-devel}
78 BuildRequires:  mysql-devel
79 #BuildRequires: patchutils
80 BuildRequires:  qmake >= 6:3.2.1-4
81 BuildRequires:  qt-devel >= 6:3.2.1-4
82 BuildRequires:  rpmbuild(macros) >= 1.228
83 BuildRequires:  sed >= 4.0
84 # for bundled libavcodec
85 BuildRequires:  libdts-devel
86 #BuildConflicts:        libmyth-devel
87 ExclusiveArch:  %{ix86} %{x8664} ppc
88 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89
90 %define myth_api_version %(echo %{version} | cut -d. -f1,2)
91
92 %description
93 MythTV implements the following PVR features, and more, with a unified
94 graphical interface:
95 - Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
96 - Video compression using RTjpeg or MPEG-4
97 - Program listing retrieval using XMLTV
98 - Themable, semi-transparent on-screen display
99 - Electronic program guide
100 - Scheduled recording of TV programs
101 - Resolution of conflicts between scheduled recordings
102 - Basic video editing
103
104 %description -l pl.UTF-8
105 MythTV implementuje następujące możliwości PVR, a nawet więcej, wraz z
106 ujednoliconym interfejsem graficznym:
107 - podstawowa funkcjonalność "live-tv"; pauza, szybkie przewijanie,
108   przewijanie "żywej" telewizji
109 - kompresja obrazu przy użyciu RTjpeg lub MPEG-4
110 - odczyt listy programów przy użyciu XMLTV
111 - pseudoprzezroczyste wyświetlanie na obrazie (OSD) z obsługą motywów
112 - elektroniczny przewodnik po programie
113 - planowane nagrywanie programów telewizyjnych
114 - rozwiązywanie konfliktów między planowanymi nagraniami
115 - podstawowa edycja obrazu
116
117 %package backend
118 Summary:        Server component of mythtv (a PVR)
119 Summary(pl.UTF-8):      Część serwerowa mythtv (PVR)
120 Group:          Applications/Multimedia
121 Requires(post,preun):   /sbin/chkconfig
122 Requires(postun):       /usr/sbin/groupdel
123 Requires(postun):       /usr/sbin/userdel
124 Requires(pre):  /bin/id
125 Requires(pre):  /usr/bin/getgid
126 Requires(pre):  /usr/sbin/groupadd
127 Requires(pre):  /usr/sbin/useradd
128 Requires:       libmyth = %{version}-%{release}
129 Requires:       mythtv = %{version}-%{release}
130 Provides:       group(mythtv)
131 Provides:       user(mythtv)
132
133 %description backend
134 MythTV provides a unified graphical interface for recording and
135 viewing television programs. Refer to the mythtv package for more
136 information.
137
138 This package contains only the server software, which provides video
139 and audio capture and encoding services. In order to be useful, it
140 requires a mythtv-frontend installation, either on the same system or
141 one reachable via the network.
142
143 %description backend -l pl.UTF-8
144 MythTV dostarcza ujednolicony interfejs graficzny do nagrywania i
145 oglądania programów telewizyjnych. Więcej informacji w pakiecie
146 mythtv.
147
148 Ten pakiet zawiera tylko oprogramowanie serwerowe, udostępniające
149 usługi przechwytywania i kodowania obrazu i dźwięku. Aby było
150 przydatne, wymaga instalacji mythtv-frontend - na tym samym systemie,
151 albo innym osiągalnym po sieci.
152
153 %package frontend
154 Summary:        Client component of mythtv (a PVR)
155 Summary(pl.UTF-8):      Część kliencka mythtv (PVR)
156 Group:          Applications/Multimedia
157 Requires:       libmyth = %{version}-%{release}
158 Requires:       mythtv = %{version}-%{release}
159 Requires:       mythtv-themes = %{version}-%{release}
160 Provides:       mythtv-frontend-api = %{myth_api_version}
161
162 %description frontend
163 MythTV provides a unified graphical interface for recording and
164 viewing television programs. Refer to the mythtv package for more
165 information.
166
167 This package contains only the client software, which provides a
168 front-end for playback and configuration. It requires access to a
169 mythtv-backend installation, either on the same system or one
170 reachable via the network.
171
172 %description frontend -l pl.UTF-8
173 MythTV dostarcza ujednolicony interfejs graficzny do nagrywania i
174 oglądania programów telewizyjnych. Więcej informacji w pakiecie
175 mythtv.
176
177 Ten pakiet zawiera tylko oprogramowanie klienckie, dostarczające
178 frontend do odtwarzania i konfiguracji. Wymaga dostępu do instalacji
179 mythtv-backend - na tym samym systemie, albo innym osiągalnym po
180 sieci.
181
182 %package setup
183 Summary:        Setup the mythtv backend
184 Summary(pl.UTF-8):      Konfigurator backendu mythtv
185 Group:          Applications/Multimedia
186 Requires:       libmyth = %{version}-%{release}
187
188 %description setup
189 MythTV provides a unified graphical interface for recording and
190 viewing television programs. Refer to the mythtv package for more
191 information.
192
193 This package contains only the setup software for configuring the
194 mythtv backend.
195
196 %description setup -l pl.UTF-8
197 MythTV dostarcza ujednolicony interfejs graficzny do nagrywania i
198 oglądania programów telewizyjnych. Więcej informacji w pakiecie
199 mythtv.
200
201 Ten pakiet zawiera tylko program do konfigurowania backendu mythtv.
202
203 %package themes
204 Summary:        Base themes for mythtv's frontend
205 Summary(pl.UTF-8):      Podstawowe motywy dla frontendu mythtv
206 Requires:       %{name}-frontend = %{version}-%{release}
207 Group:          Themes
208
209 %description themes
210 MythTV provides a unified graphical interface for recording and
211 viewing television programs. Refer to the mythtv package for more
212 information.
213
214 This package contains only the base themes used by the frontend and
215 mythtvsetup.
216
217 %description themes -l pl.UTF-8
218 MythTV dostarcza ujednolicony interfejs graficzny do nagrywania i
219 oglądania programów telewizyjnych. Więcej informacji w pakiecie
220 mythtv.
221
222 Ten pakiet zawiera tylko podstawowe motywy używane przez frontend oraz
223 mythtvsetup.
224
225 %package -n libmyth
226 Summary:        Library providing mythtv support
227 Summary(pl.UTF-8):      Biblioteka udostępniająca obsługę mythtv
228 Group:          Libraries
229 Requires:       freetype >= 1:2.0.0
230 Requires:       lame
231 Requires:       qt >= 6:3.2.1-4
232 Requires:       qt-plugin-mysql >= 6:3.2.1-4
233
234 %description -n libmyth
235 Common library code for MythTV and add-on modules (development) MythTV
236 provides a unified graphical interface for recording and viewing
237 television programs. Refer to the mythtv package for more information.
238
239 %description -n libmyth -l pl.UTF-8
240 Wspólny kod biblioteki dla MythTV i dodatkowych modułów MythTV
241 dostarczający ujednolicony interfejs graficzny do nagrywania i
242 oglądania programów telewizyjnych. Więcej informacji w pakiecie
243 mythtv.
244
245 %package -n libmyth-devel
246 Summary:        Development files for libmyth
247 Summary(pl.UTF-8):      Pliki nagłówkowe libmyth
248 Group:          Development/Libraries
249 Requires:       libmyth = %{version}-%{release}
250
251 %description -n libmyth-devel
252 This package contains the header files for developing add-ons for
253 mythtv.
254
255 %description -n libmyth-devel -l pl.UTF-8
256 Ten pakiet zawiera pliki nagłówkowe do tworzenia dodatków dla mythtv.
257
258 %package -n libmyth-static
259 Summary:        Static libmyth library
260 Summary(pl.UTF-8):      Statyczna biblioteka libmyth
261 Group:          Development/Libraries
262 Requires:       libmyth-devel = %{version}-%{release}
263
264 %description -n libmyth-static
265 Static libmyth library.
266
267 %description -n libmyth-static -l pl.UTF-8
268 Statyczna biblioteka libmyth.
269
270 %prep
271 %setup -q %{?_rev:-n %{name}} %{?_rel: -n %{name}-%{version}-fix}
272 %if %{_lib} != "lib"
273 #%patch0 -p1
274 %endif
275 %patch1 -p1
276 %patch2 -p1
277 %patch3 -p1
278 #%patch4 -p1 REDIFF and submit
279 %patch5 -p1
280
281 %patch7 -p1
282 %patch8 -p1
283
284 rm -rf database/old # not supported in PLD
285
286 # lib64 fix - enable to update patch
287 %if %{_lib} != "lib" && 0
288 find '(' -name '*.[ch]' -o -name '*.cpp' -o -name '*.pro' ')' | \
289 xargs grep -l /lib . | xargs sed -i -e '
290         s,/''usr/lib/,/%{_libdir}/,g
291         s,/''lib/mythtv,/%{_lib}/mythtv,g
292         s,{PREFIX}/lib$,{PREFIX}/%{_lib},g
293 '
294 exit 1
295 %endif
296
297 # Assigning null to QMAKE_LIBDIR_QT will prevent makefiles contain
298 # -L$(QTDIR)/%{_lib} and -Wl,-rpath,$(QTDIR)/%{_lib}. And that will
299 # prevent compiler finding libs from system when they should be looked
300 # from current buildtree.
301 # but that made it link with -lqt which doesn't exist, instead of -lqt-mt
302 # so we make QMAKE wrapper which will do sed subst after calling
303 # qmake. this is the wrapper.
304 cat > qmake-wrapper.sh <<'EOF'
305 #!/bin/sh
306 getmakefile() {
307         while [ $# -gt 0 ]; do
308                 case "$1" in
309                 -o)
310                         shift
311                         makefile="$1"
312                         return
313                         ;;
314                 esac
315                 shift
316         done
317 }
318
319 qmake "$@"
320 getmakefile "$@"
321 if [ "$makefile" ]; then
322         %{__sed} -i -e '
323                 s;-Wl,-rpath,$(QTDIR)/%{_lib};;
324                 s;-L$(QTDIR)/%{_lib};;
325         ' $makefile
326 fi
327 EOF
328 chmod +x qmake-wrapper.sh
329
330 %build
331 %if %{with cpu_autodetect}
332 # Make sure we have /proc mounted
333 if [ ! -r /proc/cpuinfo ]; then
334         echo "You need to have /proc mounted in order to build with cpu_autodetect!"
335         exit 1
336 fi
337 %endif
338 export QTDIR="%{_prefix}"
339
340 %if "%{_lib}" != "lib"
341 export QMAKE_LIBDIR_X11=%{_prefix}/X11R6/%{_lib}
342 # help configure::has_library() to locate libs
343 export LD_LIBRARY_PATH=%{_libdir}
344 %endif
345
346 # NB: not autoconf configure
347 export CC="%{__cc}"
348 export CXX="%{__cxx}"
349 ./configure \
350         --prefix=%{_prefix} \
351         --libdir=%{_libdir} \
352         --mandir=%{_mandir} \
353         --disable-opts \
354         --disable-distcc --disable-ccache \
355         --compile-type=%{?debug:debug}%{!?debug:release} \
356         --extra-cflags="%{rpmcflags} -fomit-frame-pointer" \
357         --extra-cxxflags="%{rpmcxxflags} -fomit-frame-pointer" \
358 %if %{with cpu_autodetect}
359         --enable-proc-opt \
360 %else
361         %ifarch %{ix86}
362                 %ifarch athlon
363                         --arch=athlon \
364                 %else
365                         --cpu=i386 --tune=pentium4 \
366                 %endif
367         %endif
368         %ifarch %{x8664}
369         --arch=x86_64 \
370         %endif
371         %{?with_mmx:--enable-mmx} \
372 %endif
373         %{?with_dvb:--enable-dvb --dvb-path=%{_includedir} --enable-dvb-eit} \
374         --%{?with_arts:en}%{!?with_arts:dis}able-audio-arts \
375         --%{?with_alsa:en}%{!?with_alsa:dis}able-audio-alsa \
376         --%{?with_oss:en}%{!?with_oss:dis}able-audio-oss \
377         --%{?with_jack:en}%{!?with_jack:dis}able-audio-jack \
378         --%{?with_opengl:en}%{!?with_opengl:dis}able-opengl-vsync \
379         --%{?with_lirc:en}%{!?with_lirc:dis}able-lirc \
380         --%{?with_firewire:en}%{!?with_firewire:dis}able-firewire \
381         --%{?with_xrandr:en}%{!?with_xrandr:dis}able-xrandr \
382         --%{?with_xvmc:en}%{!?with_xvmc:dis}able-xvmc \
383         --enable-xv \
384         --enable-x11 \
385
386 qmake mythtv.pro
387 %{__make} \
388         QMAKE=$(pwd)/qmake-wrapper.sh
389
390 %install
391 rm -rf $RPM_BUILD_ROOT
392 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,sysconfig} \
393                 $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_desktopdir}} \
394                 $RPM_BUILD_ROOT/var/{cache,lib,log,run}/mythtv \
395                 $RPM_BUILD_ROOT%{_libdir}/mythtv/plugins
396
397 export QTDIR="%{_prefix}"
398 %{__make} install \
399         INSTALL_ROOT=$RPM_BUILD_ROOT
400
401 # Install the files that we added on top of mythtv's own stuff
402 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mythbackend
403 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mythbackend
404 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/mythbackend
405
406 # desktop entries
407 install %{SOURCE5} $RPM_BUILD_ROOT%{_desktopdir}
408
409 # Install settings.pro so people can see the build options we used
410 install -d $RPM_BUILD_ROOT%{_datadir}/mythtv/build
411 install config.mak settings.pro $RPM_BUILD_ROOT%{_datadir}/mythtv/build
412
413 for p in mythfrontend; do
414         for l in $RPM_BUILD_ROOT%{_datadir}/mythtv/i18n/${p}_*.qm; do
415                 echo $l | sed -e "s,^$RPM_BUILD_ROOT\(.*${p}_\(.*\).qm\),%%lang(\2) \1,"
416         done > $p.lang
417 done
418
419 # glibc language codes. attempt was made to change it on libmyth side,
420 # but that was just asking for trouble due large coverage of
421 # language.lower() usage.
422 sed -i -e '
423 s,%%lang(en_gb),%%lang(en_GB),
424 s,%%lang(zh_tw),%%lang(zh_TW),
425 s,%%lang(pt_br),%%lang(pt_BR),
426 ' *.lang
427
428 rm -rf mythtvosd mythwelcome mythlcdserver
429 install -d mythtvosd mythwelcome
430 cp -a programs/mythtvosd/{README,*.xml} mythtvosd
431 cp -a programs/mythwelcome/README mythwelcome
432 cp -a programs/mythlcdserver/README mythlcdserver
433
434 %clean
435 rm -rf $RPM_BUILD_ROOT
436
437 %pre backend
438 %groupadd -g 149 %{name}
439 %useradd -u 149 -d /var/lib/mythtv -g %{name} -c "MythTV User" %{name}
440 %addusertogroup %{name} video
441 %addusertogroup %{name} audio
442
443 %post backend
444 /sbin/chkconfig --add mythbackend
445
446 %preun backend
447 if [ "$1" = "0" ]; then
448         %service -q mythbackend stop
449         /sbin/chkconfig --del mythbackend
450 fi
451
452 %postun backend
453 if [ "$1" = "0" ]; then
454         %userremove %{name}
455         %groupremove %{name}
456 fi
457
458 %post   -n libmyth -p /sbin/ldconfig
459 %postun -n libmyth -p /sbin/ldconfig
460
461 %post setup
462 if [ "$1" = 1 ]; then
463 %banner -e %{name}-setup <<EOF
464 To grant mysql permissions to mythtv, please run
465 zcat %{_docdir}/%{name}-setup-%{version}/database/mc.sql.gz | mysql
466 EOF
467 fi
468
469 %files
470 %defattr(644,root,root,755)
471 %doc README* UPGRADING AUTHORS FAQ
472 %doc docs contrib configfiles
473 %doc keys.txt mythtvosd mythwelcome mythlcdserver
474
475 %files backend
476 %defattr(644,root,root,755)
477 %attr(755,root,root) %{_sbindir}/mythbackend
478 %attr(755,root,root) %{_sbindir}/mythcommflag
479 %attr(755,root,root) %{_bindir}/mythfilldatabase
480 %attr(755,root,root) %{_sbindir}/mythjobqueue
481 %attr(755,root,root) %{_sbindir}/mythlcdserver
482 %attr(755,root,root) %{_bindir}/mythtranscode
483 %attr(755,root,root) %{_bindir}/mythreplex
484 %attr(775,root,mythtv) %dir /var/lib/mythtv
485 %attr(775,root,mythtv) %dir /var/cache/mythtv
486 %attr(775,root,mythtv) %dir /var/run/mythtv
487 %attr(754,root,root) /etc/rc.d/init.d/mythbackend
488 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mythbackend
489 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mythbackend
490 %attr(775,root,mythtv) %dir %{_localstatedir}/log/mythtv
491
492 %files frontend -f mythfrontend.lang
493 %defattr(644,root,root,755)
494 %attr(755,root,root) %{_bindir}/mythfrontend
495 %attr(755,root,root) %{_bindir}/mythshutdown
496 %attr(755,root,root) %{_bindir}/mythtv
497 %attr(755,root,root) %{_bindir}/mythtvosd
498 %attr(755,root,root) %{_bindir}/mythwelcome
499 %dir %{_datadir}/mythtv
500 %dir %{_datadir}/mythtv/themes
501 %dir %{_libdir}/mythtv
502 %{_datadir}/mythtv/*.xml
503 %dir %{_libdir}/mythtv/filters
504 %dir %{_libdir}/mythtv/plugins
505 %attr(755,root,root) %{_libdir}/mythtv/filters/*.so
506 %{_datadir}/mythtv/*.ttf
507 %dir %{_datadir}/mythtv/i18n
508 %{_desktopdir}/*.desktop
509
510 %files setup
511 %defattr(644,root,root,755)
512 %doc database
513 %attr(755,root,root) %{_bindir}/mythtv-setup
514
515 %files themes
516 %defattr(644,root,root,755)
517 %{_datadir}/mythtv/themes/*
518
519 %files -n libmyth
520 %defattr(644,root,root,755)
521 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
522
523 %files -n libmyth-devel
524 %defattr(644,root,root,755)
525 %attr(755,root,root) %{_libdir}/*.so
526 %{_includedir}/*
527 %{_datadir}/mythtv/build
528
529 %files -n libmyth-static
530 %defattr(644,root,root,755)
This page took 0.079688 seconds and 4 git commands to generate.