[sunwait] Initial import (#1045676).

Eric Smith brouhaha at fedoraproject.org
Mon Mar 9 21:10:54 UTC 2015


commit 3a4b44e25291f9aeced3ecbc50611ebc3448321f
Author: Eric Smith <brouhaha at fedoraproject.org>
Date:   Mon Mar 9 15:10:43 2015 -0600

    Initial import (#1045676).

 .gitignore           |  1 +
 index.html           | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources              |  1 +
 sunwait-string.patch | 11 +++++++
 sunwait.spec         | 60 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 155 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..fe13615 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sunwait-20041208.tar.gz
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..f104521
--- /dev/null
+++ b/index.html
@@ -0,0 +1,82 @@
+<html>
+<head>
+<title>Sunwait</title>
+<body>
+<H2>Sunwait</h2>
+
+
+
+<p>
+Sunwait is a small C program for calculating sunrise and sunset, as
+well as civil, nautical, and astronomical twilights.  It has features
+that make it useful for home automation tasks.
+
+<h3>
+NOTE: I last updated sunwait in 2004.  In 2013, Ian Craig forked sunwait as <a href="http://sourceforge.net/projects/sunwait4windows">"sunwait4windows"</a> and has added new features, such as: user specified twilight angles, and a simple polling function to indicate DAY or NIGHT.  Ian indicated that he intends to port to the Raspberry Pi/Linux.  Since I am not actively maintaining sunwait, Ian's version should be considered "current".
+
+</h3>
+<hr/>
+<p>
+Originally, developed under Linux, it should work on any system with a C
+compiler and the C standard library.  With some minor patches provided
+by George Gugulea, it will compile on Win32 - which results in <a
+href="./sunwait.exe">sunwait.exe</a>, but I haven't tested this
+extensively.</p>
+
+<p> The feature that makes this program slightly unique is that it can
+be set to wait specific event (such as 5 minutes before sunrise), then
+exit.  This makes it useful for 'cron' jobs or 'scheduled tasks' when
+you want something to happen relative to sunrise, sunset, or some
+other astronomical event. </p>
+
+<p>
+
+For example, consider this line from my crontab:<br>
+<code>
+01 00 * * * sunwait civ start 38.794433N, 77.069450W ; br b6 off
+</code>
+<p>
+This line executes at at one minute after midnight, waits until the
+start of civil twilight, then runs the command <code> br b6 off</code>
+(which turns off my carriage light).
+
+<p> Thanks to Paul Schlyter, who wrote the math and released it as
+public domain in 1992.</p>
+
+<p> Thanks to Dr. David M. MacMillan, who suggested some minor, but
+useful changes for the 20041208 version. </p>
+
+<p><a href="sunwait-20041208.tar.gz">sunwait-20041208.tar.gz</a></p>
+
+<pre>
+
+usage: sunwait [options] [sun|civ|naut|astr] [up|down] [+/-offset] [latitude] [longitude]
+
+latitude/longigude are expressed in floating-point degrees, with [NESW] appended
+
+example: sunwait sun up -0:15:10 38.794433N 77.069450W
+This example will wait until 15 minutes and 10 seconds before the sun rises in Alexandria, VA
+
+The offset is expressed as MM, or HH:MM, or HH:MM:SS,
+and indicates the additional amount of time to wait after 
+(or before, if negative) the specified event.
+
+options: -p prints a summary of relevant times
+         -z changes the printout to Universal Coordinated Time (UTC)
+         -V prints the version number
+         -v increases verbosity
+
+These options are useful mainly when used with the '-p' option
+         -y YYYY sets the year to calculate for
+         -m MM sets the month to calculate for
+         -d DD sets the day-of-month to calculate for
+
+         -h prints this help
+</pre>
+<p>
+<a href="/projects.html"> Projects page</a>, <a href="mailto:magnus at alum.mit.edu">Dan Risacher</a>
+
+<SCRIPT language="JavaScript"><!--
+        document.write("<p>File last updated " + document.lastModified);
+        // --></SCRIPT> 
+</p>
diff --git a/sources b/sources
index e69de29..e2ffd46 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+957dbcb6d16cb8f3b1ead0687397b495  sunwait-20041208.tar.gz
diff --git a/sunwait-string.patch b/sunwait-string.patch
new file mode 100644
index 0000000..14c07b7
--- /dev/null
+++ b/sunwait-string.patch
@@ -0,0 +1,11 @@
+diff -up sunwait-20041208/main.c.string sunwait-20041208/main.c
+--- sunwait-20041208/main.c.string	2015-03-01 16:33:09.812066357 -0700
++++ sunwait-20041208/main.c	2015-03-01 16:33:48.484287120 -0700
+@@ -3,6 +3,7 @@
+ /* Licensed under the Gnu General Public License */
+ #include <stdio.h>
+ #include <stdlib.h> 
++#include <string.h>
+ #include <math.h>
+ #include <time.h>
+ 
diff --git a/sunwait.spec b/sunwait.spec
new file mode 100644
index 0000000..9af7cdc
--- /dev/null
+++ b/sunwait.spec
@@ -0,0 +1,60 @@
+%global pkgdate 20041208
+
+Name:           sunwait
+Summary:        Calculate sunrise, sunset, twilight
+Version:        0.1
+Release:        0.3.%{pkgdate}%{?dist}
+License:        GPLv2+
+URL:            http://www.risacher.org/sunwait/
+Source0:        http://www.risacher.org/sunwait/sunwait-%{pkgdate}.tar.gz
+Source1:        http://www.risacher.org/sunwait/index.html
+
+# patch to include string.h header to avoid warning
+Patch0:         sunwait-string.patch
+
+# As of 20-DEC-2014, the source code for the new fork sunwait4windows
+# is not being provided in any archive format conducive for packaging,
+# so I'm using the author's 2004 release, which still works fine.
+# I'll contact Ian Craig, maintainer of the fork, about better source
+# release packaging.
+
+# Upstream notified of incorrect-fsf-address by email on 20-DEC-2014
+# Requested man page of upstream by email on 25-FEB-2015
+
+%description
+Sunwait is a small C program for calculating sunrise and sunset, as
+well as civil, nautical, and astronomical twilights. It has features
+that make it useful for home automation tasks.
+
+%prep
+%setup -q -n %{name}-%{pkgdate}
+%patch0 -p1 -b .string
+cp -p %{SOURCE1} sunwait.html
+
+%build
+make %{?_smp_mflags} CFLAGS="${RPM_OPT_FLAGS}"
+
+%install
+install -d -m 755 ${RPM_BUILD_ROOT}/%{_bindir}
+install -m 755 sunwait ${RPM_BUILD_ROOT}/%{_bindir}
+
+%files
+%license COPYING
+%doc sunwait.html
+%{_bindir}/sunwait
+
+%changelog
+* Sun Mar 01 2015 Eric Smith <brouhaha at fedoraproject.org> - 0.1-0.3.20041208
+- Made changes for review comments (#1045676 comment 10).
+
+* Thu Feb 26 2015 Eric Smith <brouhaha at fedoraproject.org> - 0.1-0.2.20041208
+- Made changes for review comments (#1045676 comment 8).
+
+* Wed Feb 25 2015 Eric Smith <brouhaha at fedoraproject.org> - 0.1-0.1.20041208
+- Made changes for review comments (#1045676 comment 4).
+
+* Sat Dec 21 2013 Eric Smith <spacewar at gmail.com> - 20041208-2
+- Added missing RPM_OPT_FLAGS.
+
+* Fri Dec 20 2013 Eric Smith <brouhaha at fedoraproject.org> - 20041208-1
+- Initial build.


More information about the scm-commits mailing list