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