]> git.pld-linux.org Git - packages/tvheadend.git/blame - tvheadend.spec
- release 3 (by relup.sh)
[packages/tvheadend.git] / tvheadend.spec
CommitLineData
e08e4dbf
AF
1Summary: TV streaming server
2Name: tvheadend
1eefc6e8 3# https://tvheadend.org/projects/tvheadend/wiki/Releases
1b264c50 4Version: 4.0.8
a564ed80 5Release: 3
e08e4dbf 6License: GPL v3
7d3739f8 7Group: Applications/Multimedia
1b264c50
JR
8Source0: https://github.com/tvheadend/tvheadend/archive/v%{version}/%{name}-%{version}.tar.gz
9# Source0-md5: dbb33a9b27a68749961f6aae700d9848
e08e4dbf
AF
10Source1: %{name}.conf
11Source2: %{name}.service
12Source3: %{name}.sysconfig
7d3739f8 13Source4: %{name}.init
42520cb3 14Patch0: x32.patch
1b264c50 15Patch1: ffmpeg3.patch
432988cc 16Patch2: 64bit.patch
3552479b 17Patch3: 32bit.patch
8dc18272
JR
18Patch4: ffmpeg4.patch
19Patch5: no-Werror.patch
f2240875 20URL: https://tvheadend.org/projects/tvheadend
7d3739f8
AM
21BuildRequires: avahi-devel
22BuildRequires: curl-devel
d32c34f2 23BuildRequires: ffmpeg-devel
7d3739f8 24BuildRequires: python-modules
e08e4dbf 25BuildRequires: rpmbuild(macros) >= 1.647
d32c34f2 26BuildRequires: uriparser-devel
7d3739f8 27BuildRequires: zlib-devel
e08e4dbf
AF
28Requires(post): pwgen
29Requires(post): sed >= 4.0
7d3739f8 30Requires(post,preun): /sbin/chkconfig
f2240875
ER
31Requires(post,preun,postun): systemd-units >= 38
32Requires(postun): /usr/sbin/userdel
33Requires(pre): /bin/id
34Requires(pre): /usr/sbin/useradd
f4363db6 35Requires: setup
f2240875
ER
36Requires: systemd-units >= 0.38
37Provides: user(tvheadend)
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
e08e4dbf
AF
39
40%description
41Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2,
42DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
43
44%prep
1eefc6e8 45%setup -q
42520cb3 46%patch0 -p1
1b264c50 47%patch1 -p1
432988cc
JR
48%ifarch %{x8664}
49%patch2 -p1
50%endif
3552479b
JR
51%ifarch %{ix86} x32
52%patch3 -p1
53%endif
8dc18272
JR
54%patch4 -p1
55%patch5 -p1
e08e4dbf
AF
56
57%build
e08e4dbf
AF
58export CFLAGS="%{rpmcflags}"
59export CC="%{__cc}"
7d3739f8
AM
60
61# tvheadend uses a custom script, so %%configure cannot be used
e08e4dbf 62# as not all options are supported
5ab46ce7 63./configure \
5ab46ce7 64 --release \
f2240875 65 --prefix=%{_prefix} \
5ab46ce7 66 --libdir=%{_libdir} \
1eefc6e8 67 --mandir=%{_mandir} \
06478b67 68 --disable-dvbscan
5ab46ce7 69
e08e4dbf
AF
70%{__make} V=1
71
72%install
73rm -rf $RPM_BUILD_ROOT
74install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol \
75 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
76 $RPM_BUILD_ROOT%{systemdunitdir} \
7d3739f8 77 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
e08e4dbf
AF
78
79%{__make} install \
80 DESTDIR=$RPM_BUILD_ROOT
81
f2240875
ER
82cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
83cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
84cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
85install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
e08e4dbf
AF
86
87chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
88
f2240875
ER
89%clean
90rm -rf $RPM_BUILD_ROOT
91
e08e4dbf 92%pre
f2240875 93%useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -G usb -c "tvheadend User" tvheadend
e08e4dbf
AF
94
95%post
7d3739f8
AM
96/sbin/chkconfig --add tvheadend
97%service tvheadend reload "tvheadend"
e08e4dbf
AF
98%systemd_post %{name}.service
99
100# check if the access control file still has the initial dummy password, and
101# replace the dummy password by a random, 12-character pwgen-generated password
102if grep -q '"password": "dummypassword"' %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1; then
f2240875 103 sed -i "s,\"password\": \"dummypassword\",\"password\": \"$(pwgen -s 12 1)\"," %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
e08e4dbf
AF
104fi
105
106%preun
7d3739f8
AM
107if [ "$1" = "0" ]; then
108 %service tvheadend stop
109 /sbin/chkconfig --del tvheadend
110fi
e08e4dbf
AF
111%systemd_preun %{name}.service
112
113%postun
114if [ "$1" = "0" ]; then
f2240875 115 %userremove tvheadend
e08e4dbf
AF
116fi
117%systemd_reload
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}
127%{systemdunitdir}/%{name}.service
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}
134%dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol
135%attr(600,tvheadend,video) %config(noreplace) %verify(not md5 mtime size) %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
This page took 0.082676 seconds and 4 git commands to generate.