diff --git a/perl-GraphViz.spec b/perl-GraphViz.spec
index 490c929..c3641e0 100644
--- a/perl-GraphViz.spec
+++ b/perl-GraphViz.spec
@@ -1,3 +1,6 @@
+# Visualize XML files with GraphViz
+%bcond_without perl_GraphViz_enables_xml
+
Name: perl-GraphViz
Version: 2.24
Release: 11%{?dist}
@@ -28,15 +31,20 @@ BuildRequires: perl(lib)
BuildRequires: perl(Parse::RecDescent) >= 1.965001
BuildRequires: perl(Time::HiRes) >= 1.51
BuildRequires: perl(vars)
-BuildRequires: perl(XML::Twig) >= 3.52
# Tests:
BuildRequires: perl(File::Which) >= 1.09
BuildRequires: perl(Test::More) >= 1.001002
# "dot" command is executed from GraphViz module
Requires: graphviz
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+Requires: perl(Carp) >= 1.01
+Requires: perl(IPC::Run) >= 0.6
+Requires: perl(Parse::RecDescent) >= 1.965001
+Requires: perl(Time::HiRes) >= 1.51
%{?perl_default_filter}
+# Filter under-specified dependencies
+%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Carp|IPC::Run|Parse::RecDescent|Time::HiRes|XML::Twig)\\)$
%description
This Perl module provides an interface to layout and image generation of
@@ -44,6 +52,20 @@ directed and undirected graphs in a variety of formats (PostScript, PNG,
etc.) using the "dot", "neato", "twopi", "circo" and "fdp" programs from
the GraphViz project ().
+%if %{with perl_GraphViz_enables_xml}
+%package XML
+Summary: Visualize XML as a tree
+Requires: %{name} = %{version}-%{release}
+Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+Requires: perl(Carp) >= 1.01
+Requires: perl(XML::Twig) >= 3.52
+
+%description XML
+GraphViz::XML Perl module makes it easy to visualize XML as a tree. XML
+elements are represented as diamond nodes, with links to elements within them.
+Character data is represented in round nodes.
+%endif
+
%prep
%setup -q -n GraphViz-%{version}
%patch0 -p1
@@ -56,6 +78,7 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%install
%{make_install}
%{_fixperms} %{buildroot}/*
+mv examples/xml.pl ./
%check
make test
@@ -64,12 +87,22 @@ make test
%license LICENSE
%doc Changes README examples/
%{perl_vendorlib}/*
+%exclude %{perl_vendorlib}/GraphViz/XML.pm
%{_mandir}/man3/*
+%exclude %{_mandir}/man3/GraphViz::XML.*
+
+%if %{with perl_GraphViz_enables_xml}
+%files XML
+%doc xml.pl
+%{perl_vendorlib}/GraphViz/XML.pm
+%{_mandir}/man3/GraphViz::XML.*
+%endif
%changelog
* Thu Nov 07 2019 Petr Pisar - 2.24-11
- Modernize a spec file
- Correct dependencies
+- Subpackage GraphViz::XML to perl-GrapViz-XML package
* Fri Jul 26 2019 Fedora Release Engineering - 2.24-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild