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