rpms/mythtv-status/devel mythtv-status-fedora.patch, NONE, 1.1 mythtv-status.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Jussi Lehtola jussilehtola at rpmfusion.org
Tue Jan 18 16:45:14 CET 2011


Author: jussilehtola

Update of /cvs/free/rpms/mythtv-status/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv14486/devel

Modified Files:
	.cvsignore sources 
Added Files:
	mythtv-status-fedora.patch mythtv-status.spec 
Log Message:
Initial import.


mythtv-status-fedora.patch:
 mythtv-update-motd    |   29 +++++++++++++++++++++++------
 mythtv_recording_now  |    6 +++---
 mythtv_recording_soon |    6 +++---
 3 files changed, 29 insertions(+), 12 deletions(-)

--- NEW FILE mythtv-status-fedora.patch ---
diff -up mythtv-status-0.9.0/bin/mythtv_recording_now.orig mythtv-status-0.9.0/bin/mythtv_recording_now
--- mythtv-status-0.9.0/bin/mythtv_recording_now.orig	2008-07-11 01:13:30.000000000 +0300
+++ mythtv-status-0.9.0/bin/mythtv_recording_now	2009-04-11 11:38:31.000000000 +0300
@@ -9,10 +9,10 @@
 # Return an exit code of 0 if the MythTV backend is currently recording
 # a show.
 
-# Where Debian stores the config info.
-if [ -f /etc/default/mythtv-status ]
+# Where Fedora stores the config info.
+if [ -f /etc/sysconfig/mythtv-status ]
 then
-  . /etc/default/mythtv-status
+  . /etc/sysconfig/mythtv-status
 fi
 
 /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
@@ -9,10 +9,10 @@
 # Return an exit code of 0 if the MythTV backend is currently recording
 # a show or will be recording a show soon (in the next hour).
 
-# Where Debian stores the config info.
-if [ -f /etc/default/mythtv-status ]
+# Where Fedora stores the config info.
+if [ -f /etc/sysconfig/mythtv-status ]
 then
-  . /etc/default/mythtv-status
+  . /etc/sysconfig/mythtv-status
 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-0.9.0/bin/mythtv-update-motd.orig	2008-07-11 01:13:30.000000000 +0300
+++ mythtv-status-0.9.0/bin/mythtv-update-motd	2009-04-13 11:29:30.000000000 +0300
@@ -1,16 +1,33 @@
 #!/bin/bash
 
-. /etc/default/mythtv-status
+. /etc/sysconfig/mythtv-status
 
-if [ x$RUN != xyes ]
+if [ x$UPDATEMOTD != xyes ]
 then
   exit
 fi
 
-[ ! -f /var/run/motd.orig ] && cp /var/run/motd /var/run/motd.orig
+# Check if stub exists. If not, assume motd is OK to use as stub
+if [ ! -f /etc/motd.stub ]; then
+ if [ -f /etc/motd ]; then
+  cp -a /etc/motd /etc/motd.stub
+ else # No motd exists, create empty stub file
+  touch /etc/motd.stub
+ fi
+fi
+
+# Update motd:
+if [ -f /etc/motd.stub ]; then
+ # Insert stub
+ cp /etc/motd.stub /tmp/motd.new
+fi
 
-cp /var/run/motd.orig /var/run/motd.new
-if mythtv-status $ARGS -h $HOST >> /var/run/motd.new
+# Add mythtv status to end of stub
+if mythtv-status $ARGS -h $HOST >> /tmp/motd.new
 then
-  mv /var/run/motd.new /var/run/motd
+  cp /tmp/motd.new /etc/motd # If succesful, replace motd
+fi
+
+if [ -f /tmp/motd.new ]; then
+ rm /tmp/motd.new
 fi


--- NEW FILE mythtv-status.spec ---
Name:		mythtv-status
Version:	0.9.0
Release:	5%{?dist}
Summary:	Get the current status of your MythTV system at the command line
Group:		Applications/Multimedia
# Scripts claim to be under GPLv2 but COPYING and ChangeLog state license
# is GPLv3. Contacted upstream, new release coming soon.
License:	GPLv3
URL:		http://www.etc.gen.nz/projects/mythtv/mythtv-status.html
Source0:	http://www.etc.gen.nz/projects/mythtv/tarballs/mythtv-status-0.9.0.tar.gz
# Patch for Fedora specifics
Patch0:		mythtv-status-fedora.patch
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:	noarch

# Requires not detected automatically
Requires:	mythtv-backend
Requires:	perl(MythTV)

%description
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
UPDATEMOTD=no to UPDATEMOTD=yes. The update is run hourly. The resulting motd
is based on /etc/motd.stub, added with the output of mythtv-status.

%prep
%setup -q
%patch0 -p1

%build

%install
rm -rf %{buildroot} 

# 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

# Sysconfig file
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
echo -e "HOST=127.0.0.1\nUPDATEMOTD=no" > %{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/usr/sbin/mythtv-update-motd" > %{buildroot}%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
chmod 755  %{buildroot}%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING FAQ README THANKS
%{_bindir}/mythtv*
%{_sbindir}/mythtv*
%{_mandir}/man1/mythtv*.1.gz
%{_sysconfdir}/cron.hourly/mythtv-update-motd.cron
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}

%changelog
* Thu Dec 16 2010 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.9.0-5
- Changed R: perl-net-UPnP to R: perl(MythTV).

* Mon Apr 13 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.9.0-4
- Copy motd instead of move to avoid SELinux errors.
- Fix motd update to use stub instead of motd.

* Sun Apr 12 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.9.0-3
- Modify motd update method and update script location.

* Sat Apr 11 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.9.0-2
- Fix sysconfig file location.

* Sat Apr 11 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.9.0-1
- First release.


Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/mythtv-status/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	9 Jan 2011 11:33:39 -0000	1.1
+++ .cvsignore	18 Jan 2011 15:45:13 -0000	1.2
@@ -0,0 +1 @@
+mythtv-status-0.9.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/free/rpms/mythtv-status/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	9 Jan 2011 11:33:39 -0000	1.1
+++ sources	18 Jan 2011 15:45:14 -0000	1.2
@@ -0,0 +1 @@
+953828e140f166252c7ba65dce63f1d6  mythtv-status-0.9.0.tar.gz



More information about the rpmfusion-commits mailing list