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