#
# spec file for package perl-Data-Validate-IP
#
# 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:           perl-Data-Validate-IP
Version:        0.27
Release:        1.2
%define cpan_name Data-Validate-IP
Summary:        IPv4 and IPv6 validation methods
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/Data-Validate-IP/
Source0:        http://www.cpan.org/authors/id/D/DR/DROLSKY/%{cpan_name}-%{version}.tar.gz
Source1:        cpanspec.yml
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(NetAddr::IP) >= 4
BuildRequires:  perl(Test::More) >= 0.96
BuildRequires:  perl(Test::Requires)
Requires:       perl(NetAddr::IP) >= 4
%{perl_requires}

%description
This module provides a number IP address validation subs that both validate
and untaint their input. This includes both basic validation ('is_ipv4()'
and 'is_ipv6()') and special cases like checking whether an address belongs
to a specific network or whether an address is public or private
(reserved).

%prep
%setup -q -n %{cpan_name}-%{version}

%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 Changes CONTRIBUTING.md LICENSE README.md test-vars-ignore

%changelog
* Fri Nov 18 2016 coolo@suse.com
- updated to 0.27
  see /usr/share/doc/packages/perl-Data-Validate-IP/Changes
  0.27  2016-11-17
  - If your version of Socket.pm provides a sane inet_pton, most of the is_*_ip
    subroutines will use a much faster implementation. is_private_ipv4 and
    is_private_ipv4 are approximately 16x faster. is_private_ipv6 and
    is_public_ipv6 are about 3-4x faster.  Implemented by Greg Oschwald. GitHub
    PR #8.
* Wed Jun  1 2016 coolo@suse.com
- updated to 0.26
  see /usr/share/doc/packages/perl-Data-Validate-IP/Changes
  0.26  2016-05-31
  - Fixed issue where invalid IPv6 strings such as ::0000000 would be marked as
    valid by is_ipv6() when using the faster inet_pton() code path (GitHub
    [#6]). Fixed by Greg Oschwald. GitHub PR #7.
* Wed Feb  3 2016 coolo@suse.com
- updated to 0.25
  see /usr/share/doc/packages/perl-Data-Validate-IP/Changes
* Mon Sep 15 2014 mlin@suse.com
- Update to 0.24
  * A string with a null byte (\0) would be considered valid if the internal
    implementation used inet_pton() to validate IP addresses. Fixed by Greg
    Oschwald. GitHub PR #4.
* Fri Jul 25 2014 mlin@suse.com
- Update to 0.23. Changes from 0.20:
  * Fixed is_ipv6 to correctly fail for a string like ":abcd" on platforms
    where inet_pton() isn't usable. Reported by Brian Bickerton. RT #93622.
  * As a side effect of the above, the code to check IPv6 addresses when
    inet_pton() isn't usable is about 7-8x times faster now.
  * Fixed some small doc typo/formatting issues.
  * The 198.51.100.0/24 and 203.0.113.0/24 networks were mistakenly put in
    the unroutable list, rather than the testnet list. This has been
    fixed. Note that if you've just been using is_public_ipv4 in your code,
    there are no changes in the results.
  * Added the 6to4 anycast network - 192.88.99.0/24. Addresses in this
    network are not considered public and there is now a new
    is_anycast_ipv4() subroutine exported.
  * Added a number of missing reserved IPv6 networks. These are the
    IPv4-mapped block (::ffff:0:0/96), the discard prefix (100::/64), TEREDO
    (2001::/32), ORCHID (2001:10::/28), and documentation (2001:db8::/32)
    IPv6 networks. There are now is_ipv4_mapped_ipv6(), is_discard_ipv6(),
    is_teredo_ipv6(), is_orchid_ipv6(), and is_documentation_ipv6()
    subs. Note that the TEREDO and ORCHID networks are both subnets of the
    larger special network, and as such were already excluded by
    is_public_ipv6(), though arguably the TEREDO addresses _should_ be
    considered public.
  * Rewrote most of the docs to greatly reduce the amount of text and to
    improve the ToC on MetaCPAN and search.cpan.org.
* Mon Oct 28 2013 mlin@suse.com
- Update to 0.20
  * Changelog see http://cpansearch.perl.org/src/DROLSKY/Data-Validate-IP-0.20/Changes
- Update license according to http://search.cpan.org/~drolsky/Data-Validate-IP-0.20/
* Mon May 23 2011 pascal.bleser@opensuse.org
- initial version (0.14)