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