]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
5 | %include /usr/lib/rpm/macros.perl | |
6 | %define pdir XML | |
7 | %define pnam LibXML | |
8 | Summary: XML::LibXML - interface to the GNOME libxml2 library | |
9 | Summary(pl.UTF-8): XML::LibXML - interfejs do biblioteki libxml2 z GNOME | |
10 | Name: perl-XML-LibXML | |
11 | Version: 2.0118 | |
12 | Release: 2 | |
13 | # same as perl | |
14 | License: GPL v1+ or Artistic | |
15 | Group: Development/Languages/Perl | |
16 | Source0: http://www.cpan.org/modules/by-module/XML/%{pdir}-%{pnam}-%{version}.tar.gz | |
17 | # Source0-md5: da8d61a5d0d1bfd8d46814e376d33f58 | |
18 | URL: http://search.cpan.org/dist/XML-LibXML/ | |
19 | BuildRequires: libxml2-devel >= 1:2.7.2 | |
20 | BuildRequires: perl-ExtUtils-MakeMaker >= 6.56 | |
21 | BuildRequires: perl-XML-NamespaceSupport >= 1.07 | |
22 | BuildRequires: perl-XML-SAX >= 0.11 | |
23 | BuildRequires: perl-devel >= 1:5.8.0 | |
24 | BuildRequires: rpm-perlprov >= 4.1-13 | |
25 | %if %{with tests} | |
26 | BuildRequires: iconv | |
27 | BuildRequires: perl-Test-Simple | |
28 | %endif | |
29 | Requires: libxml2 >= 1:2.7.2 | |
30 | Requires: perl-XML-NamespaceSupport >= 1.07 | |
31 | Requires: perl-XML-SAX >= 0.11 | |
32 | Provides: perl-XML-LibXML-XPathContext = %{version} | |
33 | Obsoletes: perl-XML-LibXML-Common | |
34 | Obsoletes: perl-XML-LibXML-XPathContext <= 0:0.07 | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | This module implements much of the DOM Level 2 API as an interface to | |
39 | the GNOME libxml2 library. This makes it a fast and highly capable | |
40 | validating XML parser library, as well as a high performance DOM. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Ten moduł to implementacja większości API DOM Level 2 jako interfejsu | |
44 | do biblioteki GNOME libxml2. Daje to szybki i mający duże możliwości | |
45 | analizator sprawdzający poprawność XML-a, a także wysoko wydajny DOM. | |
46 | ||
47 | %package SAX | |
48 | Summary: XML::LibXML::SAX Perl module - XML::LibXML direct SAX parser | |
49 | Summary(pl.UTF-8): Moduł Perla XML::LibXML::SAX - bezpośredni analizator SAX z XML::LibXML | |
50 | Group: Development/Languages/Perl | |
51 | Requires: %{name} = %{version}-%{release} | |
52 | ||
53 | %description SAX | |
54 | This class allows you to generate SAX2 events using LibXML. Note that | |
55 | this is not a stream based parser, instead it parses documents into a | |
56 | DOM and traverses the DOM tree. The reason being that libxml2's stream | |
57 | based parsing is extremely primitive, and would require an extreme | |
58 | amount of work to allow SAX2 parsing in a stream manner. | |
59 | ||
60 | %description SAX -l pl.UTF-8 | |
61 | Ta klasa pozwala generować zdarzenia SAX2 przy użyciu LibXML2. To nie | |
62 | jest analizator oparty na strumieniach - przetwarza dokumenty na DOM i | |
63 | następnie wędruje po drzewie DOM. Wynika to z faktu, że w libxml2 | |
64 | analiza oparta na strumieniach jest bardzo prymitywna i wymagałaby | |
65 | wiele pracy, aby umożliwić strumieniową analizę SAX2. | |
66 | ||
67 | %prep | |
68 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
69 | ||
70 | %build | |
71 | SKIP_SAX_INSTALL=true; | |
72 | export SKIP_SAX_INSTALL | |
73 | ||
74 | %{__perl} Makefile.PL \ | |
75 | INSTALLDIRS=vendor | |
76 | %{__make} \ | |
77 | CC="%{__cc}" \ | |
78 | OPTIMIZE="%{rpmcflags}" | |
79 | ||
80 | %{?with_tests:%{__make} test} | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
85 | ||
86 | %{__make} install \ | |
87 | DESTDIR=$RPM_BUILD_ROOT | |
88 | install example/{*.pl,*.xml,*.dtd,*.xhtml} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
89 | ||
90 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/complex | |
91 | install example/complex/{*.xml,*.dtd} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/complex | |
92 | ||
93 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/complex/dtd | |
94 | install example/complex/dtd/*.dtd $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/complex/dtd | |
95 | ||
96 | # mans are provided | |
97 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/XML/{LibXML.pod,LibXML/*.pod,LibXML/SAX/*.pod} | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %post SAX | |
103 | umask 022 | |
104 | %{__perl} -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX::Parser))->save_parsers()" | |
105 | ||
106 | %preun SAX | |
107 | if [ "$1" = "0" ]; then | |
108 | umask 022 | |
109 | %{__perl} -MXML::SAX -e "XML::SAX->remove_parser(q(XML::LibXML::SAX::Parser))->save_parsers()" | |
110 | fi | |
111 | ||
112 | %files | |
113 | %defattr(644,root,root,755) | |
114 | %doc Changes LICENSE README TODO | |
115 | %{perl_vendorarch}/XML/LibXML.pm | |
116 | %dir %{perl_vendorarch}/XML/LibXML | |
117 | %{perl_vendorarch}/XML/LibXML/[!S]*.pm | |
118 | %dir %{perl_vendorarch}/auto/XML/LibXML | |
119 | %attr(755,root,root) %{perl_vendorarch}/auto/XML/LibXML/LibXML.so | |
120 | %{_mandir}/man3/XML::LibXML.3pm* | |
121 | %{_mandir}/man3/XML::LibXML::[!S]* | |
122 | %{_mandir}/man3/XML::LibXML::S[!A]* | |
123 | %dir %{_examplesdir}/%{name}-%{version} | |
124 | %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/x*.pl | |
125 | %{_examplesdir}/%{name}-%{version}/[!x]* | |
126 | ||
127 | %files SAX | |
128 | %defattr(644,root,root,755) | |
129 | %dir %{perl_vendorarch}/XML/LibXML/SAX | |
130 | %{perl_vendorarch}/XML/LibXML/SAX.pm | |
131 | %{perl_vendorarch}/XML/LibXML/SAX/*.pm | |
132 | %{_mandir}/man3/XML::LibXML::SAX.3pm* | |
133 | %{_mandir}/man3/XML::LibXML::SAX::* |