]> git.pld-linux.org Git - packages/tvheadend.git/blobdiff - tvheadend.spec
up to 20230719 snap
[packages/tvheadend.git] / tvheadend.spec
index 82435010af8466b1d3483369074072d0ef47e84a..f2f66587840fb417cf522cf9c75ca624f312845e 100644 (file)
@@ -1,35 +1,48 @@
+#
+# Conditional build:
+%bcond_without systemd         # without systemd support
+
+%define                gitref  c531383ca6654639dc112db67fd8dc893c1f5272
+%define                snap    20230719
+%define                rel     1
+
 Summary:       TV streaming server
 Name:          tvheadend
 # https://tvheadend.org/projects/tvheadend/wiki/Releases
-Version:       4.0.8
-Release:       1
+Version:       4.3.0
+Release:       0.%{snap}.%{rel}
 License:       GPL v3
 Group:         Applications/Multimedia
-Source0:       https://github.com/tvheadend/tvheadend/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: dbb33a9b27a68749961f6aae700d9848
-Source1:       %{name}.conf
-Source2:       %{name}.service
-Source3:       %{name}.sysconfig
-Source4:       %{name}.init
+Source0:       https://github.com/tvheadend/tvheadend/archive/%{gitref}/%{name}-%{snap}.tar.gz
+# Source0-md5: 145d05de790f785f8f1d8f2166d4ce41
+Source1:       %{name}.service
+Source2:       %{name}.sysconfig
+Source3:       %{name}.init
 Patch0:                x32.patch
-Patch1:                ffmpeg3.patch
 URL:           https://tvheadend.org/projects/tvheadend
 BuildRequires: avahi-devel
-BuildRequires: curl-devel
-BuildRequires: ffmpeg-devel
-BuildRequires: python-modules
+BuildRequires: dbus-devel
+BuildRequires: ffmpeg-devel >= 3.0
+BuildRequires: gettext-tools
+BuildRequires: libdvbcsa-devel
+BuildRequires: libx264-devel
+BuildRequires: libx265-devel
+BuildRequires: openssl-devel
+BuildRequires: pcre2-8-devel
+BuildRequires: pkgconfig
+BuildRequires: python3-modules
 BuildRequires: rpmbuild(macros) >= 1.647
+%{?with_systemd:BuildRequires: systemd-devel}
 BuildRequires: uriparser-devel
 BuildRequires: zlib-devel
-Requires(post):        pwgen
 Requires(post):        sed >= 4.0
 Requires(post,preun):  /sbin/chkconfig
-Requires(post,preun,postun):   systemd-units >= 38
+%{?with_systemd:Requires(post,preun,postun):   systemd-units >= 38}
 Requires(postun):      /usr/sbin/userdel
 Requires(pre): /bin/id
 Requires(pre): /usr/sbin/useradd
 Requires:      setup
-Requires:      systemd-units >= 0.38
+%{?with_systemd:Requires:      systemd-units >= 0.38}
 Provides:      user(tvheadend)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -38,39 +51,47 @@ 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
+%setup -q -n %{name}-%{gitref}
+%ifarch x32
 %patch0 -p1
-%patch1 -p1
+%endif
+
+%{__sed} -i -e '1s,/usr/bin/env python3$,%{__python3},' lib/py/tvh/tv_meta_{tm,tv}db.py support/tvhmeta
 
 %build
 export CFLAGS="%{rpmcflags}"
-export CC="%{__cc}"
+export LDFLAGS="%{rpmldflags}"
 
 # tvheadend uses a custom script, so %%configure cannot be used
 # as not all options are supported
 ./configure \
+       --cc="%{__cc}" \
        --release \
        --prefix=%{_prefix} \
        --libdir=%{_libdir} \
        --mandir=%{_mandir} \
-       --disable-dvbscan
+       --python=%{__python3} \
+       --disable-dvbscan \
+       --disable-ffmpeg_static \
+       --disable-hdhomerun_static \
+       %{!?with_systemd:--disable-libsystemd_daemon}
 
 %{__make} V=1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol \
+install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name} \
        $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
-       $RPM_BUILD_ROOT%{systemdunitdir} \
+       %{?with_systemd:$RPM_BUILD_ROOT%{systemdunitdir}} \
        $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
 
 %{__make} install \
-       DESTDIR=$RPM_BUILD_ROOT
+       DESTDIR=$RPM_BUILD_ROOT \
+        V=1
 
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
-cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
-cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+%{?with_systemd:cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 
 chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
 
@@ -83,26 +104,20 @@ rm -rf $RPM_BUILD_ROOT
 %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
-# replace the dummy password by a random, 12-character pwgen-generated password
-if  grep -q '"password": "dummypassword"' %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1; then
-       sed -i "s,\"password\": \"dummypassword\",\"password\": \"$(pwgen -s 12 1)\"," %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
-fi
+%{?with_systemd:%systemd_post %{name}.service}
 
 %preun
 if [ "$1" = "0" ]; then
        %service tvheadend stop
        /sbin/chkconfig --del tvheadend
 fi
-%systemd_preun %{name}.service
+%{?with_systemd:%systemd_preun %{name}.service}
 
 %postun
 if [ "$1" = "0" ]; then
        %userremove tvheadend
 fi
-%systemd_reload
+%{?with_systemd:%systemd_reload}
 
 %files
 %defattr(644,root,root,755)
@@ -112,12 +127,10 @@ fi
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %{_mandir}/man1/%{name}.1*
 %{_datadir}/%{name}
-%{systemdunitdir}/%{name}.service
+%{?with_systemd:%{systemdunitdir}/%{name}.service}
 
 # home directory and config file
 %dir %attr(755,tvheadend,root) %{_localstatedir}/lib/%{name}
 %dir %attr(755,tvheadend,video) %{_localstatedir}/lib/%{name}/Videos
 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts
 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts/%{name}
-%dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol
-%attr(600,tvheadend,video) %config(noreplace) %verify(not md5 mtime size) %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
This page took 0.102011 seconds and 4 git commands to generate.