]> git.pld-linux.org Git - packages/tvheadend.git/blob - tvheadend.spec
- fix time_t usage on x32
[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 Patch0:         x32.patch
15 URL:            https://tvheadend.org/projects/tvheadend
16 BuildRequires:  avahi-devel
17 BuildRequires:  curl-devel
18 BuildRequires:  ffmpeg-devel
19 BuildRequires:  python-modules
20 BuildRequires:  rpmbuild(macros) >= 1.647
21 BuildRequires:  uriparser-devel
22 BuildRequires:  zlib-devel
23 Requires(post): pwgen
24 Requires(post): sed >= 4.0
25 Requires(post,preun):   /sbin/chkconfig
26 Requires(post,preun,postun):    systemd-units >= 38
27 Requires(postun):       /usr/sbin/userdel
28 Requires(pre):  /bin/id
29 Requires(pre):  /usr/sbin/useradd
30 Requires:       setup
31 Requires:       systemd-units >= 0.38
32 Provides:       user(tvheadend)
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2,
37 DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
38
39 %prep
40 %setup -q
41 %patch0 -p1
42
43 %build
44 export CFLAGS="%{rpmcflags}"
45 export CC="%{__cc}"
46
47 # tvheadend uses a custom script, so %%configure cannot be used
48 # as not all options are supported
49 ./configure \
50         --release \
51         --prefix=%{_prefix} \
52         --libdir=%{_libdir} \
53         --mandir=%{_mandir} \
54         --disable-dvbscan
55
56 %{__make} V=1
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol \
61         $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
62         $RPM_BUILD_ROOT%{systemdunitdir} \
63         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
64
65 %{__make} install \
66         DESTDIR=$RPM_BUILD_ROOT
67
68 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
69 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
70 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
71 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
72
73 chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %pre
79 %useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -G usb -c "tvheadend User" tvheadend
80
81 %post
82 /sbin/chkconfig --add tvheadend
83 %service tvheadend reload "tvheadend"
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
88 if  grep -q '"password": "dummypassword"' %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1; then
89         sed -i "s,\"password\": \"dummypassword\",\"password\": \"$(pwgen -s 12 1)\"," %{_localstatedir}/lib/%{name}/.hts/%{name}/accesscontrol/1
90 fi
91
92 %preun
93 if [ "$1" = "0" ]; then
94         %service tvheadend stop
95         /sbin/chkconfig --del tvheadend
96 fi
97 %systemd_preun %{name}.service
98
99 %postun
100 if [ "$1" = "0" ]; then
101         %userremove tvheadend
102 fi
103 %systemd_reload
104
105 %files
106 %defattr(644,root,root,755)
107 %doc docs
108 %attr(755,root,root) %{_bindir}/%{name}
109 %attr(754,root,root) /etc/rc.d/init.d/tvheadend
110 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
111 %{_mandir}/man1/%{name}.1*
112 %{_datadir}/%{name}
113 %{systemdunitdir}/%{name}.service
114
115 # home directory and config file
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.53445 seconds and 4 git commands to generate.