[med-svn] r2280 - in trunk/packages/mencal/trunk/debian: . patches

tille at alioth.debian.org tille at alioth.debian.org
Mon Jul 21 21:42:37 UTC 2008


Author: tille
Date: 2008-07-21 21:42:37 +0000 (Mon, 21 Jul 2008)
New Revision: 2280

Added:
   trunk/packages/mencal/trunk/debian/README.Debian
   trunk/packages/mencal/trunk/debian/compat
   trunk/packages/mencal/trunk/debian/patches/
   trunk/packages/mencal/trunk/debian/patches/10_mencal.patch
   trunk/packages/mencal/trunk/debian/patches/series
Modified:
   trunk/packages/mencal/trunk/debian/changelog
   trunk/packages/mencal/trunk/debian/control
   trunk/packages/mencal/trunk/debian/rules
Log:
Make use of quilt to handle extensive patch, several other things regarding group maintenance


Added: trunk/packages/mencal/trunk/debian/README.Debian
===================================================================
--- trunk/packages/mencal/trunk/debian/README.Debian	                        (rev 0)
+++ trunk/packages/mencal/trunk/debian/README.Debian	2008-07-21 21:42:37 UTC (rev 2280)
@@ -0,0 +1,10 @@
+mencal for Debian
+-----------------
+
+It turned out that the author has not issued a new version since
+2003.  There is an extensive patch applied in the Debian package
+which was done by former maintainers.  If you think this program
+is useful and you would like to add some enhancements you should
+probably think about becoming upstream maintainer yourself.
+
+ -- Andreas Tille <tille at debian.org>  Mon, 21 Jul 2008 22:27:50 +0200

Modified: trunk/packages/mencal/trunk/debian/changelog
===================================================================
--- trunk/packages/mencal/trunk/debian/changelog	2008-07-21 20:22:28 UTC (rev 2279)
+++ trunk/packages/mencal/trunk/debian/changelog	2008-07-21 21:42:37 UTC (rev 2280)
@@ -1,3 +1,22 @@
+mencal (2.3-8) unstable; urgency=low
+
+  * New Maintainer Debian-Med Packaging Team
+    <debian-med-packaging at lists.alioth.debian.org>
+  * Group maintenance by Debian Med Team
+  * debian/control:
+    - DM-Upload-Allowed: yes
+    - Added myself to Uploaders
+    - Added Homepage
+    - Addef Vcs fields
+    - Removed version from debhelper
+    - New Build-Depends: quilt
+  * debian/rules:
+    - quilt to handle patch for executable
+    - DH_COMPAT=5   ->  debian/compat
+  * Standards-Version: 3.8.0 (no changes needed)
+
+ -- Andreas Tille <tille at debian.org>  Mon, 21 Jul 2008 22:27:50 +0200
+
 mencal (2.3-7) unstable; urgency=low
 
   * Upgraded to DH_COMPAT 5.

Added: trunk/packages/mencal/trunk/debian/compat
===================================================================
--- trunk/packages/mencal/trunk/debian/compat	                        (rev 0)
+++ trunk/packages/mencal/trunk/debian/compat	2008-07-21 21:42:37 UTC (rev 2280)
@@ -0,0 +1 @@
+5

Modified: trunk/packages/mencal/trunk/debian/control
===================================================================
--- trunk/packages/mencal/trunk/debian/control	2008-07-21 20:22:28 UTC (rev 2279)
+++ trunk/packages/mencal/trunk/debian/control	2008-07-21 21:42:37 UTC (rev 2280)
@@ -1,10 +1,15 @@
 Source: mencal
 Section: utils
 Priority: optional
-Maintainer: Amaya Rodrigo Sastre <amaya at debian.org>
-Build-Depends: debhelper (>= 5)
-Standards-Version: 3.7.2
-Uploaders: Matthew Wilcox <willy at debian.org>
+Maintainer: Debian-Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+DM-Upload-Allowed: yes
+Uploaders: Andreas Tille <tille at debian.org>,
+ Matthew Wilcox <willy at debian.org>
+Build-Depends: debhelper, quilt
+Standards-Version: 3.8.0
+Homepage: http://www.kyberdigi.cz/projects/mencal/english.html
+Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/mencal/trunk/?rev=0&sc=0
+Vcs-Svn: svn://svn.debian.org/svn/debian-med/trunk/packages/mencal/trunk/
 
 Package: mencal
 Architecture: all
@@ -18,4 +23,3 @@
  conveniently.
  .
  Author: C. McCohy <mccohy at kyberdigi.cz>
- Homepage: http://mencal.kyberdigi.cz/english.html

Added: trunk/packages/mencal/trunk/debian/patches/10_mencal.patch
===================================================================
--- trunk/packages/mencal/trunk/debian/patches/10_mencal.patch	                        (rev 0)
+++ trunk/packages/mencal/trunk/debian/patches/10_mencal.patch	2008-07-21 21:42:37 UTC (rev 2280)
@@ -0,0 +1,203 @@
+--- mencal-2.3.orig/mencal
++++ mencal-2.3/mencal
+@@ -100,22 +100,15 @@
+ 
+   sub new {
+     my $type=shift;
++    my @starts;
+     my $self={
+-      'start'     => shift || '',
++      'start'     => \@starts,
+       'length'    => shift || 28,
+       'duration'  => shift || 4,
+       'name'      => shift || 'Unknown',
+       'color'     => lc(shift) || 'red',
+       'days'      => ''
+     };
+-    if($self->{'start'}!~/^[0-9]{8}$/) {
+-      my @localtime=localtime();
+-      if($self->{'start'}=~/^[0-1][0-9][0-3][0-9]$/) {
+-        $self->{'start'}=($localtime[5]+1900).$self->{'start'};
+-      } else {
+-        $self->{'start'}=($localtime[5]+1900).sprintf("%02d", $localtime[4]+1).sprintf("%02d", $localtime[3]);
+-      }
+-    }
+     $self->{'color'}=~/^(nocolor|red|green|blue|yellow|violet|cyan|shiny|bold)$/ || ($self->{'color'}='red');
+     $self->{'length'}=~/^[0-9]+$/ || do { $self->{'length'}=28; };
+     $self->{'duration'}=~/^[0-9]+$/ || do { $self->{'duration'}=4; };
+@@ -127,10 +120,11 @@
+     my $self=shift;
+     (my $filename=shift) || return(0);
+     open(FILE, $filename) || return(0);
++    my $starts = $self->{'start'};
+     while(<FILE>) {
+       chomp;
+       (/^#/ || /^$/) && next;
+-      /^start ([0-9]{8})$/ && do { $self->{'start'}=$1; next; };
++      /^start ([0-9]{8})$/ && do { push @{$starts},$1; next; };
+       /^length ([0-9]+)$/ && do { $self->{'length'}=$1; next; };
+       /^duration ([0-9]+)$/ && do { $self->{'duration'}=$1; next; };
+       /^color (nocolor|red|green|blue|yellow|violet|cyan|shiny|bold)$/ && do { $self->{'color'}=$1; next; };
+@@ -147,13 +141,14 @@
+     my $self=shift;
+     (my $str=shift) || return(0);
+     my $filename='';
++    my $starts = $self->{'start'};
+     foreach(split(',', $str)) {
+       /^(s|start)=([0-9]{4})$/ && do {
+         my @localtime=localtime();
+-        $self->{'start'}=($localtime[5]+1900).$2;
++        push @{$starts},($localtime[5]+1900).$2;
+         next;
+       };
+-      /^(s|start)=([0-9]{8})$/ && do { $self->{'start'}=$2; next; };
++      /^(s|start)=([0-9]{8})$/ && do { push @{$starts},$2; next; };
+       /^(l|length)=([0-9]+)$/ && do { $self->{'length'}=$2; next; };
+       /^(d|duration)=([0-9]+)$/ && do { $self->{'duration'}=$2; next; };
+       /^(c|color)=(nocolor|red|green|blue|yellow|violet|cyan|shiny|bold)$/ && do { $self->{'color'}=$2; next; };
+@@ -165,7 +160,10 @@
+     ($self->{'duration'}>=$self->{'length'}) && do { $self->{'duration'}=$self->{'length'}; };
+     if($filename) {
+       if(open(RC, ">$filename")) {
+-        foreach my $key ('start', 'length', 'duration', 'color', 'name') {
++        foreach my $date (@{$starts}) {
++	  print RC 'start '.$date."\n";
++	}
++        foreach my $key ('length', 'duration', 'color', 'name') {
+           print RC $key.' '.$self->{$key}."\n";
+         }
+         close(RC);
+@@ -177,27 +175,76 @@
+     return(1);
+   }
+ 
++  sub date2sec {
++    my $date = shift;
++    $date =~ /^([0-9]{4})([0-9]{2})([0-9]{2})$/;
++    my ($sy, $sm, $sd) = ($1, $2, $3);
++    return mktime(0, 0, 0, $sd, ($sm-1), ($sy-1900));
++  }
++
++  sub markdays {
++    my ($self, $begin, $end, $date, $length) = (shift, shift, shift, shift, shift);
++    my $day = ($date - $begin) / (24 * 3600) + 1;
++    my $limit = $date + $length;
++    $limit = $end if ($end < $limit);
++    while ($date < $limit) {
++      $self->{'days'} .= $day.'#' if ($day > 0);
++      $day++;
++      $date += 24 * 3600;
++    }
++  }
++
++  sub getnext {
++    my $self = shift;
++    my $first = shift;
++    my $starts = $self->{'start'};
++    my $length = $self->{'length'} * 24 * 3600;
++    my $n_s = scalar @{$starts};
++    my $best;
++
++    if (($n_s > 0) && (date2sec($starts->[0]) <= $first) &&
++        ($first <= date2sec($starts->[($n_s - 1)]))) {
++      foreach (@{$starts}) {
++        $best = date2sec($_);
++        last if $best >= $first;
++      }
++      return $best;
++    }
++
++    if ($n_s == 0) {
++      $best = strftime "%Y%m%d", localtime;
++    } elsif ($first < date2sec($starts->[0])) {
++      $best = date2sec($starts->[0]);
++    } else {
++      $best = date2sec($starts->[$n_s - 1]);
++    }
++
++    while ($best > ($first + $length)) {
++      $best -= $length;
++    }
++
++    while ($best < $first) {
++      $best += $length;
++    }
++
++    return $best;
++  }
++
+   sub getdays {
+-    my $self=shift;
+-    my ($year, $month)=(shift, shift);
+-    $self->{'days'}='#';
+-    $self->{'start'}=~/^([0-9]{4})([0-9]{2})([0-9]{2})$/;
+-    my ($sy, $sm, $sd)=($1, $2, $3);
+-
+-    my $month_first=mktime(0, 0, 0, 1, ($month-1), ($year-1900));
+-    my $month_next=mktime(0, 0, 0, 1, $month, ($year-1900));
+-    my $actday=mktime(0, 0, 0, $sd, ($sm-1), ($sy-1900));
+-    while($actday>=$month_first) { $actday-=24*3600*$self->{'length'}; }
+-    while(($actday+24*3600*$self->{'length'})<$month_first) { $actday+=24*3600*$self->{'length'}; }
+-    $self->{'start'}=strftime("%Y%m%d", localtime($actday));
+-
+-    my ($i, $duration, $first, $onmonth)=(0, 0, 0, 0);
+-    while($actday<$month_next) {
+-      (!$onmonth) && ($actday>=$month_first) && do { $first=$i; $onmonth++; };
+-      ($duration<$self->{'duration'}) && ($actday>=$month_first) && ($self->{'days'}.=($i-$first+1).'#');
+-      $duration++; $i++;
+-      $actday+=24*3600;
+-      ($duration==$self->{'length'}) && ($duration=0);
++    my $self = shift;
++    my ($year, $month) = (shift, shift);
++    my $duration = $self->{'duration'} * 24 * 3600;
++    $self->{'days'} = '#';
++
++    my $month_first = mktime(0, 0, 0, 1, ($month-1), ($year-1900));
++    my $month_next = mktime(0, 0, 0, 1, $month, ($year-1900));
++    my $first_interesting = $month_first - $duration;
++
++    my $actday = $self->getnext($first_interesting);
++
++    while ($actday < $month_next) {
++      markdays($self, $month_first, $month_next, $actday, $duration);
++      $actday = $self->getnext($actday + $duration + 1);
+     }
+   }
+ 
+@@ -223,12 +270,19 @@
+     'topline'           => 'Su Mo Tu We Th Fr Sa',
+     'month_delimiter_h' => "   ",
+     'month_delimiter_v' => "\n",
+-    'nocolor'           => 0,
++    'nocolor'           => (not POSIX::isatty('STDOUT')),
+     'icolor'            => 'red',
+     'quiet'             => 0
+   );
+   my @confs=();
+ 
++  #There exists a config file
++  $_ = "$ENV{HOME}/.mencalrc";
++  if (-f $_ && -r $_) {
++    push(@confs,Conf->new());
++    $confs[$#confs]->parsefile($_);
++  }
++
+   for(my $i=0; $i<=$#ARGV; $i++) {
+     foreach($ARGV[$i]) {
+       /^(-h|--help)$/ && &Main::usage;
+@@ -241,6 +295,7 @@
+       };
+       /^(-q|--quiet)$/ && do { $config{'quiet'}=1; last; };
+       /^(-m|--monday)$/ && do { $config{'monday_first'}=1; last; };
++      /^(-C|--color)$/ && do { $config{'nocolor'}=0; last; };
+       /^(-n|--nocolor)$/ && do { $config{'nocolor'}=1; last; };
+       /^(-i|--icolor)$/ && do {
+         (($#ARGV>$i) && ($ARGV[++$i]=~/^(red|green|blue|yellow|violet|cyan|shiny|bold)$/)) || &Main::out("Invalid intersection color, see '-h' for more details");
+@@ -362,6 +417,7 @@
+       "  -3                  previous, current and next month\n".
+       "  -y [YYYY]           all-year calendar (default YYYY is current year)\n".
+       "  -q, --quiet         no top information will be printed\n".
++      "  -C, --color         colored output (default)\n".
+       "  -n, --nocolor       noncolored output\n".
+       "  -i, --icolor COLOR  intersection color (default red)\n".
+       "    available colors: red, green, blue, yellow, violet, cyan, shiny, bold\n".

Added: trunk/packages/mencal/trunk/debian/patches/series
===================================================================
--- trunk/packages/mencal/trunk/debian/patches/series	                        (rev 0)
+++ trunk/packages/mencal/trunk/debian/patches/series	2008-07-21 21:42:37 UTC (rev 2280)
@@ -0,0 +1 @@
+10_mencal.patch

Modified: trunk/packages/mencal/trunk/debian/rules
===================================================================
--- trunk/packages/mencal/trunk/debian/rules	2008-07-21 20:22:28 UTC (rev 2279)
+++ trunk/packages/mencal/trunk/debian/rules	2008-07-21 21:42:37 UTC (rev 2280)
@@ -5,15 +5,15 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=5
+include /usr/share/quilt/quilt.make
 
 DESTDIR=$(CURDIR)/debian/mencal
 
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
-clean:
+
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	dh_clean
@@ -46,7 +46,7 @@
 	dh_builddeb
 
 # mencal is a simple perl script, it needs no building.
-build: build-arch build-indep
+build: patch build-arch build-indep
 build-arch:
 build-indep:
 




More information about the debian-med-commit mailing list