commit 78b1ab175775f6a589921fe1ea713f4b25b178f1
Author: Göran Uddeborg <goeran(a)uddeborg.se>
Date: Wed Jul 26 11:16:18 2023 +0200
Update to 1.1.0
Use the now provided make target to install rather than our own scripting
Use the now provided systemd timers rather than our own cron configuration
Change license tag to SPDX format
Run tests during build
.gitignore | 1 +
default-localhost.patch | 22 +++++++++++++
install-motdupdater.patch | 26 ++++++++++++++++
mythtv-status-fedora.patch | 34 ++++++++++++++++++--
mythtv-status.spec | 77 +++++++++++++++++++++++++++++-----------------
sources | 2 +-
sysconfig | 8 +++--
7 files changed, 136 insertions(+), 34 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d97f711..ab36f8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/mythtv-status-1.0.0.tar.gz
/mythtv-status-1.0.1.tar.gz
+/mythtv-status-1.1.0.tar.gz
diff --git a/default-localhost.patch b/default-localhost.patch
new file mode 100644
index 0000000..f9df9cd
--- /dev/null
+++ b/default-localhost.patch
@@ -0,0 +1,22 @@
+--- mythtv-status-1.1.0/bin/health-check.fedora 2023-07-26 10:31:31.000000000 +0200
++++ mythtv-status-1.1.0/bin/health-check 2023-07-26 10:35:29.000000000 +0200
+@@ -15,7 +15,7 @@
+ exit
+ fi
+
+-/usr/bin/mythtv-status --host "$HOST" --email "$EMAIL"
"$EMAIL_ARGS"
++/usr/bin/mythtv-status --host "${HOST:-localhost}" --email "$EMAIL"
"$EMAIL_ARGS"
+
+ # Keep things happy by always having a return code of 0.
+ exit 0
+--- mythtv-status-1.1.0/bin/mythtv-update-motd.orig 2023-07-22 14:17:03.000000000 +0200
++++ mythtv-status-1.1.0/bin/mythtv-update-motd 2023-07-26 10:35:30.000000000 +0200
+@@ -82,7 +82,7 @@
+ [ "$UPDATE_MOTD_ARGS" = "" ] && UPDATE_MOTD_ARGS=$ARGS
+
+ ret=0
+-mythtv-status $UPDATE_MOTD_ARGS -h $HOST >> $TEMPFILE || ret=$?
++mythtv-status $UPDATE_MOTD_ARGS -h "${HOST:-localhost}" >> $TEMPFILE ||
ret=$?
+ if [ $ret -eq 0 ] || [ $ret -eq 1 ]; then
+ if [ ! -f $TEMPFILE ]; then
+ echo My temporary file has gone away, failed.
diff --git a/install-motdupdater.patch b/install-motdupdater.patch
new file mode 100644
index 0000000..9fa2151
--- /dev/null
+++ b/install-motdupdater.patch
@@ -0,0 +1,26 @@
+--- mythtv-status-1.1.0/Makefile.orig 2023-07-22 14:17:03.000000000 +0200
++++ mythtv-status-1.1.0/Makefile 2023-07-25 20:56:28.000000000 +0200
+@@ -1,6 +1,7 @@
+ #!/usr/bin/make -f
+
+ BINDIR=$(DESTDIR)/usr/bin
++SBINDIR=$(DESTDIR)/usr/sbin
+ LIBEXECDIR=$(DESTDIR)/usr/libexec/mythtv-status
+ MANDIR=$(DESTDIR)/usr/man
+ SYSTEMDDIR=$(DESTDIR)/lib/systemd/system
+@@ -71,6 +72,7 @@
+
+ install:
+ install -d $(BINDIR)
++ install -d $(SBINDIR)
+ install -d $(LIBEXECDIR)
+ install -d $(MANDIR)/man1
+ install -d $(MANDIR)/man8
+@@ -78,6 +80,7 @@
+ install -m 775 bin/mythtv-status $(BINDIR)
+ install -m 775 bin/mythtv_recording_now $(BINDIR)
+ install -m 775 bin/mythtv_recording_soon $(BINDIR)
++ install -m 775 bin/mythtv-update-motd $(SBINDIR)
+ install -m 775 bin/health-check $(LIBEXECDIR)
+ pod2man bin/mythtv-status > $(MANDIR)/man1/mythtv-status.1
+ install -m 644 man/mythtv-update-motd.8 $(MANDIR)/man8
diff --git a/mythtv-status-fedora.patch b/mythtv-status-fedora.patch
index a1bdf8f..628aeae 100644
--- a/mythtv-status-fedora.patch
+++ b/mythtv-status-fedora.patch
@@ -14,7 +14,7 @@ diff -up mythtv-status-0.9.0/bin/mythtv_recording_now.orig
mythtv-status-0.9.0/b
+ . /etc/sysconfig/mythtv-status
fi
- /usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only --recording-now
+ /usr/bin/mythtv-status -h "${HOST:=localhost}" --return-code-only
--recording-now
diff -up mythtv-status-0.9.0/bin/mythtv_recording_soon.orig
mythtv-status-0.9.0/bin/mythtv_recording_soon
--- mythtv-status-0.9.0/bin/mythtv_recording_soon.orig 2008-07-11 01:13:30.000000000
+0300
+++ mythtv-status-0.9.0/bin/mythtv_recording_soon 2009-04-11 11:39:10.000000000 +0300
@@ -32,4 +32,34 @@ diff -up mythtv-status-0.9.0/bin/mythtv_recording_soon.orig
mythtv-status-0.9.0/
fi
if [ "x$1" != "x" ]
-diff -up mythtv-status-0.9.0/bin/mythtv-update-motd.orig
mythtv-status-0.9.0/bin/mythtv-update-motd
+--- mythtv-status-1.1.0/man/mythtv-update-motd.8.orig 2023-07-22 14:17:03.000000000
+0200
++++ mythtv-status-1.1.0/man/mythtv-update-motd.8 2023-07-26 10:17:03.000000000 +0200
+@@ -24,7 +24,7 @@
+ typically run from cron.
+ .SH CONFIGURATION
+ The configuration file for this script is
+-.I /etc/default/mythtv-status
++.I /etc/sysconfig/mythtv-status
+ options of interest:
+ .TP
+ .B HOST
+@@ -61,7 +61,7 @@
+ .B 1
+ Failed to update MOTD with MythTV status
+ .SH FILES
+-.B /etc/default/mythtv-status
++.B /etc/sysconfig/mythtv-status
+ Config file
+ .SH SEE ALSO
+ .BR mythtv-status (1),
+--- mythtv-status-1.1.0/bin/health-check.orig 2023-07-22 14:17:03.000000000 +0200
++++ mythtv-status-1.1.0/bin/health-check 2023-07-26 10:29:39.000000000 +0200
+@@ -8,7 +8,7 @@
+ #
+ # Run mythtv-status to perform a health check of the MythTV system.
+
+-. /etc/default/mythtv-status
++. /etc/sysconfig/mythtv-status
+
+ if [ "$EMAIL" = "" ] || [ "$EMAIL" = "none" ]
+ then
diff --git a/mythtv-status.spec b/mythtv-status.spec
index acaf1f5..6f67fc9 100644
--- a/mythtv-status.spec
+++ b/mythtv-status.spec
@@ -1,19 +1,33 @@
Name: mythtv-status
-Version: 1.0.1
-Release: 9%{?dist}
+Version: 1.1.0
+Release: 1%{?dist}
Summary: Get the current status of your MythTV system at the command line
Summary(sv): Hämta ett MythTV-systems status på kommandoraden
-License: GPLv3
+License: GPL-3.0-only
URL:
http://www.etc.gen.nz/projects/mythtv/mythtv-status.html
Source0:
http://www.etc.gen.nz/projects/mythtv/tarballs/mythtv-status-%{version}.t...
Source1: sysconfig
# Patch for Fedora specifics
Patch0: mythtv-status-fedora.patch
+# Reported upstreams via e-mail
+Patch1: install-motdupdater.patch
+# Reported upstreams via e-mail
+Patch2: default-localhost.patch
BuildArch: noarch
-# For perl dependency auto-detection
-BuildRequires: perl-generators
+
+BuildRequires: make
+# For tests
+BuildRequires: perl-Date-Manip
+BuildRequires: perl-ExtUtils-MakeMaker
+BuildRequires: perl-FindBin
+BuildRequires: perl-libwww-perl
+BuildRequires: perl-MIME-tools
+BuildRequires: perl-Test-Simple
+BuildRequires: perl-XML-LibXML
# For pod2man
BuildRequires: perl-podlators
+# For _unitdir and script definitions
+BuildRequires: systemd-rpm-macros
# Requires not detected automatically
Requires: perl(MythTV)
@@ -27,45 +41,43 @@ This Perl script will display the current status of your MythTV system
at the
command line. It can optionally append it to the system message of the day
(MOTD) on a regular basis.
-If you want to enable motd update, edit /etc/sysconfig/mythtv-status and change
-UPDATE_MOTD=no to UPDATE_MOTD=yes. The update is run hourly. The resulting motd
-is based on /etc/motd.stub, added with the output of mythtv-status.
+If you want to enable motd update, enable the systemd unit
+mythtv-status_update-motd.timer. The update is run quarterly. The
+resulting motd is based on /etc/motd.stub, added with the output of
+mythtv-status.
%description -l sv
Detta Perl-skript kommer visa den aktuella statusen för ett MythTV-system på
kommandoraden. Möjligheten finns även att lägga till statusen till dagens
systemmeddelande (MOTD) med regelbundna intervaller.
-För att aktivera motd-uppdateringar redigerar man
-/etc/sysconfig/mythtv-status och ändrar UPDATE_MOTD=no till UPDATE_MOTD=yes.
-Uppdateringen körs en gång i timmen. Den resulterande motd:n baseras på
-/etc/motd.stub med utskriften från mythtv-status tillagd.
+För att aktivera motd-uppdateringar aktiverar man systemd-enheten
+mythtv-status_update-motd.timer. Uppdateringen körs en gång i kvarten.
+Den resulterande motd:n baseras på /etc/motd.stub med utskriften från
+mythtv-status tillagd.
%prep
-%setup -q
-%patch0 -p1 -b .orig
+%autosetup -p1
%build
-pod2man bin/mythtv-status man/mythtv-status.1
+%make_build
%install
-# Install scripts
-mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_sbindir}
-install -p -m 755 bin/mythtv-status bin/mythtv_recording_{now,soon}
%{buildroot}%{_bindir}
-install -p -m 755 bin/mythtv-update-motd %{buildroot}%{_sbindir}
-
-# Man files
-mkdir -p %{buildroot}%{_mandir}/man1
-install -p -m 644 man/* %{buildroot}%{_mandir}/man1
+%make_install 'MANDIR=$(DESTDIR)%_mandir'
'SYSTEMDDIR=$(DESTDIR)%_unitdir'
# Sysconfig file
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 644 %SOURCE1 %{buildroot}%{_sysconfdir}/sysconfig/%{name}
-# Cron file to update motd, doesn't do anything if not enabled in sysconfig
-mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
-echo -e "#!/bin/sh\n%{_sbindir}/mythtv-update-motd" >
%{buildroot}%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
-chmod 755 %{buildroot}%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
+%post
+%systemd_post mythtv-status_health-check.timer mythtv-status_update-motd.timer
+
+%preun
+%systemd_preun mythtv-status_health-check.timer mythtv-status_update-motd.timer
+
+%postun
+%systemd_postun_with_restart mythtv-status_health-check.timer
mythtv-status_update-motd.timer
+
%files
%doc ChangeLog FAQ README THANKS
@@ -73,10 +85,19 @@ chmod 755
%{buildroot}%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
%{_bindir}/mythtv*
%{_sbindir}/mythtv*
%{_mandir}/man1/mythtv*.1.gz
-%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
+%{_mandir}/man8/mythtv-update-motd.8.gz
+%{_libexecdir}/%{name}
+%{_unitdir}/*
%config %{_sysconfdir}/sysconfig/%{name}
%changelog
+* Wed Jul 26 2023 Göran Uddeborg <goeran(a)uddeborg.se> - 1.1.0-1
+- Update to 1.1.0
+- Use the now provided make target to install rather than our own scripting
+- Use the now provided systemd timers rather than our own cron configuration
+- Change license tag to SPDX format
+- Run tests during build
+
* Sun Aug 07 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
1.0.1-9
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild and ffmpeg
5.1
diff --git a/sources b/sources
index 8145622..7b04e25 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1be528109f13077204c88dde34b3553c mythtv-status-1.0.1.tar.gz
+SHA512 (mythtv-status-1.1.0.tar.gz) =
4a0fd49cb36624d0da677f901ae48ae7c2971e3d18e0a2669cbfe137ed540321373fe9118aa603ef6fcf0397c4af0ee5a5086d20481cdcedc47b5881ff8da3f5
diff --git a/sysconfig b/sysconfig
index ece30ae..4dcb40a 100644
--- a/sysconfig
+++ b/sysconfig
@@ -1,5 +1,7 @@
# Configurations for the update of /etc/motd
# Set UPDATE_MOTD to "yes" to enable updates.
-UPDATE_MOTD=no
-# Talk the MythTV server on this host.
-HOST=127.0.0.1
+UPDATE_MOTD=yes
+# Specify a different defult host than localhost.
+#
HOST=example.com
+# Address to send health check results to.
+# EMAIL=user(a)example.com