]> git.pld-linux.org Git - packages/tvheadend.git/blobdiff - tvheadend.spec
- add supplementary usb group
[packages/tvheadend.git] / tvheadend.spec
index 98543235b15c34a0738544c6348f9017abfa5842..a6d9c4ad41a8e67bf949b8bc78c292c68644a08c 100644 (file)
@@ -1,31 +1,29 @@
-# TODO:
-# - verify BR
-#
-%define                maj_version 3.4
-%define                tar_subversion patch1
-%define                min_version 27
-######         Unknown group!
 Summary:       TV streaming server
 Name:          tvheadend
-Version:       %{maj_version}.%{min_version}
-Release:       0.2
+# 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/%{maj_version}%{tar_subversion}.tar.gz
+%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
-#BuildRequires:        avahi-client-devel
-#BuildRequires:        kdelibs4-devel
-#BuildRequires:        libgcrypt-devel
-#BuildRequires:        qt4-build
+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})
 
@@ -34,16 +32,20 @@ Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2,
 DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
 
 %prep
-%setup -q -n %{name}-%{maj_version}%{tar_subversion}
+%setup -q -n %{name}-%{vername}
 
 %build
-#temporary workaround until upstream fixes compilation with gcc-4.6
-#export CFLAGS="%{rpmcflags} -Wno-error=unused-but-set-variable"
 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
+./configure \
+       --prefix=%{_prefix} \
+       --release \
+       --libdir=%{_libdir} \
+       --mandir=%{_mandir}/man1
+
 %{__make} V=1
 
 %install
@@ -51,7 +53,7 @@ rm -rf $RPM_BUILD_ROOT
 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
@@ -59,13 +61,16 @@ install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontr
 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
@@ -75,6 +80,10 @@ if  grep -q '"password": "dummypassword"' %{_localstatedir}/lib/%{name}/.hts/%{n
 fi
 
 %preun
+if [ "$1" = "0" ]; then
+       %service tvheadend stop
+       /sbin/chkconfig --del tvheadend
+fi
 %systemd_preun %{name}.service
 
 %postun
@@ -90,6 +99,7 @@ rm -rf $RPM_BUILD_ROOT
 %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}
This page took 0.058969 seconds and 4 git commands to generate.