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