-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmythtv.spec
More file actions
1987 lines (1570 loc) · 67.9 KB
/
mythtv.spec
File metadata and controls
1987 lines (1570 loc) · 67.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# The full MythTV Version string is computed from the output of git describe.
%global vers_string v36.0-12-g5c144a2522
# The git date of last commit on mythtv repo
# git_date=$(git log -1 --format=%cd --date=format:"%Y%m%d")
%global git_date 20260304
# Specfile for building MythTV and MythPlugins RPMs from a git checkout.
#
# by: Chris Petersen <cpetersen@mythtv.org>
# Jarod Wilson <jarod@wilsonet.com>
# Richard Shaw <hobbes1069@gmail.com>
#
# Modified/Extended from the great work of:
# Axel Thimm <Axel.Thimm@ATrpms.net>
# David Bussenschutt <buzz@oska.com>
# and others; see changelog at bottom for details.
#
# The latest canonical upstream version of this file can be found at:
#
# https://github.com/MythTV/packaging/tree/master/rpm
#
# The latest RPM Fusion version can be found at:
#
# https://pkgs.rpmfusion.org/cgit/free/mythtv.git/
#
# Note:
#
# This spec relies upon several files included in the RPM Fusion mythtv
# src.rpm file. Please install it into your build tree before trying to
# build anything with this spec.
#
# Explanation of options:
#
# --with proc_opt Enable MythTV's optimized processor detection code
# and override RPM's defaults.
# --with debug Enable debug mode
#
# The following options are enabled by default. Use these options to disable:
#
# --without vdpau Disable VDPAU support
# --without vaapi Disable VAAPI support
# --without perl Disable building of the perl bindings
# --without php Disable building of the php bindings
# --without python Disable building of the python bindings
#
# # All plugins get built by default, but you can disable them as you wish:
#
# --without mytharchive
# --without mythbrowser
# --without mythgame
# --without mythmusic
# --without mythnetvision
# --without mythnews
# --without mythweather
# --without mythzoneminder
#
################################################################################
%define _lto_cflags %{nil}
%global py_prefix python3
# These values are computed from git describe provided earlier
%global githash %(c=%{vers_string}; echo $c|cut -d"-" -f3)
%global shorthash %(c=%{githash}; echo ${c:1:11})
%global commits %(c=%{vers_string}; echo $c|cut -d"-" -f2)
%global rel_string .%{commits}.%{git_date}git%{shorthash}
# A list of which applications we want to put into the desktop menu system
%global desktop_applications mythfrontend mythtv-setup
# This is the correct folder for firewalld service files, even on x86_64
# It is not used for shared objects
%global fw_services %{_prefix}/lib/firewalld/services
# fedora >= 43 normalizes python dist-info folder name
%if 0%{?fedora} >= 43
%global distinfo mythtv-%{version}.dist-info
%else
%global distinfo MythTV-%{version}.dist-info
%endif
#
# Basic descriptive tags for this package:
#
Name: mythtv
Version: 36.0
Release: 2%{rel_string}%{?dist}
Summary: A digital video recorder (DVR) application
# The primary license is GPLv2+, but bits are borrowed from a number of
# projects... For a breakdown of the licensing, see PACKAGE-LICENSING.
License: GPLv2+ and LGPLv2+ and LGPLv2 and (GPLv2 or QPL) and (GPLv2+ or LGPLv2+)
URL: http://www.mythtv.org/
Source0: https://github.com/MythTV/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: https://github.com/MythTV/%{name}/compare/v%{version}..%{shorthash}.patch
Patch1: %{name}-space_in_GB.patch
%global major_rel %(c=%{version}; echo $c|cut -d"." -f1)
################################################################################
# Set "--with proc_opt" to let mythtv autodetect your CPU and run its
# processor-specific optimizations. It seems to cause compile problems on many
# systems (particularly x86_64), so it is classified by the MythTV developers
# as "use at your own risk."
%bcond_with proc_opt
# Set "--without debug" to disable MythTV debug compile mode
%bcond_without debug
# The following options are enabled by default. Use --without to disable them
%bcond_without vdpau
%bcond_without vaapi
%bcond_without sdnotify
%bcond_without perl
%bcond_without php
%bcond_without python
%bcond_without pulseaudio
# All plugins get built by default, but you can disable them as you wish
%bcond_without plugins
%bcond_without mytharchive
%bcond_without mythbrowser
%bcond_without mythgame
%bcond_without mythmusic
%bcond_without mythnews
%bcond_without mythweather
%bcond_without mythzoneminder
%bcond_with mythnetvision
################################################################################
#
### THE BELOW IS NOW AUTOMATED BY SCRIPTS IN SCM ###
#
# From the mythtv git repository with the appropriate branch checked out:
# Example: git diff -p --stat v0.26.0 > mythtv-0.26-fixes.patch
# Also update ChangeLog with git log v0.28..HEAD > ChangeLog
# and update define vers_string to v0.28-52-ge6a60f7 with git describe
Source3: mythtv.sysusers
Source10: %{name}-PACKAGE-LICENSING
Source11: %{name}-ChangeLog
Source104: %{name}.logrotate.sysd
Source105: mythbackend.service
Source106: mythfrontend.png
Source107: mythfrontend.desktop
Source108: %{name}-setup.png
Source109: %{name}-setup.desktop
Source111: 99-mythbackend.rules
Source112: mythjobqueue.service
Source113: mythdb-optimize.service
Source114: mythdb-optimize.timer
# firewalld config for new web application
# https://www.mythtv.org/wiki/Web_Application
Source115: mythtv-webfrontend.xml
Source116: mythtv-webbackend.xml
# Global MythTV and Shared Build Requirements
# Use systemd
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# sysusers config is now required
BuildRequires: systemd-rpm-macros
%{?sysusers_requires_compat}
BuildRequires: gcc-c++ lzo-devel
# For binary diff support
BuildRequires: git-core
BuildRequires: perl-generators
BuildRequires: desktop-file-utils
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-qtwebengine-devel
BuildRequires: freetype-devel >= 2
BuildRequires: mariadb-connector-c-devel
BuildRequires: libcec-devel >= 1.7
BuildRequires: libvpx-devel
BuildRequires: lm_sensors-devel
BuildRequires: lirc-devel
BuildRequires: nasm
# X, and Xv video support
BuildRequires: libXmu-devel
BuildRequires: libXv-devel
### Will not likely be required in a future release
BuildRequires: libXxf86vm-devel
BuildRequires: libXinerama-devel
###
BuildRequires: libXrandr-devel
BuildRequires: mesa-libGLU-devel
%ifarch %arm
BuildRequires: mesa-libGLES-devel
%endif
BuildRequires: xorg-x11-proto-devel
# OpenGL video output and vsync support
BuildRequires: libGL-devel
BuildRequires: libGLU-devel
BuildRequires: libXNVCtrl-devel
# Misc A/V format support
BuildRequires: fftw-devel >= 3
BuildRequires: flac-devel >= 1.0.4
BuildRequires: lame-devel
BuildRequires: libbluray-devel
BuildRequires: libcdio-devel libcdio-paranoia-devel
BuildRequires: libsamplerate-devel
BuildRequires: libogg-devel
BuildRequires: libtheora-devel
BuildRequires: libvorbis-devel >= 1.0
BuildRequires: taglib-devel >= 1.7
BuildRequires: x264-devel
BuildRequires: x265-devel
BuildRequires: xvidcore-devel >= 0.9.1
BuildRequires: exiv2-devel
# Audio framework support
BuildRequires: sox-devel
BuildRequires: alsa-lib-devel
BuildRequires: pipewire-jack-audio-connection-kit-devel
%if %{with pulseaudio}
BuildRequires: pulseaudio-libs-devel
%endif
BuildRequires: avahi-compat-libdns_sd-devel
# Bluray support
BuildRequires: ant java-devel
BuildRequires: libxml2-devel
#BuildRequires: libudf-devel
# Subtitle support
BuildRequires: libass-devel
# Need dvb headers to build in dvb support
BuildRequires: kernel-headers
# FireWire cable box support
BuildRequires: libavc1394-devel
BuildRequires: libiec61883-devel
BuildRequires: libraw1394-devel
# Tuner support
BuildRequires: hdhomerun-devel
# For ttvdb.py, not available in EPEL
BuildRequires: %{py_prefix}-requests
BuildRequires: %{py_prefix}-requests-cache
%if %{with vdpau}
BuildRequires: libvdpau-devel
%endif
%if %{with vaapi}
BuildRequires: libva-devel
%endif
%if %{with sdnotify}
BuildRequires: systemd-devel
%endif
%if %{with mythgame}
BuildRequires: minizip-compat-devel
%endif
# API Build Requirements
%if %{with perl}
BuildRequires: perl
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Config)
BuildRequires: perl(Exporter)
BuildRequires: perl(Fcntl)
BuildRequires: perl(File::Copy)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(DBI)
BuildRequires: perl(HTTP::Request)
BuildRequires: perl(Net::UPnP::QueryResponse)
BuildRequires: perl(Net::UPnP::ControlPoint)
BuildRequires: perl(DBD::mysql)
BuildRequires: perl(IO::Socket::INET6)
%endif
%if %{with php}
# No php specific requirements yet.
%endif
%if %{with python}
BuildRequires: %{py_prefix}-setuptools
BuildRequires: %{py_prefix}-pip
BuildRequires: %{py_prefix}-wheel
BuildRequires: %{py_prefix}-devel
BuildRequires: %{py_prefix}-mysqlclient
BuildRequires: %{py_prefix}-lxml
%endif
# Plugin Build Requirements
%if %{with plugins}
%if %{with mythgame}
BuildRequires: zlib-devel
%endif
%if %{with mythnews}
%endif
BuildRequires: ncurses-devel
BuildRequires: soundtouch-devel
BuildRequires: libzip-devel
BuildRequires: expat-devel
%if %{with mythweather}
Requires: mythweather >= %{version}
BuildRequires: perl(XML::Simple)
Requires: perl(XML::Simple)
Requires: perl(LWP::Simple)
BuildRequires: perl(DateTime::Format::ISO8601)
Requires: perl(DateTime::Format::ISO8601)
BuildRequires: perl(XML::XPath)
Requires: perl(XML::XPath)
BuildRequires: perl(Date::Manip)
Requires: perl(Date::Manip)
BuildRequires: perl(Image::Size)
Requires: perl(Image::Size)
BuildRequires: perl(SOAP::Lite)
Requires: perl(SOAP::Lite)
BuildRequires: perl(JSON)
Requires: perl(JSON)
%endif
%if %{with mythzoneminder}
%endif
%if %{with mythnetvision}
BuildRequires: %{py_prefix}-pycurl
BuildRequires: %{py_prefix}-lxml
BuildRequires: %{py_prefix}-oauth
BuildRequires: %{py_prefix}-urllib3
%endif
%endif
################################################################################
# Requirements for the mythtv meta package
Requires: mythtv-libs%{?_isa} = %{version}-%{release}
Requires: mythtv-backend%{?_isa} = %{version}-%{release}
Requires: mythtv-base-themes%{?_isa} = %{version}-%{release}
Requires: mythtv-common%{?_isa} = %{version}-%{release}
Requires: mythtv-docs = %{version}-%{release}
Requires: mythtv-frontend%{?_isa} = %{version}-%{release}
Requires: mythtv-setup%{?_isa} = %{version}-%{release}
Requires: perl-MythTV = %{version}-%{release}
Requires: php-MythTV = %{version}-%{release}
Requires: %{py_prefix}-MythTV = %{version}-%{release}
%if %{with plugins}
Requires: mythplugins%{?_isa} = %{version}-%{release}
%endif
# Reminder this one is noarch - and not a sub-package (no EVR)
Recommends: mythweb
Requires: mythffmpeg%{?_isa} = %{version}-%{release}
Recommends: xmltv
# Generate the required mythtv-frontend-api version string here so we only
# have to do it once.
%global mythfeapiver %(echo %{version} | awk -F. '{print $1 "." $2}')
################################################################################
%description
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
There are also several add-ons and themes available. In order to facilitate
installations with smart/apt-get/yum and other related package
resolvers this meta-package can be used to install all in one sweep.
MythTV implements the following DVR features, and more, with a
unified graphical interface:
- Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
- Video compression using RTjpeg or MPEG-4, and support for DVB and
hardware encoder cards/devices.
- Program listing retrieval using XMLTV
- Themable, semi-transparent on-screen display
- Electronic program guide
- Scheduled recording of TV programs
- Resolution of conflicts between scheduled recordings
- Basic video editing
################################################################################
%package docs
Summary: MythTV documentation
BuildArch: noarch
%description docs
The MythTV documentation, database initialization file
and miscellaneous other bits and pieces.
################################################################################
%package libs
Summary: Library providing mythtv support
%{?rhel:BuildRequires: epel-rpm-macros}
Requires: freetype%{?_isa} >= 2
Requires: qt6-qtbase-mysql%{?_isa}
Requires: libudisks2%{?_isa}
# Handle package obsoletes here as this is the only "common" package.
# mythgallery is dead
Obsoletes: mythgallery < 31
# mythnetvision is buggy and doesn't want to build with python3-urllib3
%if !%{with mythnetvision}
Obsoletes: mythnetvision < 31
%endif
%description libs
Common library code for MythTV and add-on modules (development)
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
################################################################################
%package devel
Summary: Development files for mythtv
Requires: mythtv-libs%{?_isa} = %{version}-%{release}
BuildRequires: mariadb-connector-c-devel
Requires: qt6-qtbase-devel%{?_isa}
BuildRequires: qt6-qtwebengine-devel
%description devel
This package contains the header files and libraries for developing
add-ons for mythtv.
################################################################################
%package base-themes
Summary: Core user interface themes for mythtv
%description base-themes
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv-docs package for more information.
This package contains the base themes for the mythtv user interface.
################################################################################
%package frontend
Summary: Client component of mythtv (a DVR)
Requires: freetype%{?_isa}
Requires: lame
Requires: perl(XML::Simple)
Requires: mythtv-common%{?_isa} = %{version}-%{release}
Requires: mythtv-base-themes%{?_isa} = %{version}-%{release}
# RHBZ 1838780 - mariadb lacks mysql provides on el8
Requires: (mysql%{?_isa} >= 5 or mariadb%{?_isa})
Requires: %{py_prefix}-MythTV = %{version}-%{release}
Recommends: libaacs%{?_isa}
Requires: google-droid-sans-mono-fonts
%{?fedora:Recommends: mesa-vdpau-drivers%{?_isa}}
Provides: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
# Mythfrontend dvd menu support comes from libdvdcss
# https://www.mythtv.org/wiki/Using_MythTV#Optical_Disks
Recommends: libdvdcss
# Disable the startup overview on newer Gnome desktops to allow proper kiosk mode
Recommends: gnome-shell-extension-no-overview
%description frontend
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
This package contains only the client software, which provides a
front-end for playback and configuration. It requires access to a
mythtv-backend installation, either on the same system or one
reachable via the network.
################################################################################
%package backend
Summary: Server component of mythtv (a DVR)
Requires: lame
Requires: mythtv-common%{?_isa} = %{version}-%{release}
Requires: mythtv-libs%{?_isa} = %{version}-%{release}
Requires: mythtv-setup%{?_isa}
Requires: %{py_prefix}-requests
Requires: %{py_prefix}-requests-cache
Requires(pre): shadow-utils
Conflicts: xmltv-grabbers < 0.5.37
%description backend
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
This package contains only the server software, which provides video
and audio capture and encoding services. In order to be useful, it
requires a mythtv-frontend installation, either on the same system or
one reachable via the network.
################################################################################
%package setup
Summary: Setup the mythtv backend
Requires: freetype%{?_isa}
Requires: mythtv-backend%{?_isa} = %{version}-%{release}
Requires: mythtv-base-themes%{?_isa} = %{version}
Requires: google-droid-sans-fonts
# Needed for svg channel icon support
Requires: qt6-qtsvg
%description setup
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
This package contains only the setup software for configuring the
mythtv backend.
################################################################################
%package common
Summary: Common components needed by multiple other MythTV components
# For ttvdb.py
Requires: %{py_prefix}-requests
Requires: %{py_prefix}-requests-cache
%description common
MythTV provides a unified graphical interface for recording and viewing
television programs. Refer to the mythtv package for more information.
This package contains components needed by multiple other MythTV components.
################################################################################
################################################################################
%package -n mythffmpeg
Summary: MythTV build of FFmpeg
%description -n mythffmpeg
Several MythTV utilities interact with FFmpeg, which changes its parameters
often enough to make it a hassle to support the variety of versions used by
MythTV users. This is a snapshot of the FFmpeg code so that MythTV utilities
can interact with a known verion.
################################################################################
%if %{with perl}
%package -n perl-MythTV
Summary: Perl bindings for MythTV
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql)
Requires: perl(Net::UPnP)
Requires: perl(Net::UPnP::ControlPoint)
%description -n perl-MythTV
Provides a perl-based interface to interacting with MythTV.
%endif
################################################################################
%if %{with php}
%package -n php-MythTV
Summary: PHP bindings for MythTV
BuildArch: noarch
%description -n php-MythTV
Provides a PHP-based interface to interacting with MythTV.
%endif
################################################################################
%if %{with python}
%package -n %{py_prefix}-MythTV
Summary: Python bindings for MythTV
%{?python_provide:%python_provide python3-%{name}}
Obsoletes: python2-MythTV < 30.0-9.20190601git6bd8cd4993
BuildArch: noarch
Requires: %{py_prefix}-mysqlclient
Requires: %{py_prefix}-lxml
%description -n %{py_prefix}-MythTV
Provides a python-based interface to interacting with MythTV.
%endif
################################################################################
%if %{with plugins}
# Meta package for all mythtv plugins
%package -n mythplugins
Summary: Main MythTV plugins
%if %{with mythmusic}
Requires: mythmusic%{?_isa} = %{version}-%{release}
%endif
%if %{with mythweather}
Requires: mythweather%{?_isa} = %{version}-%{release}
%endif
%if %{with mythgame}
Requires: mythgame%{?_isa} = %{version}-%{release}
%endif
%if %{with mythnews}
Requires: mythnews%{?_isa} = %{version}-%{release}
%endif
%if %{with mythbrowser}
Requires: mythbrowser%{?_isa} = %{version}-%{release}
%endif
%if %{with mytharchive}
Requires: mytharchive%{?_isa} = %{version}-%{release}
%endif
%if %{with mythzoneminder}
Requires: mythzoneminder%{?_isa} = %{version}-%{release}
%endif
%if %{with mythnetvision}
Requires: mythnetvision%{?_isa} = %{version}-%{release}
%endif
%description -n mythplugins
This is a consolidation of all the official MythTV plugins that used to be
distributed as separate downloads from mythtv.org.
################################################################################
%if %{with mytharchive}
%package -n mytharchive
Summary: A module for MythTV for creating and burning DVDs
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
Requires: wodim
Requires: dvd+rw-tools%{?_isa} >= 5.21.4.10.8
Requires: dvdauthor%{?_isa} >= 0.6.11
Requires: ffmpeg%{?_isa} >= 0.4.9
Requires: mjpegtools%{?_isa} >= 1.6.2
Requires: genisoimage%{?_isa}
Requires: %{py_prefix}-mysqlclient
Requires: %{py_prefix}-pillow
Requires: pmount%{?_isa}
%description -n mytharchive
MythArchive is a new plugin for MythTV that lets you create DVDs from
your recorded shows, MythVideo files and any video files available on
your system.
%endif
################################################################################
%if %{with mythbrowser}
%package -n mythbrowser
Summary: A small web browser module for MythTV
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
%description -n mythbrowser
MythBrowser is a full fledged web-browser (multiple tabs) to display
webpages in full-screen mode. Simple page navigation is possible.
Starting with version 0.13 it also has full support for mouse driven
navigation (right mouse opens and clos es the popup menu).
MythBrowser also contains a BookmarkManager to manage the website
links in a simple mythplugin.
%endif
################################################################################
%if %{with mythgame}
%package -n mythgame
Summary: A game frontend (xmame, nes, snes, pc) for MythTV
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
%description -n mythgame
A game frontend (xmame, nes, snes, pc) for MythTV.
%endif
################################################################################
%if %{with mythmusic}
%package -n mythmusic
Summary: The music player add-on module for MythTV
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
%description -n mythmusic
The music player add-on module for MythTV.
%endif
################################################################################
%if %{with mythnews}
%package -n mythnews
Summary: An RSS news feed plugin for MythTV
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
%description -n mythnews
An RSS news feed reader plugin for MythTV.
%endif
################################################################################
%if %{with mythweather}
%package -n mythweather
Summary: A MythTV module that displays a weather forecast
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
Requires: perl(XML::SAX::Base)
%description -n mythweather
A MythTV module that displays a weather forecast.
%endif
################################################################################
%if %{with mythzoneminder}
%package -n mythzoneminder
Summary: A module for MythTV for camera security and surveillance
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
%description -n mythzoneminder
MythZoneMinder is a plugin to interface to some of the features of
ZoneMinder. You can use it to view a status window similar to the
console window in ZM. Also there are screens to view live camera shots
and replay recorded events.
%endif
################################################################################
%if %{with mythnetvision}
%package -n mythnetvision
Summary: A MythTV module for Internet video on demand
Requires: mythtv-frontend-api%{?_isa} = %{mythfeapiver}
Requires: mythbrowser%{?_isa} = %{version}-%{release}
Requires: %{py_prefix}-MythTV = %{version}-%{release}
Requires: %{py_prefix}-pycurl
Requires: %{py_prefix} >= 2.5
Requires: %{py_prefix}-lxml
Requires: %{py_prefix}-urllib3
%description -n mythnetvision
A MythTV module that supports searching and browsing of Internet video
on demand content.
%endif
################################################################################
# End of plugins
%endif
################################################################################
%prep
%autosetup -S git -p1 -n %{name}-%{version}
# Remove exe permissions
find . -type f -name "*.cpp" -exec chmod 0644 '{}' \;
# Install ChangeLog
install -m 0644 %{SOURCE11} ./ChangeLog
pushd mythtv
# Set the mythtv --version string
cat > EXPORTED_VERSION <<EOF
SOURCE_VERSION=%{vers_string}
BRANCH=fixes/%{major_rel}
EOF
# Drop execute permissions on contrib bits, since they'll be %%doc
find contrib/ -type f -exec chmod -x "{}" \;
# Put perl bits in the right place and set opt flags
sed -i -e 's#perl Makefile.PL#%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"#' \
bindings/perl/Makefile
# Install other source files
cp -a %{SOURCE10} ./PACKAGE-LICENSING
cp -a %{SOURCE106} %{SOURCE107} %{SOURCE108} %{SOURCE109} .
popd
################################################################################
%build
# First, we build MythTV
pushd mythtv
# Similar to 'percent' configure, but without {_target_platform} and
# {_exec_prefix} etc... MythTV no longer accepts the parameters that the
# configure macro passes, so we do this manually.
./configure \
--qmake=%{_bindir}/qmake6 \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--libdir-name=%{_lib} \
--mandir=%{_mandir} \
%if ! %{with vdpau}
--disable-vdpau \
%endif
%if ! %{with vaapi}
--disable-vaapi \
%endif
--python=%{__python3} \
--enable-libvpx \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
%if !%{with perl}
--without-bindings=perl \
%endif
%if !%{with php}
--without-bindings=php \
%endif
%if %{without python}
--without-bindings=python \
%endif
--extra-cflags="%{optflags} -fomit-frame-pointer -fno-devirtualize" \
--extra-cxxflags="%{optflags} -fomit-frame-pointer -fno-devirtualize" \
%ifarch %{ix86}
--cpu=i686 --tune=i686 --enable-mmx \
%endif
%if %{with proc_opt}
--enable-proc-opt \
%endif
%if %{with debug}
--compile-type=debug
%else
--compile-type=release
%endif
# Make
%make_build V=1
popd
# Prepare to build the plugins
mkdir fakeroot
temp=`pwd`/fakeroot
make -C mythtv install INSTALL_ROOT=$temp
export LD_LIBRARY_PATH=$temp%{_libdir}:$LD_LIBRARY_PATH
# Next, we build the plugins
%if %{with plugins}
pushd mythplugins
# Fix things up so they can find our "temp" install location for mythtv-libs
echo "QMAKE_PROJECT_DEPTH = 0" >> settings.pro
find . -name \*.pro \
-exec sed -i -e "s,INCLUDEPATH += .\+/include/mythtv,INCLUDEPATH += $temp%{_includedir}/mythtv," {} \; \
-exec sed -i -e "s,DEPLIBS = \$\${SYSROOT}\$\${LIBDIR},DEPLIBS = $temp%{_libdir}," {} \; \
-exec sed -i -e "s,\$\${PREFIX}/include/mythtv,$temp%{_includedir}/mythtv," {} \;
echo "INCLUDEPATH -= \$\${PREFIX}/include" >> settings.pro
echo "INCLUDEPATH -= \$\${SYSROOT}/\$\${PREFIX}/include" >> settings.pro
echo "INCLUDEPATH -= %{_includedir}" >> settings.pro
echo "INCLUDEPATH += $temp%{_includedir}" >> settings.pro
# echo "LIBS *= -L$temp%{_libdir}" >> settings.pro
echo "QMAKE_LIBDIR += $temp%{_libdir}" >> targetdep.pro
./configure \
--prefix=${temp}%{_prefix} \
--libdir=%{_libdir} \
--libdir-name=%{_lib} \
%if %{with mytharchive}
--enable-mytharchive \
%else
--disable-mytharchive \
%endif
%if %{with mythbrowser}
--enable-mythbrowser \
%else
--disable-mythbrowser \
%endif
%if %{with mythgame}
--enable-mythgame \
%else
--disable-mythgame \
%endif
%if %{with mythmusic}
--enable-mythmusic \
%else
--disable-mythmusic \
%endif
%if %{with mythnews}
--enable-mythnews \
%else
--disable-mythnews \
%endif
%if %{with mythweather}
--enable-mythweather \
%else
--disable-mythweather \
%endif
%if %{with mythzoneminder}
--enable-mythzoneminder \
%else
--disable-mythzoneminder \
%endif
%if %{with mythnetvision}
--enable-mythnetvision \
%else
--disable-mythnetvision \
%endif
--python=%{__python3}
%make_build V=1
popd
%endif
################################################################################
%install
# First, install MythTV
pushd mythtv
make install INSTALL_ROOT=%{buildroot}
ln -s mythtv-setup %{buildroot}%{_bindir}/mythtvsetup
mkdir -p %{buildroot}%{_localstatedir}/lib/mythtv
mkdir -p %{buildroot}%{_localstatedir}/lib/mythvideo
mkdir -p %{buildroot}%{_localstatedir}/cache/mythtv
mkdir -p %{buildroot}%{_localstatedir}/log/mythtv
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_sysconfdir}/mythtv
# config/init files
echo "# to be filled in by mythtv-setup" > %{buildroot}%{_sysconfdir}/mythtv/config.xml
### SystemD based setup. ###
install -p -m 0644 %{SOURCE105} %{buildroot}%{_unitdir}/
install -p -m 0644 %{SOURCE104} %{buildroot}%{_sysconfdir}/logrotate.d/mythtv
# Install udev rules for devices that may initialize late in the boot
# process so they are available for mythbackend.
mkdir -p %{buildroot}/lib/udev/rules.d/
install -p -m 0644 %{SOURCE111} %{buildroot}/lib/udev/rules.d/
# Systemd unit file for mythjobqueue only backends.
install -p -m 0644 %{SOURCE112} %{buildroot}%{_unitdir}/
# Systemd unit files for database optimization
install -p -m 0644 %{SOURCE113} %{buildroot}%{_unitdir}/
install -p -m 0644 %{SOURCE114} %{buildroot}%{_unitdir}/
install -p -m 0755 contrib/maintenance/optimize_mythdb.pl \
%{buildroot}%{_bindir}/optimize_mythdb
# sysusers config
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/mythtv.conf
# Desktop entries
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
for file in %{desktop_applications}; do
install -p $file.png %{buildroot}%{_datadir}/pixmaps/$file.png
desktop-file-install \
--dir %{buildroot}%{_datadir}/applications \
--add-category Application \
--add-category AudioVideo \
$file.desktop
done
mkdir -p %{buildroot}%{_libdir}/mythtv/plugins
mkdir -p %{buildroot}%{_datadir}/mythtv/build/
install -p -m 644 settings.pro %{buildroot}%{_datadir}/mythtv/build/
popd
# Clean up some stuff we don't want to include
rm -f %{buildroot}%{_libdir}/libmythqjson.prl \
%{buildroot}%{_libdir}/libmythzmq.la \
%{buildroot}%{_libdir}/pkgconfig/libmythzmq.pc
# MythPlugins
%if %{with plugins}
pushd mythplugins
make install INSTALL_ROOT=%{buildroot}
%if %{with mythmusic}
mkdir -p %{buildroot}%{_localstatedir}/lib/mythmusic
%endif