]> git.pld-linux.org Git - packages/perl-Config-Grammar.git/blob - perl-Config-Grammar.spec
61fd71a10951fedd3f1a89b46796786efba5c33c
[packages/perl-Config-Grammar.git] / perl-Config-Grammar.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4 #
5 %define         pdir    Config
6 %define         pnam    Grammar
7 %include        /usr/lib/rpm/macros.perl
8 Summary:        Config::Grammar - A grammar-based, user-friendly config parser
9 Name:           perl-Config-Grammar
10 Version:        1.10
11 Release:        1
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
19 %if %{with tests}
20 %endif
21 BuildArch:      noarch
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
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.
33
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.
41
42
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
51 section".
52
53
54 %prep
55 %setup -q -n %{pdir}-%{pnam}-%{version}
56
57 %build
58 %{__perl} Makefile.PL \
59         INSTALLDIRS=vendor
60 %{__make}
61
62 %{?with_tests:%{__make} test}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66
67 %{__make} pure_install \
68         DESTDIR=$RPM_BUILD_ROOT
69
70 %clean
71 rm -rf $RPM_BUILD_ROOT
72
73 %files
74 %defattr(644,root,root,755)
75 %doc Changes README
76 %{perl_vendorlib}/Config/*.pm
77 %{perl_vendorlib}/Config/Grammar
78 %{_mandir}/man3/*
This page took 0.112596 seconds and 2 git commands to generate.