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