File perl-BIND-Conf_Parser.spec of Package perl-BIND-Conf_Parser
#
# spec file for package perl-BIND-Conf_Parser
#
# Copyright (c) 2017 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-BIND-Conf_Parser
Version: 0.95
Release: 0
%define cpan_name BIND-Conf_Parser
Summary: Parser class for BIND configuration files
License: This library is free software and you can redistribute it and/or This program is free software and redistribution and modification in any form is explicitly following disclaimer. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/BIND-Conf_Parser/
Source0: https://cpan.metacpan.org/authors/id/P/PG/PGUEN/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
%{perl_requires}
%description
'BIND::Conf_Parser' implements a virtual base class for parsing BIND
(Berkeley Internet Name Domain) server version 8 configuration files
("named.conf"). The parsing methods shown in the synopsis perform syntactic
analysis only. As each meaningful semantic 'chunk' is parsed, a callback
method is invoked with the parsed information. The following methods are
the public entry points for the base class:
* $p = BIND::Conf_Parser->new
The object constructor takes no arguments.
* $p->parse_file( $filename )
The given filename is parsed in its entirety.
* $p->parse_fh( $fh [, $filename] )
The given filehandle is parsed in its entirety. An optional filename may be
given for inclusion in any error messages that are generated during the
parsing. If it is not included a default of "a file handle" will be used.
* $p->parse( $statements [, $filename] );
The given scalar is parsed in its entirety. Partial statements will be
treated as a syntax error. An optional filename may be given for inclusion
in any error messages that are generated during the parsing. If it is not
included a default of "a scalar" will be used.
For conveniance, the last three methods may also be called as class methods
(that is, with the class name instead of a constructed object reference),
in which case they will call new() method and use the resulting object. All
three return the object used, whether passed in or constructed at
call-time.
In order to make the parser useful, you must make a subclass where you
override one or more of the following methods as appropriate:
* $self->handle_logging_category( $name, \@names )
* $self->handle_logging_channel( $name, \%options )
* $self->handle_key( $name, $algo, $secret )
* $self->handle_acl( $name, $addrmatchlist )
* $self->handle_option( $option, $argument )
* $self->handle_server( $name, \%options )
* $self->handle_trusted_key( $domain, \@key_definition)
* $self->handle_empty_zone( $name, $class, \%options )
* $self->handle_zone( $name, $class, $type, \%options )
* $self->handle_control( $socket_type, \@type_specific_data )
The exact format of the data passed to the above routines is not currently
documented outside of the source to the class, but should be found to be
fairly natural.
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -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 Changes README verify_zones
%changelog