]> git.pld-linux.org Git - packages/tvheadend.git/blob - tvheadend.spec
- relup.sh friendly release 2
[packages/tvheadend.git] / tvheadend.spec
1 #
2 # Conditional build:
3 %bcond_without  systemd         # without systemd support
4
5 %define         gitref  637844055c186e981495da711e4887806f656c98
6 %define         snap    20210531
7 %define         rel     2
8
9 Summary:        TV streaming server
10 Name:           tvheadend
11 # https://tvheadend.org/projects/tvheadend/wiki/Releases
12 Version:        4.3.0
13 Release:        0.%{snap}.%{rel}
14 License:        GPL v3
15 Group:          Applications/Multimedia
16 Source0:        https://github.com/tvheadend/tvheadend/archive/%{gitref}/%{name}-%{snap}.tar.gz
17 # Source0-md5:  9d5f4e06a458ea221e9c218837e817fa
18 Source1:        %{name}.service
19 Source2:        %{name}.sysconfig
20 Source3:        %{name}.init
21 Patch0:         x32.patch
22 URL:            https://tvheadend.org/projects/tvheadend
23 BuildRequires:  avahi-devel
24 BuildRequires:  dbus-devel
25 BuildRequires:  ffmpeg-devel >= 3.0
26 BuildRequires:  gettext-tools
27 BuildRequires:  libdvbcsa-devel
28 BuildRequires:  openssl-devel
29 BuildRequires:  pcre2-8-devel
30 BuildRequires:  pkgconfig
31 BuildRequires:  python3-modules
32 BuildRequires:  rpmbuild(macros) >= 1.647
33 %{?with_systemd:BuildRequires:  systemd-devel}
34 BuildRequires:  uriparser-devel
35 BuildRequires:  zlib-devel
36 Requires(post): sed >= 4.0
37 Requires(post,preun):   /sbin/chkconfig
38 %{?with_systemd:Requires(post,preun,postun):    systemd-units >= 38}
39 Requires(postun):       /usr/sbin/userdel
40 Requires(pre):  /bin/id
41 Requires(pre):  /usr/sbin/useradd
42 Requires:       setup
43 %{?with_systemd:Requires:       systemd-units >= 0.38}
44 Provides:       user(tvheadend)
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2,
49 DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
50
51 %prep
52 %setup -q -n %{name}-%{gitref}
53 %ifarch x32
54 %patch0 -p1
55 %endif
56
57 %{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' lib/py/tvh/tv_meta_{tm,tv}db.py support/tvhmeta
58
59 %build
60 export CFLAGS="%{rpmcflags}"
61 export LDFLAGS="%{rpmldflags}"
62
63 # tvheadend uses a custom script, so %%configure cannot be used
64 # as not all options are supported
65 ./configure \
66         --cc="%{__cc}" \
67         --release \
68         --prefix=%{_prefix} \
69         --libdir=%{_libdir} \
70         --mandir=%{_mandir} \
71         --python=%{__python3} \
72         --disable-dvbscan \
73         --disable-ffmpeg_static \
74         --disable-hdhomerun_static \
75         %{!?with_systemd:--disable-libsystemd_daemon}
76
77 %{__make} V=1
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/.hts/%{name} \
82         $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/Videos \
83         %{?with_systemd:$RPM_BUILD_ROOT%{systemdunitdir}} \
84         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
85
86 %{__make} install \
87         DESTDIR=$RPM_BUILD_ROOT \
88         V=1
89
90 %{?with_systemd:cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service}
91 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
92 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
93
94 chmod +x $RPM_BUILD_ROOT%{_bindir}/%{name}
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %pre
100 %useradd -u 20 -d %{_localstatedir}/lib/%{name} -g video -G usb -c "tvheadend User" tvheadend
101
102 %post
103 /sbin/chkconfig --add tvheadend
104 %service tvheadend reload "tvheadend"
105 %{?with_systemd:%systemd_post %{name}.service}
106
107 %preun
108 if [ "$1" = "0" ]; then
109         %service tvheadend stop
110         /sbin/chkconfig --del tvheadend
111 fi
112 %{?with_systemd:%systemd_preun %{name}.service}
113
114 %postun
115 if [ "$1" = "0" ]; then
116         %userremove tvheadend
117 fi
118 %{?with_systemd:%systemd_reload}
119
120 %files
121 %defattr(644,root,root,755)
122 %doc docs
123 %attr(755,root,root) %{_bindir}/%{name}
124 %attr(754,root,root) /etc/rc.d/init.d/tvheadend
125 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
126 %{_mandir}/man1/%{name}.1*
127 %{_datadir}/%{name}
128 %{?with_systemd:%{systemdunitdir}/%{name}.service}
129
130 # home directory and config file
131 %dir %attr(755,tvheadend,root) %{_localstatedir}/lib/%{name}
132 %dir %attr(755,tvheadend,video) %{_localstatedir}/lib/%{name}/Videos
133 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts
134 %dir %attr(750,tvheadend,video) %{_localstatedir}/lib/%{name}/.hts/%{name}
This page took 0.076993 seconds and 4 git commands to generate.