3 %bcond_without tests # do not perform "make test"
7 %include /usr/lib/rpm/macros.perl
8 Summary: Config::Grammar - A grammar-based, user-friendly config parser
9 Name: perl-Config-Grammar
12 License: GPL v1+ or Artistic
13 Group: Development/Languages/Perl
14 Source0: http://www.cpan.org/modules/by-module/Config/%{pdir}-%{pnam}-%{version}.tar.gz
15 # Source0-md5: ce904f687f1ee9c70521142a2e0f15c9
16 URL: http://search.cpan.org/dist/Config-Grammar/
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: rpm-perlprov >= 4.1-13
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Config::Grammar is a module to parse configuration files. The
26 configuration may consist of multiple-level sections with assignments
27 and tabular data. The parsed data will be returned as a hash
28 containing the whole configuration. Config::Grammar uses a grammar
29 that is supplied upon creation of a Config::Grammar object to parse
30 the configuration file and return helpful error messages in case of
31 syntax errors. Using the makepod method you can generate documentation
32 of the configuration file format.
34 The maketmpl method can generate a template configuration file. If
35 your grammar contains regexp matches, the template will not be all
36 that helpful as Config::Grammar is not smart enough to give you
37 sensible template data based in regular expressions. The related
38 function maketmplmin generates a minimal configuration template
39 without examples, regexps or comments and thus allows an experienced
40 user to fill in the configuration data more efficiently.
43 The grammar is a multiple-level hash of hashes, which follows the
44 structure of the configuration. Each section or variable is
45 represented by a hash with the same structure. Each hash contains
46 special keys starting with an underscore such as '_sections', '_vars',
47 '_sub' or '_re' to denote meta data with information about that
48 section or variable. Other keys are used to structure the hash
49 according to the same nesting structure of the configuration itself.
50 The starting hash given as parameter to 'new' contains the "root
55 %setup -q -n %{pdir}-%{pnam}-%{version}
58 %{__perl} Makefile.PL \
62 %{?with_tests:%{__make} test}
65 rm -rf $RPM_BUILD_ROOT
67 %{__make} pure_install \
68 DESTDIR=$RPM_BUILD_ROOT
71 rm -rf $RPM_BUILD_ROOT
74 %defattr(644,root,root,755)
76 %{perl_vendorlib}/Config/*.pm
77 %{perl_vendorlib}/Config/Grammar