Hello community,

here is the log from the commit of package cpanspec for openSUSE:Factory
checked in at Wed Apr 6 09:39:08 CEST 2011.



--------
--- cpanspec/cpanspec.changes   2011-02-20 02:02:20.000000000 +0100
+++ /mounts/work_src_done/STABLE/cpanspec/cpanspec.changes      2011-04-05 
13:25:58.000000000 +0200
@@ -1,0 +2,16 @@
+Tue Apr  5 11:25:44 UTC 2011 - [email protected]
+
+- also read out recommends
+
+-------------------------------------------------------------------
+Tue Apr  5 08:30:32 UTC 2011 - [email protected]
+
+- %defattr is needed even without doc
+
+-------------------------------------------------------------------
+Fri Apr  1 09:42:27 UTC 2011 - [email protected]
+
+- limit %description to the preamble of head1 - before the first
+  head2
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cpanspec.spec ++++++
--- /var/tmp/diff_new_pack.wABeWq/_old  2011-04-06 09:35:30.000000000 +0200
+++ /var/tmp/diff_new_pack.wABeWq/_new  2011-04-06 09:35:30.000000000 +0200
@@ -20,7 +20,7 @@
 
 Name:           cpanspec
 Version:        1.78
-Release:        19
+Release:        21
 %define tar_version 1.78
 Summary:        Generate a SUSE spec file for a CPAN module
 License:        GPL+ or Artistic

++++++ cpanspec.patch ++++++
--- /var/tmp/diff_new_pack.wABeWq/_old  2011-04-06 09:35:30.000000000 +0200
+++ /var/tmp/diff_new_pack.wABeWq/_new  2011-04-06 09:35:30.000000000 +0200
@@ -1,6 +1,7 @@
-diff -ruN cpanspec-1.78-orig/cpanspec cpanspec-1.78/cpanspec
---- cpanspec-1.78-orig/cpanspec        2009-01-16 21:35:55.000000000 +0100
-+++ cpanspec-1.78/cpanspec     2011-02-20 01:55:34.000000000 +0100
+Index: cpanspec-1.78/cpanspec
+===================================================================
+--- cpanspec-1.78.orig/cpanspec        2009-01-16 21:35:55.000000000 +0100
++++ cpanspec-1.78/cpanspec     2011-04-05 13:25:33.788388329 +0200
 @@ -12,9 +12,6 @@
  #
  # $Id: cpanspec,v 1.67 2009/01/16 20:35:17 stevenpritchard Exp $
@@ -11,7 +12,7 @@
  =head1 NAME
  
  cpanspec - Generate a spec file for a CPAN module
-@@ -191,6 +188,9 @@
+@@ -191,6 +188,9 @@ L<perl(1)>, L<cpan2rpm(1)>, L<cpanflute2
  use strict;
  use warnings;
  
@@ -21,7 +22,7 @@
  use FileHandle;
  use Archive::Tar;
  use Archive::Zip qw(:ERROR_CODES);
-@@ -199,11 +199,12 @@
+@@ -199,11 +199,12 @@ use locale;
  use Text::Autoformat;
  use YAML qw(Load);
  use Getopt::Long;
@@ -35,7 +36,7 @@
  # Apparently gets pulled in by another module.
  #use Cwd;
  
-@@ -222,8 +223,7 @@
+@@ -222,8 +223,7 @@ our $buildsrpm=0;
  our $buildrpm=0;
  our $verbose=0;
  our $follow=0;
@@ -45,7 +46,7 @@
  our $cpan=$ENV{'CPAN'} || "http://www.cpan.org";;
  
  our $home=$ENV{'HOME'} || (getpwuid($<))[7];
-@@ -241,6 +241,8 @@
+@@ -241,6 +241,8 @@ our @add_requires;
  our @add_provides;
  our @add_buildrequires;
  
@@ -54,7 +55,7 @@
  # env. vars and their macro analogues
  my @MACROS = (
  
-@@ -252,7 +254,7 @@
+@@ -252,7 +254,7 @@ my @MACROS = (
  
      # 1 is for the macros.
      {
@@ -63,7 +64,7 @@
          'buildroot' => '%{buildroot}',
      },
  );
-@@ -338,6 +340,62 @@
+@@ -338,6 +340,62 @@ sub update_packages() {
      $updated=1;
  }
  
@@ -126,7 +127,7 @@
  sub build_rpm($) {
      my $spec=shift;
      my $dir=getcwd();
-@@ -387,10 +445,10 @@
+@@ -387,10 +445,10 @@ sub extract($$$) {
      }
  }
  
@@ -139,7 +140,7 @@
  
      my $path=$args{module};
      $path=~s,::,/,g;
-@@ -415,60 +473,95 @@
+@@ -415,60 +473,97 @@ sub get_description(%) {
          last if $pm;
      }
  
@@ -180,7 +181,6 @@
 -            warn "Failed to read $pm from $args{filename}"
 -                . ($args{type} eq 'tar'
 -                    ? (": " . $args{archive}->error()) : "") . "\n";
--        }
 +sub get_description($) {
 +    my $cont = shift;
 +    my $parser = Pod::POM->new;
@@ -188,16 +188,18 @@
 +    # extract pod; the file may contain no pod, that's ok
 +    my $pom = $parser->parse_text($cont);
 +
++
 +    HEAD1:
 +    foreach my $head1 ($pom->head1) {
 +
 +        next HEAD1 unless $head1->title eq 'DESCRIPTION';
 +
-+        my $pom = $head1->content;
-+        $description = $pom->present('Pod::POM::View::Text');
++        $description = '';
++        foreach my $item ($head1->content()) {
++           last if ($item->type() eq 'head2');
++           $description .= $item->present('Pod::POM::View::Text');
+         }
 +
-+        # limit to 3 paragraphs at the moment
-+        #my @paragraphs = (split /\n\n/, $description)[0..2];
 +        # no limit
 +        my @paragraphs = (split /\n\n/, $description);
 +
@@ -250,8 +252,7 @@
      }
 +    return $summary="$mod Perl module";
 +}
- 
--    return(undef, undef);
++
 +sub get_author($) {
 +    my $cont = shift;
 +    my @lines=();
@@ -276,7 +277,8 @@
 +        }
 +  
 +        $author = join "\n", @lines; 
-+
+ 
+-    return(undef, undef);
 +        # return...
 +        return $author;
 +    }
@@ -284,7 +286,7 @@
  }
  
  sub check_rpm($) {
-@@ -554,13 +647,6 @@
+@@ -554,13 +649,6 @@ my $prefix=$noprefix ? "" : "perl-";
  
  $packager=$packager || `rpm --eval '\%packager'`;
  
@@ -298,7 +300,7 @@
  our %corelist;
  
  my $rpm=new FileHandle "rpm -q --provides perl|"
-@@ -577,67 +663,49 @@
+@@ -577,67 +665,49 @@ while (my $provides=<$rpm>) {
  my @args=@ARGV;
  my @processed=();
  
@@ -384,7 +386,7 @@
  
              if ($@) {
                  warn "Failed to load IO::Uncompress::Bunzip2: $@\n";
-@@ -650,12 +718,14 @@
+@@ -650,12 +720,14 @@ for my $file (@args) {
                  warn "IO::Uncompress::Bunzip2->new() failed on $file: $!\n";
                  next;
              }
@@ -399,7 +401,7 @@
      }
  
      my @files;
-@@ -684,12 +754,9 @@
+@@ -684,12 +756,9 @@ for my $file (@args) {
  
      my $url="http://search.cpan.org/dist/$name/";;
  
@@ -414,7 +416,7 @@
              archive     => $archive,
              type        => $type,
              filename    => $file,
-@@ -700,18 +767,13 @@
+@@ -700,18 +769,13 @@ for my $file (@args) {
              path        => $path,
          );
  
@@ -429,17 +431,17 @@
 -        $description="$module Perl module";
 -    }
 +    get_description($content) if(!defined($description));
-+
+ 
+-    $summary="$module Perl module" if (!defined($summary));
 +    get_summary($content,$module) if (!defined($summary));
 +    
 +    get_author($content) if (!defined($author));
- 
--    $summary="$module Perl module" if (!defined($summary));
++
 +    my $authors="Authors:\n--------\n$author";
  
      my @doc=sort { $a cmp $b } grep {
                  !/\//
-@@ -722,17 +784,22 @@
+@@ -722,17 +786,22 @@ for my $file (@args) {
              and $_ ne "MANIFEST.SKIP"
              and $_ ne "INSTALL"
              and $_ ne "SIGNATURE"
@@ -462,7 +464,24 @@
              and $_ ne "pm_to_blib"
              and $_ ne "install.sh"
              } @files;
-@@ -947,45 +1014,63 @@
+@@ -809,7 +878,7 @@ for my $file (@args) {
+     my $license="";
+ 
+     my $scripts=0;
+-    my (%build_requires,%requires);
++    my (%build_requires,%requires,%recommends);
+     my ($yml,$meta);
+     if (grep /^META\.yml$/, @files
+         and $yml=extract($archive, $type, "$path/META.yml")) {
+@@ -823,6 +892,7 @@ for my $file (@args) {
+ 
+         %build_requires=%{$meta->{build_requires}} if 
($meta->{build_requires});
+         %requires=%{$meta->{requires}} if ($meta->{requires});
++        %recommends=%{$meta->{recommends}} if ($meta->{recommends});
+         if ($meta->{recommends}) {
+             for my $dep (keys(%{$meta->{recommends}})) {
+                 $requires{$dep}=$requires{$dep}
+@@ -947,45 +1017,63 @@ for my $file (@args) {
      }
  
      print $spec <<END;
@@ -533,8 +552,8 @@
          $build_requires{$dep}=$build_requires{$dep} || $requires{$dep};
      }
  
-+
      for my $dep (sort(keys(%build_requires))) {
++        next if ($dep eq 'perl');
          if (exists($corelist{$dep})) {
              next if (!$compat);
          } elsif ($follow) {
@@ -543,7 +562,7 @@
                  if (check_dep($dep)) {
                      verbose("$dep is available, skipping.");
                  } else {
-@@ -1000,11 +1085,12 @@
+@@ -1000,11 +1088,12 @@ END
          print $spec "\n";
      }
  
@@ -558,7 +577,7 @@
          next if (!$compat and exists($corelist{$dep}));
          printf $spec "%-16s%s", "Requires:", "perl($dep)";
          print $spec (" >= " . $requires{$dep}) if ($requires{$dep});
-@@ -1015,11 +1101,6 @@
+@@ -1015,15 +1104,19 @@ END
          printf $spec "%-16s%s\n", "Requires:", $dep;
      }
  
@@ -570,7 +589,20 @@
  
      for my $prov (@add_provides) {
          printf $spec "%-16s%s\n", "Provides:", $prov;
-@@ -1043,7 +1124,10 @@
+     }
++    for my $dep (sort(keys(%recommends))) {
++        next if ($dep eq 'perl');
++        next if (!$compat and exists($corelist{$dep}));
++        printf $spec "%-16s%s", "Recommends:", "perl($dep)";
++        print $spec (" >= " . $requires{$dep}) if ($requires{$dep});
++        print $spec "\n";
++    }
++
++ 
+ 
+     if (@filter_requires) {
+         print $spec <<END
+@@ -1043,7 +1136,10 @@ Source99:       $name-filter-provides.sh
  END
      }
  
@@ -581,7 +613,7 @@
      $buildpath=~s/$version/\%{version}/;
      print $spec <<END;
  
-@@ -1085,7 +1169,8 @@
+@@ -1085,7 +1181,8 @@ END
      if ($usebuildpl) {
          print $spec <<END;
  \%{__perl} Build.PL installdirs=vendor@{[$noarch ? '' : qq{ 
optimize="$macro{optimize}"} ]}
@@ -591,35 +623,35 @@
  END
      } else {
          print $spec <<END;
-@@ -1097,15 +1182,24 @@
+@@ -1097,15 +1194,24 @@ END
              if ($compat and !$noarch);
  
          print $spec <<END;
 -make \%{?_smp_mflags}
 +\%{__make} \%{?_smp_mflags}
 +
-+END
-+    }
-+
-+    print $spec <<END;
-+\%check@{[($compat ? ' || :' : '')]}
  END
+     }
+ 
+     print $spec <<END;
++\%check@{[($compat ? ' || :' : '')]}
++END
 +    if ($usebuildpl) {
 +        print $spec "./Build test\n";
 +    } else {
 +        print $spec "\%{__make} test\n";
-     }
- 
-+
-     print $spec <<END;
++    }
  
- \%install
+-\%install
 -rm -rf $macro{buildroot}
--
+ 
++    print $spec <<END;
++
++\%install
  END
  
      if ($usebuildpl) {
-@@ -1113,24 +1207,12 @@
+@@ -1113,24 +1219,12 @@ END
              "./Build install destdir=$macro{buildroot} create_packlist=0\n";
      } else {
          print $spec <<END;
@@ -648,7 +680,7 @@
  
      if ($addlicense and !grep /copying|artistic|copyright|license/i, @doc) {
          print $spec <<END;
-@@ -1143,43 +1225,27 @@
+@@ -1143,43 +1237,28 @@ END
      }
  
      print $spec <<END;
@@ -673,8 +705,9 @@
 -\%doc @doc
 +\%files -f \%{name}.files
  END
++    print $spec "\%defattr(644,root,root,755)\n";
++
 +    if (@doc) {
-+       print $spec "\%defattr(644,root,root,755)\n";
 +       print $spec "%doc @doc\n";
 +    }
  
@@ -698,15 +731,20 @@
  END
  
      $spec->close();
-@@ -1187,6 +1253,11 @@
+@@ -1187,6 +1266,16 @@ END
      build_rpm($specfile) if ($buildsrpm or $buildrpm);
  
      push(@processed, $module);
 +
 +    (my $basename = $specfile) =~ s{\.spec$}{};
-+    verbose "Writing $basename.changes";
-+    system("osc vc -m 'initial package $version
-+  * created by $NAME $VERSION' $basename");
++    if (-f "$basename.changes") {
++      verbose "Updating $basename.changes";
++      system("osc vc -m 'updated to $version'");
++    } else {
++      verbose "Writing $basename.changes";
++      system("osc vc -m 'initial package $version
++    * created by $NAME $VERSION' $basename");
++    }
  }
  
  # vi: set ai et:


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to