debian/0000755000000000000000000000000011351463127007171 5ustar debian/control0000644000000000000000000000144211351461276010600 0ustar Source: libdatetime-astro-sunrise-perl Section: perl Priority: optional Build-Depends: debhelper (>= 7) Build-Depends-Indep: perl, libdatetime-perl Maintainer: Debian Perl Group Uploaders: gregor herrmann Standards-Version: 3.8.4 Homepage: http://search.cpan.org/dist/DateTime-Astro-Sunrise/ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libdatetime-astro-sunrise-perl/ Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libdatetime-astro-sunrise-perl/ Package: libdatetime-astro-sunrise-perl Architecture: all Depends: ${perl:Depends}, ${misc:Depends}, libdatetime-perl Description: module for computing the time of sunrise and sunset DateTime::Astro::Sunrise returns DateTime objects for sunrise and sunset for a given day. debian/copyright0000644000000000000000000000324511351461044011124 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Maintainer: Ron Hill Source: http://search.cpan.org/dist/DateTime-Astro-Sunrise/ Name: DateTime-Astro-Sunrise Files: * Copyright: Paul Schlyter, 1989, 1992 License: PD Released to the public domain by Paul Schlyter, December 1992 . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Files: debian/* Copyright: 2007, Joey Hess 2007-2010, gregor herrmann License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian GNU/Linux systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic' License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL' debian/watch0000644000000000000000000000024711351455346010231 0ustar version=3 opts="uversionmangle=s/_/./" \ http://search.cpan.org/dist/DateTime-Astro-Sunrise/ .*/DateTime-Astro-Sunrise-v?(\d[\d._-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ debian/patches/0000755000000000000000000000000011351463046010620 5ustar debian/patches/sunrise-march.patch0000644000000000000000000000335411351456361014430 0ustar Autor: Jean Forget Reviewed-By: gregor herrmann Bug: https://rt.cpan.org/Public/Bug/Display.html?id=34770 Bugs-Debian: #574749 Origin: https://rt.cpan.org/Public/Bug/Display.html?id=34770 Description: sunset times around 21st March --- a/Sunrise.pm +++ b/Sunrise.pm @@ -153,12 +153,19 @@ sub sun_rise_set { my ( $d, $lon, $lat, $altit, $h ) = @_; + # Compute local sidereal time of this moment my $sidtime = revolution( GMST0($d) + 180.0 + $lon ); - my ( $sRA, $sdec ) = sun_RA_dec($d); + # Compute Sun's RA + Decl + distance at this moment + my ( $sRA, $sdec, $sr ) = sun_RA_dec($d); + + # Compute time when Sun is at south - in hours UT my $tsouth = 12.0 - rev180( $sidtime - $sRA ) /$h ; - my $sradius = 0.2666 / $sRA; + # Compute the Sun's apparent radius, degrees + my $sradius = 0.2666 / $sr; + + # Do correction to upper limb, if necessary if ($upper_limb) { $altit -= $sradius; } @@ -300,7 +307,7 @@ sub sun_RA_dec { # # _RETURN # - # Sun's Right Ascension (RA) and Declination (dec) + # Sun's Right Ascension (RA), Declination (dec) and distance (r) # # my ($d) = @_; @@ -323,7 +330,7 @@ sub sun_RA_dec { my $RA = atan2d( $y, $x ); my $dec = atan2d( $z, sqrt( $x * $x + $y * $y ) ); - return ( $RA, $dec ); + return ( $RA, $dec, $r ); } # sun_RA_dec --- a/t/01basic.t +++ b/t/01basic.t @@ -16,6 +16,6 @@ $tmp_rise->set_time_zone( 'America/Los_A $tmp_set->set_time_zone('America/Los_Angeles' ); # test 1 -ok ($tmp_rise->hms eq '05:43:00'); +ok ($tmp_rise->hms eq '05:42:00'); # test 2 -ok ($tmp_set->hms eq '20:03:00'); +ok ($tmp_set->hms eq '20:05:00'); debian/patches/posix.patch0000644000000000000000000000057011351460116013000 0ustar Author: Joey Hess Description: Fix redefinition warnings under use strict that were caused by POSIX and Math::Trig defining some of the same functions. --- a/Sunrise.pm +++ b/Sunrise.pm @@ -2,7 +2,7 @@ package DateTime::Astro::Sunrise; use strict; require Exporter; -use POSIX; +use POSIX qw(floor); use Math::Trig; use Carp; use DateTime; debian/patches/pod.patch0000644000000000000000000000257711351462222012431 0ustar Author: Joey Hess Description: Fixed missing whitespace in pod doc that caused the man page to be broken in several ways. Author: gregor herrmann Description: some =over and =back fixes --- a/Sunrise.pm +++ b/Sunrise.pm @@ -477,11 +477,13 @@ sub convert_hour { return ( $hour_rise, $min_rise, $hour_set, $min_set ); } + =head1 NAME DateTime::Astro::Sunrise - Perl DateTime extension for computing the sunrise/sunset on a given day =head1 SYNOPSIS + use DateTime; use DateTime::Astro::Sunrise; @@ -506,6 +508,7 @@ This module will return a DateTime Objec =item Bnew(longitutide,latatude,ALT,Iteration);> =over + Eastern longitude is entered as a positive number Western longitude is entered as a negative number Northern latitude is entered as a positive number @@ -581,6 +584,10 @@ c) Iterate b) until the computed sunrise =back +=back + +=back + =head1 ($sunrise, $sunset) = $sunrise->($dt); @@ -598,6 +605,8 @@ rkhill@firstlight.net =head1 CREDITS +=over + =item Paul Schlyer, Stockholm, Sweden for his excellent web page on the subject. @@ -606,6 +615,8 @@ for his excellent web page on the subjec for suggestions +=back + =head1 COPYRIGHT and LICENSE Here is the copyright information provided by Paul Schlyer: debian/patches/series0000644000000000000000000000010311351463014012022 0ustar normalise_24_hours.patch pod.patch posix.patch sunrise-march.patch debian/patches/normalise_24_hours.patch0000644000000000000000000000276111351460014015355 0ustar Description: Fix it not to pass hour values out of range to DateTime->new. It seemed to rely on DateTime normalising them to the 0-23 range, but DateTime now crashes instead. Take the hour value mod 24 to avoid this, and the test suite passes now. Author: Joey Hess --- a/Sunrise.pm +++ b/Sunrise.pm @@ -105,7 +105,7 @@ sub sunrise { year => $dt->year, month => $dt->month, day => $dt->day, - hour => $hour_rise, + hour => $hour_rise % 24, minute => $min_rise, time_zone => 'UTC' ); @@ -113,7 +113,7 @@ sub sunrise { year => $dt->year, month => $dt->month, day => $dt->day, - hour => $hour_set, + hour => $hour_set % 24, minute => $min_set, time_zone => 'UTC' ); @@ -132,7 +132,7 @@ sub sunrise { year => $dt->year, month => $dt->month, day => $dt->day, - hour => $hour_rise, + hour => $hour_rise % 24, minute => $min_rise, time_zone => 'UTC' ); @@ -140,7 +140,7 @@ sub sunrise { year => $dt->year, month => $dt->month, day => $dt->day, - hour => $hour_set, + hour => $hour_set % 24, minute => $min_set, time_zone => 'UTC' ); debian/compat0000644000000000000000000000000211351460345010366 0ustar 7 debian/changelog0000644000000000000000000000431511351463033011042 0ustar libdatetime-astro-sunrise-perl (0.01.01-3) unstable; urgency=low [ gregor herrmann ] * Use dist-based URL in debian/watch. [ Damyan Ivanov ] * Remove leftover debug. Closes: #485299 -- debugging cruft on stderr [ gregor herrmann ] * debian/control: Changed: Switched Vcs-Browser field to ViewSVN (source stanza). * New patch sunrise-march.patch to fix sunset times around first day of spring; thanks to Joey Hess for the bug report and to pointer to the patch (closes: #574749). * Split out changes to upstream code into patches. * Convert to debhelper 7. * Don't install README anymore. * Convert to source format 3.0 (quilt). * Convert debian/copyright to DEP5 format. * Set Standards-Version to 3.8.4; drop version from perl build dependency. * Add /me to Uploaders. * Update short and long description. -- gregor herrmann Sun, 21 Mar 2010 19:31:53 +0100 libdatetime-astro-sunrise-perl (0.01.01-2) unstable; urgency=low * Add redundant information to copyright file about where it was downloaded from. Thought we kept this in the Homepage field or watch file these days. -- Joey Hess Mon, 12 Nov 2007 12:02:10 -0500 libdatetime-astro-sunrise-perl (0.01.01-1) unstable; urgency=low * Initial upload to Debian. (Note: There are several similar modules in CPAN. I chose to package this one because it returns a simple DateTime object. Astro::Sunrise returns a hard to manipulate time string, and the newer DateTime::Event::Sunrise returns a DateTime::Set that is not compatible with the current 0.25 release of DateTime::Set.) * Upstream version number munge 0.01_01 -> 0.01.01. * Fixed missing whitespace in pod doc that caused the man page to be broken in several ways. * Fix it not to pass hour values out of range to DateTime->new. It seemed to rely on DateTime normalising them to the 0-23 range, but DateTime now crashes instead. Take the hour value mod 24 to avoid this, and the test suite passes now. * Fix redefinition warnings under use strict that were caused by POSIX and Math::Trig defining some of the same functions. -- Joey Hess Mon, 12 Nov 2007 12:02:07 -0500 debian/source/0000755000000000000000000000000011351463046010471 5ustar debian/source/format0000644000000000000000000000001411351463126011676 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000003511351460265010247 0ustar #!/usr/bin/make -f %: dh $@