From: Jaroslav Kysela Date: Fri, 20 Apr 2018 13:08:07 +0000 (+0200) Subject: rpm: spec cleanups X-Git-Tag: v4.2.7~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=641b71496233bf54cd6af06fec9bb51f04d9cf4a;p=thirdparty%2Ftvheadend.git rpm: spec cleanups --- diff --git a/rpm/rpmfusion.spec.in b/rpm/rpmfusion.spec.in deleted file mode 100644 index 41b441a09..000000000 --- a/rpm/rpmfusion.spec.in +++ /dev/null @@ -1,107 +0,0 @@ -%global ref @REF@ -%global commit @COMMIT@ -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - -Name: tvheadend -Summary: TV streaming server and Digital Video Recorder -Version: @VERSION@ -Release: @RELEASE@%{?dist} - -License: GPLv3 -Group: Applications/Multimedia -URL: http://tvheadend.org - -Source: https://github.com/tvheadend/tvheadend/archive/%{ref}/tvheadend-%{commit}.tar.gz -#Patch999: test.patch - -BuildRequires: systemd-units -BuildRequires: gettext-devel -BuildRequires: dbus-devel -BuildRequires: avahi-devel -BuildRequires: avahi-libs -BuildRequires: openssl-devel -BuildRequires: uriparser-devel -BuildRequires: ffmpeg-devel -BuildRequires: python - -Requires: systemd-units - -%description -Tvheadend is a TV streaming server with Digital Video Recorder functionality -for Linux supporting DVB, ATSC, IPTV, SAT>IP, HDHomeRun as input sources. - -It can be used as a back-end to HTTP (VLC, MPlayer), HTSP (Movian, Kodi), -SAT>IP and various other clients using these protocols. - -%prep -%setup -q -n tvheadend-%{commit} -#%patch999 -p1 -b .test - -%build -echo %{version}-%{release} > %{_builddir}/%{buildsubdir}/rpm/version -%configure --disable-lockowner --enable-bundle --disable-ffmpeg_static -%{__make} %{?_smp_mflags} - -%install -# binary -mkdir -p -m755 %{buildroot}%{_bindir} -install -p -m 755 build.linux/tvheadend %{buildroot}%{_bindir} -# systemd -mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysconfig -install -p -m 644 rpm/tvheadend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/tvheadend -mkdir -p -m755 %{buildroot}%{_unitdir} -install -p -m 644 rpm/tvheadend.service %{buildroot}%{_unitdir} - -%pre -getent group tvheadend >/dev/null || groupadd -f -g 283 -r tvheadend -if ! getent passwd tvheadend > /dev/null ; then - if ! getent passwd 283 > /dev/null ; then - useradd -r -l -u 283 -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend - else - useradd -r -l -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend - fi -fi -if ! test -d /home/tvheadend ; then - mkdir -m 0755 /home/tvheadend || exit 1 - chown tvheadend.tvheadend /home/tvheadend || exit 1 -fi -exit 0 - -%post -%systemd_post tvheadend.service - -%postun -%systemd_postun_with_restart tvheadend.service - -%files -%{_bindir}/* -%{_sysconfdir}/sysconfig/* -%{_unitdir}/* - -%changelog -* Wed May 27 2015 Jaroslav Kysela 4.0.3-1 -- rpmlint fixes - -* Mon May 25 2015 Jaroslav Kysela 4.0.2-1 -- fix requires (libs) and improve description -- add support for final version to Source - -* Thu May 21 2015 Jaroslav Kysela 4.0.1-1 -- changed versioning system (put changes and git hash to revision) - -* Thu May 14 2015 Jaroslav Kysela 3.9-2842 -- add python to BuildRequires - -* Wed Mar 25 2015 Bob Lightfoot 3.9-2658-gb427d7e -- Patching rpm spec file so the arm architecture builds properly - -* Mon Oct 13 2014 Jaroslav Kysela 3.9-1806-g6f3324e -- RPM: Typo fixes - -* Mon Oct 13 2014 Jaroslav Kysela 3.9-1805-g14a7de8 -- RPM build - config fixes - -* Mon Oct 13 2014 Jaroslav Kysela 3.9-1803-g392dec0 -- Add basic RPM build support - -~ diff --git a/rpm/tvheadend.spec.in b/rpm/tvheadend.spec.in index 9c9c8f774..3a0ba2a03 100644 --- a/rpm/tvheadend.spec.in +++ b/rpm/tvheadend.spec.in @@ -2,6 +2,10 @@ %global commit @COMMIT@ %global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global tvheadend_user %{name} +%global tvheadend_group %{name} +%global tvheadend_group_number 283 + Name: tvheadend Summary: TV streaming server and Digital Video Recorder Version: @VERSION@ @@ -14,6 +18,10 @@ URL: http://tvheadend.org Source: https://github.com/tvheadend/tvheadend/archive/%{ref}/tvheadend-%{commit}.tar.gz #Patch999: test.patch +BuildRequires: bzip2 +BuildRequires: gcc +BuildRequires: gettext +BuildRequires: gzip BuildRequires: systemd-units BuildRequires: gettext-devel BuildRequires: dbus-devel @@ -22,8 +30,12 @@ BuildRequires: avahi-libs BuildRequires: openssl-devel BuildRequires: wget python git BuildRequires: cmake +BuildRequires: python2 + +%{?systemd_requires} +Requires: bzip2 +Requires: tar -Requires: systemd-units %description Tvheadend is a TV streaming server with Digital Video Recorder functionality @@ -32,56 +44,75 @@ for Linux supporting DVB, ATSC, IPTV, SAT>IP, HDHomeRun as input sources. It can be used as a back-end to HTTP (VLC, MPlayer), HTSP (Movian, Kodi), SAT>IP and various other clients using these protocols. + %prep %setup -q -n tvheadend-%{commit} #%patch999 -p1 -b .test + %build echo %{version}-%{release} > %{_builddir}/%{buildsubdir}/rpm/version %ifarch %arm - %configure --disable-lockowner --enable-bundle --disable-ffmpeg_static + %configure --disable-lockowner --disable-ffmpeg_static %else - %configure --disable-lockowner --enable-bundle --enable-ffmpeg_static --enable-libx265 + %configure --disable-lockowner --enable-ffmpeg_static --enable-libx265 %endif -%{__make} %{?_smp_mflags} +%make_build PYTHON=python2 + %install -# binary -mkdir -p -m755 %{buildroot}%{_bindir} -install -p -m 755 build.linux/tvheadend %{buildroot}%{_bindir} -# systemd -mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysconfig -install -p -m 644 rpm/tvheadend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/tvheadend -mkdir -p -m755 %{buildroot}%{_unitdir} -install -p -m 644 rpm/tvheadend.service %{buildroot}%{_unitdir} +%make_install + +install -Dpm 0644 rpm/tvheadend.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -Dpm 0644 rpm/tvheadend.service %{buildroot}%{_unitdir}/%{name}.service + +install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name}/ + +chmod 0644 %{buildroot}%{_mandir}/man1/%{name}.1 + %pre -getent group tvheadend >/dev/null || groupadd -f -g 283 -r tvheadend +getent group tvheadend >/dev/null || groupadd -f -g %{tvheadend_group_number} -r tvheadend if ! getent passwd tvheadend > /dev/null ; then - if ! getent passwd 283 > /dev/null ; then - useradd -r -l -u 283 -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend + if ! getent passwd %{tvheadend_group_number} > /dev/null ; then + useradd -r -l -u %{tvheadend_group_number} -g tvheadend \ + -d %{_sharedstatedir}/%{name}/ -s /sbin/nologin \ + -c "Tvheadend TV server" tvheadend else - useradd -r -l -g tvheadend -d /home/tvheadend -s /sbin/nologin -c "Tvheadend TV server" tvheadend + useradd -r -l -g tvheadend -d /home/tvheadend \ + -s /sbin/nologin -c "Tvheadend TV server" tvheadend fi fi -if ! test -d /home/tvheadend ; then - mkdir -m 0755 /home/tvheadend || exit 1 - chown tvheadend.tvheadend /home/tvheadend || exit 1 -fi exit 0 + %post -%systemd_post tvheadend.service +%systemd_post %{name}.service + + +%preun +%systemd_preun %{name}.service + %postun -%systemd_postun_with_restart tvheadend.service +%systemd_postun_with_restart %{name}.service + %files +%doc CONTRIBUTING.md README.md +%license LICENSE.md licenses/gpl-3.0.txt %{_bindir}/* -%{_sysconfdir}/sysconfig/* +%{_datadir}/%{name}/ %{_unitdir}/* +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_mandir}/man1/*.1.* +%attr(-,%{tvheadend_user},%{tvheadend_group}) %dir %{_sharedstatedir}/%{tvheadend_user}/ + %changelog +* Fri Apr 20 2018 Jaroslav Kysela 4.2.6-1 +- many fixes + * Wed May 27 2015 Jaroslav Kysela 4.0.3-1 - rpmlint fixes @@ -106,5 +137,3 @@ exit 0 * Mon Oct 13 2014 Jaroslav Kysela 3.9-1803-g392dec0 - Add basic RPM build support - -~ diff --git a/rpm/tvheadend.sysconfig b/rpm/tvheadend.sysconfig index 374c6bcda..52ce2a62b 100644 --- a/rpm/tvheadend.sysconfig +++ b/rpm/tvheadend.sysconfig @@ -1,4 +1,4 @@ # Configuration file for the tvheadend service. MALLOC_ARENA_MAX=4 -OPTIONS="-c /home/tvheadend/config -u tvheadend -g tvheadend -6 --http_port 9981 --htsp_port 9982" +OPTIONS="-c /var/lib/tvheadend/config -u tvheadend -g tvheadend -6 --http_port 9981 --htsp_port 9982"