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