the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: sunwait
Version: 20041208
Revision: 2
Description: Calculates sunrise, sunset, and twilights
License: GPL
Maintainer: Jason Park
Source: http://www.risacher.org/sunwait/%n-%v.tar.gz
Source-MD5: 957dbcb6d16cb8f3b1ead0687397b495
BuildDepends: fink (>= 0.24.12-1)
PatchFile: %n.patch
PatchFile-MD5: fb35cd9db597be41777d5d9c6f871b8a
SetCPPFLAGS: -Wall
CompileScript: <<
make
<<
InstallScript: <<
install -d -m 755 %i/bin
install -c -m 755 %n %i/bin
<<
DocFiles: COPYING
Homepage: http://www.risacher.org/sunwait/
DescDetail: <<
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. 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.
For example, consider this line from my crontab:
01 00 * * * sunwait civ start 38.794433N, 77.069450W ; br b6 off
This line executes at one minute after midnight, waits until the start of
civil twilight, then runs the command br b6 off (which turns off my carriage
light).
<<
DescUsage: <<
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
<<
diff -Nurd -x'*~' sunwait-20041208.orig/main.c sunwait-20041208/main.c
--- sunwait-20041208.orig/main.c 2004-12-08 20:48:49.000000000 -0500
+++ sunwait-20041208/main.c 2008-08-16 12:56:58.000000000 -0400
@@ -5,6 +5,8 @@
#include
#include
#include
+#include
+#include
#include "sunriset.h"
@@ -50,7 +52,7 @@
{ NULL, 0, 0 }
};
-print_usage()
+void print_usage()
{
FILE* f = stdout;
fprintf(f, "usage: sunwait [options] [sun|civ|naut|astr] [up|down] [+/-offset] [latitude] [longitude]\n\n");
diff -Nurd -x'*~' sunwait-20041208.orig/print.c sunwait-20041208/print.c
--- sunwait-20041208.orig/print.c 2002-09-04 10:38:32.000000000 -0400
+++ sunwait-20041208/print.c 2008-08-16 13:29:17.000000000 -0400
@@ -67,7 +67,7 @@
if (local)
printf( "Local time: %2d:%2.2d \n", tm->tm_hour, tm->tm_min);
else
- printf( "Zulu time (UTC): %2d:%2.2d %s\n",
+ printf( "Zulu time (UTC): %2ld:%2.2d %s\n",
TMOD(tm->tm_hour - (timezone_offset/3600)),
tm->tm_min,
DAYSOFF(tm->tm_hour - (timezone_offset/3600)));
@@ -92,10 +92,10 @@
astr = astronomical_twilight( year, month, day, lon, lat,
&astr_start, &astr_end );
- printf( "Current specified time zone: %s (%d from UTC) \n", timezone_name, +timezone_offset/3600 );
+ printf( "Current specified time zone: %s (%ld from UTC) \n", timezone_name, +timezone_offset/3600 );
if (local)
- printf( "Sun transits meridian %2.2d%2.2d %s\n",
+ printf( "Sun transits meridian %2.2ld%2.2d %s\n",
TMOD(HOURS((rise+set)/2.0) + timezone_offset/3600),
MINUTES((rise+set)/2.0),
timezone_name);
diff -Nurd -x'*~' sunwait-20041208.orig/sunriset.h sunwait-20041208/sunriset.h
--- sunwait-20041208.orig/sunriset.h 2004-01-24 05:08:58.000000000 -0500
+++ sunwait-20041208/sunriset.h 2008-08-16 13:00:38.000000000 -0400
@@ -113,3 +113,6 @@
double GMST0( double d );
+int print_everything(int year, int month, int day,
+ double lat, double lon,
+ struct tm* tm, char local);