]> git.pld-linux.org Git - packages/tvheadend.git/blob - tvheadend.spec
- fix building with ffmpeg 6
[packages/tvheadend.git] / tvheadend.spec
1 #
2 # Conditional build:
3 %bcond_without  systemd         # without systemd support
4
5 %define         gitref  c531383ca6654639dc112db67fd8dc893c1f5272
6 %define         snap    20230719
7 %define         rel     2
8
9 Summary:        TV streaming server
10 Name:           tvheadend
11 # https://tvheadend.org/projects/tvheadend/wiki/Releases
12 Version:        4.3.0
13 Release:        0.%{snap}.%{rel}
14 License:        GPL v3
15 Group:          Applications/Multimedia
16 Source0:        https://github.com/tvheadend/tvheadend/archive/%{gitref}/%{name}-%{snap}.tar.gz
17 # Source0-md5:  145d05de790f785f8f1d8f2166d4ce41
18 Source1:        %{name}.service
19 Source2:        %{name}.sysconfig
20 Source3:        %{name}.init
21 Patch0:         x32.patch
22 Patch1:         ffmpeg6.patch
23 URL:            https://tvheadend.org/projects/tvheadend
24 BuildRequires:  avahi-devel
25 BuildRequires:  dbus-devel
26 BuildRequires:  ffmpeg-devel >= 3.0
27 BuildRequires:  gettext-tools
28 BuildRequires:  libdvbcsa-devel
29 BuildRequires:  libx264-devel
30 BuildRequires:  libx265-devel
31 BuildRequires:  openssl-devel
32 BuildRequires:  pcre2-8-devel
33 BuildRequires:  pkgconfig
34 BuildRequires:  python3-modules
35 BuildRequires:  rpmbuild(macros) >= 1.647
36 %{?with_systemd:BuildRequires:  systemd-devel}
37 BuildRequires:  uriparser-devel
38 BuildRequires:  zlib-devel
39 Requires(post): sed >= 4.0
40 Requires(post,preun):   /sbin/chkconfig
41 %{?with_systemd:Requires(post,preun,postun):    systemd-units >= 38}
42 Requires(postun):       /usr/sbin/userdel
43 Requires(pre):  /bin/id
44 Requires(pre):  /usr/sbin/useradd
45 Requires:       setup
46 %{?with_systemd:Requires:       systemd-units >= 0.38}
47 Provides:       user(tvheadend)
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2,
52 DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
53
54 %prep
55 %setup -q -n %{name}-%{gitref}
56 %ifarch x32
57 %patch0 -p1
58 %endif
59 %patch1 -p1
60
61 %{__sed} -i -e '1s,/usr/bin/env python3$,%{__python3},' lib/py/tvh/tv_meta_{tm,tv}db.py support/tvhmeta
62
63 %build
64 export CFLAGS="%{rpmcflags}"
65 export LDFLAGS="%{rpmldflags}"
66
67 # tvheadend uses a custom script, so %%configure cannot be used
68 # as not all options are supported
69 ./configure \
70         --cc="%{__cc}" \
71         --release \
72         --prefix=%{_prefix} \
73         --libdir=%{_libdir} \
74         --mandir=%{_mandir} \
75         --python=%{__python3} \
76         --disable-dvbscan \
77         --disable-ffmpeg_static \
78         --disable-hdhomerun_static \
79         %{!?with_systemd:--disable-libsystemd_daemon}
80
81 %{__make} V=1
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name} \
86         $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
87         %{?with_systemd:$RPM_BUILD_ROOT%{systemdunitdir}} \
88         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
89
90 %{__make} install \
91         DESTDIR=$RPM_BUILD_ROOT \
92         V=1
93
94 %{?with_systemd:cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
95 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
96 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
97
98 chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %pre
104 %useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -G usb -c "tvheadend User" tvheadend
105
106 %post
107 /sbin/chkconfig --add tvheadend
108 %service tvheadend reload "tvheadend"
109 %{?with_systemd:%systemd_post %{name}.service}
110
111 %preun
112 if [ "$1" = "0" ]; then
113         %service tvheadend stop
114         /sbin/chkconfig --del tvheadend
115 fi
116 %{?with_systemd:%systemd_preun %{name}.service}
117
118 %postun
119 if [ "$1" = "0" ]; then
120         %userremove tvheadend
121 fi
122 %{?with_systemd:%systemd_reload}
123
124 %files
125 %defattr(644,root,root,755)
126 %doc docs
127 %attr(755,root,root) %{_bindir}/tvheadend
128 %attr(755,root,root) %{_bindir}/tvhmeta
129 %attr(755,root,root) %{_bindir}/tv_meta_tmdb.py
130 %attr(755,root,root) %{_bindir}/tv_meta_tvdb.py
131 %attr(754,root,root) /etc/rc.d/init.d/tvheadend
132 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
133 %{_mandir}/man1/%{name}.1*
134 %{_datadir}/%{name}
135 %{?with_systemd:%{systemdunitdir}/%{name}.service}
136
137 # home directory and config file
138 %dir %attr(755,tvheadend,root) %{_localstatedir}/lib/%{name}
139 %dir %attr(755,tvheadend,video) %{_localstatedir}/lib/%{name}/Videos
140 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts
141 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts/%{name}
This page took 0.06811 seconds and 3 git commands to generate.