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