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