Summary: TV streaming server
Name: tvheadend
-Version: 3.9
+# keep stable version announced on web page
+Version: 3.4.27
Release: 0.1
License: GPL v3
-Group: Video/Television
+Group: Applications/Multimedia
URL: https://tvheadend.org/projects/tvheadend
-Source0: https://github.com/tvheadend/tvheadend/archive/v3.9.tar.gz
-# Source0-md5: 177f5ecf771a1877d38a00bf18806f15
+%define vername 3.4patch1
+Source0: https://github.com/tvheadend/tvheadend/archive/%{vername}.tar.gz
+# Source0-md5: 86d1be0ad6e02bd2aecd3d529a026797
Source1: %{name}.conf
Source2: %{name}.service
Source3: %{name}.sysconfig
+Source4: %{name}.init
+BuildRequires: avahi-devel
+BuildRequires: curl-devel
+BuildRequires: python-modules
BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: zlib-devel
Requires(post,preun,postun): systemd-units >= 38
Requires: systemd-units >= 0.38
Requires(post): pwgen
Requires(post): sed >= 4.0
+Requires(post): /sbin/chkconfig
+Requires(post,preun): /sbin/chkconfig
Requires: group(video)
Provides: user(%{name})
DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
%prep
-%setup -q -n %{name}-%{version}
+%setup -q -n %{name}-%{vername}
%build
export CFLAGS="%{rpmcflags}"
export CC="%{__cc}"
-#tvheadend uses a custom configure script, so %%configure cannot be used
+
+# tvheadend uses a custom script, so %%configure cannot be used
# as not all options are supported
./configure \
--prefix=%{_prefix} \
--release \
--libdir=%{_libdir} \
- --mandir=%{_mandir}/man1 \
- --disable-dvbscan
+ --mandir=%{_mandir}/man1
%{__make} V=1
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol \
$RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
$RPM_BUILD_ROOT%{systemdunitdir} \
- $RPM_BUILD_ROOT/etc/sysconfig
+ $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
cp %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
cp %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
cp %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+cp %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
%pre
-%useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -c "tvheadend User" %{name}
+%useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -G usb -c "tvheadend User" %{name}
%post
+/sbin/chkconfig --add tvheadend
+%service tvheadend reload "tvheadend"
%systemd_post %{name}.service
# check if the access control file still has the initial dummy password, and
fi
%preun
+if [ "$1" = "0" ]; then
+ %service tvheadend stop
+ /sbin/chkconfig --del tvheadend
+fi
%systemd_preun %{name}.service
%postun
%defattr(644,root,root,755)
%doc docs
%attr(755,root,root) %{_bindir}/%{name}
+%attr(754,root,root) /etc/rc.d/init.d/tvheadend
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%{_mandir}/man1/%{name}.1*
%{_datadir}/%{name}