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