#
# spec file for package cpanspec
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           cpanspec
Version:        1.78.08
Release:        93.14
%define cpan_name cpanspec
Summary:        Generate a SUSE spec file for a CPAN module
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Languages/Perl
Url:            http://sourceforge.net/projects/cpanspec/
Source0:        cpanspec-%{version}.tar.gz
Source99:       updaterpm.sh
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Archive::Tar)
BuildRequires:  perl(Archive::Zip)
BuildRequires:  perl(IO::Uncompress::Bunzip2)
BuildRequires:  perl(LWP::UserAgent)
BuildRequires:  perl(Parse::CPAN::Packages)
BuildRequires:  perl(Perl::PrereqScanner)
BuildRequires:  perl(Pod::Simple::TextContent)
BuildRequires:  perl(Text::Autoformat)
BuildRequires:  perl(YAML)
Requires:       perl(Algorithm::Diff)
Requires:       perl(Archive::Tar)
Requires:       perl(Archive::Zip)
Requires:       perl(Class::Accessor::Chained)
Recommends:     perl(IO::Uncompress::Bunzip2)
Requires:       perl(LWP::UserAgent)
Requires:       perl(Parse::CPAN::Packages)
Requires:       perl(Perl::PrereqScanner)
Requires:       perl(Pod::POM)
Requires:       perl(Pod::Simple::TextContent)
Requires:       perl(Text::Autoformat)
Requires:       perl(Text::Capitalize)
Requires:       perl(YAML)
%{perl_requires}

%description
*cpanspec* will generate a spec file to build a rpm from a CPAN-style Perl
module distribution.

%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist

%files -f %{name}.files
%defattr(-,root,root,755)
%doc Artistic BUGS Changes COPYING TODO

%changelog
* Thu Jan  7 2016 mimi.vx@gmail.com
- add Algorithm::Diff to requires -- fix boo#961069
* Fri Aug 28 2015 bwiedemann@suse.com
- Require perl(Text::Capitalize)
* Fri Aug 28 2015 bwiedemann@suse.com
- fix updaterpm.sh - git log requires history to be cloned
- Dominique Leuenberger (1):
    DateTime::Locale needs to have the version number corrected
  Stephan Kulow (21):
    nicer changes file
    shuffle instead
    remove final . in summary
    ignore spec files - most likely wrong
    only submit succeeding packages
    create more packages in one go
    support a config file
    grab OVERVIEW if DESCRIPTION is empty
    support sources too
    make noarch configurable
    two more fixes needed
    also have docs as docs
    expand module::build version
    compare parsed versions
    run perltidy -l=0 -fbl -nsfs -baao -bbao -pt=2 -bt=2 -sbt=2 -sct
    random fixes
    ignore requires
    avoid overwriting good versions
    random fixes to update
    check the distribution not a module
    fix quoting of changelog
* Tue May 27 2014 coolo@suse.com
- remove cpanspec-1.78.06-spdx.patch - upstreamed
* Tue May 27 2014 coolo@suse.com
- Stephan Kulow (2):
    apply spdx.patch applied for a year in OBS
    bump version
* Tue May 27 2014 coolo@suse.com
- Stephan Kulow (2):
    no longer print possible build requires
    avoid useless newlines
* Thu Aug  1 2013 coolo@suse.com
- Stephan Kulow (4):
    bump version
    avoid empty description
    don't reset Module::Build
    support Module::Build::Tiny
* Mon Dec  5 2011 vcizek@suse.com
- fixed cpanspec to suggest "GPL-1.0+ or Artistic-1.0" if no
  licence is found
* Fri Dec  2 2011 coolo@suse.com
- Stephan Kulow (1):
    adopt license
* Fri Dec  2 2011 idoenmez@suse.de
- Add requires on Class::Accessor::Chained and Pod::POM
* Mon Sep 26 2011 coolo@suse.com
- Stephan Kulow (3):
    ignore duplicates
    run prepare_spec
    new version
* Mon Sep 19 2011 coolo@suse.com
- Stephan Kulow (1):
    only add scanned deps as comment
* Sat Sep 17 2011 jengelh@medozas.de
- Remove redundant tags/sections from specfile
* Tue Aug  2 2011 coolo@novell.com
- Stephan Kulow (1):
    one more way to parse the requires (may produce false positives)
* Tue May 31 2011 coolo@novell.com
- Stephan Kulow (1):
    convert to Makefile.PL
* Fri May 27 2011 coolo@novell.com
- remove buildrequire now that we have a copy
* Tue May 24 2011 coolo@novell.com
- Christian (1):
    fix File:Path remove_tree -> rmtree
  Stephan Kulow (2):
    add copy from Module::Depends to fix some bugs
    trying to make it harder for modules to run amok
* Fri Apr 29 2011 coolo@opensuse.org
- Stephan Kulow (6):
    do not write out module dependencies that are in core since 5.8.8 (10.1
    add verbose debug message for previous commit
    extract the archive for real - preparation for bigger moves
    less debug
    check for executable files and avoid them
    use an external module for testing Build.pl
* Fri Apr 22 2011 coolo@opensuse.org
- Stephan Kulow (12):
    fix non-standard source
    add more requires
    fix owner of documentation files
    %%attr only has 3 args
    take out the 644 - it also applies to directories on < 11.3
    add default summary
    make the documentation unique
    avoid errors
    avoid crashes while reading POM
    allow to skip changes file
    ignore .bak files
    fix doc match
* Sun Apr 10 2011 coolo@opensuse.org
- use one Source line if not recompressed and
  fix multi *.gz support
* Sat Apr  9 2011 coolo@novell.com
- don't fetch details if not already done
* Fri Apr  8 2011 coolo@novell.com
- more cases of license "under same terms"
* Fri Apr  8 2011 coolo@novell.com
- use abstract if summary is not given
- package examples
- use wget -nc instead of repeated curl in cpanget
* Thu Apr  7 2011 coolo@novell.com
- use description=summary if no description is given, that's better
  than "sorry"
* Wed Apr  6 2011 coolo@novell.com
- increment the version to 1.17.04
  * check the pod for the license
* Wed Apr  6 2011 coolo@novell.com
- do not use %%defattr with 644 to not break binaries
* Tue Apr  5 2011 coolo@novell.com
- also read out recommends
* Tue Apr  5 2011 coolo@novell.com
- %%defattr is needed even without doc
* Fri Apr  1 2011 coolo@novell.com
- limit %%description to the preamble of head1 - before the first
  head2
* Sun Feb 20 2011 chris@computersalat.de
- fix some perl errors
  o cpanspec Cpan-Name
  o cpanspec Cpan::Name
  o cpanspec Cpan-Name-{version}.tar.gz
* Tue Feb  1 2011 chris@computersalat.de
- fix cpanspec
  * e.g. `cpanspec Devel::StackTrace` resulted in
    (Could not create filehandle for 'Devel::StackTrace')
* Fri Dec  3 2010 coolo@novell.com
- %%defattr has to be in there in any case
* Thu Dec  2 2010 coolo@novell.com
- fix some perl errors
* Wed Dec  1 2010 coolo@novell.com
- make output compatible with what spec-cleaner creates:
  * use more macros
  * do not output Authors
  * sort the header slightly different
* Tue Nov 30 2010 coolo@novell.com
- always use perl_process_packlist (requires newest perl-macros)
- fix defattrs for documentation
* Tue Nov 30 2010 coolo@novell.com
- always require perl-macros
- use %%perl_requires
* Mon Nov 29 2010 coolo@novell.com
- always require perl-macros so we do not have to use tons of
  ifs for different suse_versions
* Mon Nov 22 2010 chris@computersalat.de
- rework getting source, description, summary, author
  o Requires Pod::POM
  o cpanspec patch
- rework creation of Build-/Requires
  o ignore perl(perl)
- removed patches (included in cpanspec patch)
  o cpanspec-suse.patch
  o doc-ignore.patch
  o osc-vc-spec.patch
  o suffix-match.patch
* Thu Nov 18 2010 chris@computersalat.de
- removed suse-version patch
* Thu Nov 11 2010 chris@computersalat.de
- added doc-ignore patch
* Thu Oct 21 2010 chris@computersalat.de
- stick on version 1.78
  o removed .02suse from version (Summary is telling the whole truth)
  o disabled suse-version patch
* Thu Aug 26 2010 jw@novell.com
- bumped version number to 1.78.2suse
  Second patch release, specific to SUSE.
  Not sure if this still works for fedora.
- recognize .bz2 files too.
  And made tar, ZIP, gz, bz2 suffix case insensitive.
- call 'osc vc' with specfile basename, to avoid errors
  when current dir has two.
* Mon Aug  9 2010 chris@computersalat.de
- reworked patch
  o added parallel build for Build.PL build flags=...
* Thu Jul 15 2010 chris@computersalat.de
- fix noarch stuff
* Tue Jul 13 2010 chris@computersalat.de
- added cpan_name
- fixed Module::Build if usebuildpl
* Thu Jun  3 2010 chris@computersalat.de
- reworked patch
  o if usebuildpl > BuildReq perl(Module::Build)
- fix Url
* Sun Apr  4 2010 chris@computersalat.de
- reworked patch
  o if we "Require perl = perl_version" then
    we should have "BuildRequires perl" every time, cause changing
    perl version will then initiate a rebuild
* Fri Mar  5 2010 chris@computersalat.de
- reworked cpanspec-suse patch
* Wed Feb 10 2010 coolo@novell.com
- generate the file list also for Build.PL
* Wed Feb 10 2010 coolo@novell.com
- do not use epoches, suse doesn't use them
* Tue Feb  9 2010 coolo@novell.com
- adapt to suse policies
* Tue Feb  9 2010 coolo@novell.com
- initial package created by cpanspec