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