2017-04-21 05:09:11 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-Makefile-DOM
|
|
|
|
#
|
2024-08-12 19:44:27 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-04-21 05:09:11 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2024-08-12 19:44:27 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-04-21 05:09:11 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-08-12 19:44:27 +00:00
|
|
|
%define cpan_name Makefile-DOM
|
2017-04-21 05:09:11 +00:00
|
|
|
Name: perl-Makefile-DOM
|
2024-08-12 19:44:27 +00:00
|
|
|
Version: 0.8.0
|
2017-04-21 05:09:11 +00:00
|
|
|
Release: 0
|
2024-08-12 19:44:27 +00:00
|
|
|
# 0.008 -> normalize -> 0.8.0
|
|
|
|
%define cpan_version 0.008
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2017-04-21 05:09:11 +00:00
|
|
|
Summary: Simple DOM parser for Makefiles
|
2024-08-12 19:44:27 +00:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/A/AG/AGENT/%{cpan_name}-%{cpan_version}.tar.gz
|
2025-08-12 18:15:16 +02:00
|
|
|
Source100: README.md
|
2017-04-21 05:09:11 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Clone) >= 0.18
|
2024-08-12 19:44:27 +00:00
|
|
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.59
|
2017-04-21 05:09:11 +00:00
|
|
|
BuildRequires: perl(List::MoreUtils) >= 0.21
|
|
|
|
BuildRequires: perl(Params::Util) >= 0.22
|
|
|
|
Requires: perl(Clone) >= 0.18
|
|
|
|
Requires: perl(List::MoreUtils) >= 0.21
|
|
|
|
Requires: perl(Params::Util) >= 0.22
|
2024-08-12 19:44:27 +00:00
|
|
|
Provides: perl(MDOM::Assignment)
|
|
|
|
Provides: perl(MDOM::Command)
|
|
|
|
Provides: perl(MDOM::Directive)
|
|
|
|
Provides: perl(MDOM::Document)
|
|
|
|
Provides: perl(MDOM::Document::Gmake)
|
|
|
|
Provides: perl(MDOM::Dumper) = %{version}
|
|
|
|
Provides: perl(MDOM::Element) = %{version}
|
|
|
|
Provides: perl(MDOM::Node) = %{version}
|
|
|
|
Provides: perl(MDOM::Rule)
|
|
|
|
Provides: perl(MDOM::Rule::Simple)
|
|
|
|
Provides: perl(MDOM::Rule::StaticPattern)
|
|
|
|
Provides: perl(MDOM::Token) = %{version}
|
|
|
|
Provides: perl(MDOM::Token::Bare)
|
|
|
|
Provides: perl(MDOM::Token::Comment) = %{version}
|
|
|
|
Provides: perl(MDOM::Token::Continuation)
|
|
|
|
Provides: perl(MDOM::Token::Interpolation)
|
|
|
|
Provides: perl(MDOM::Token::Modifier)
|
|
|
|
Provides: perl(MDOM::Token::Separator) = %{version}
|
|
|
|
Provides: perl(MDOM::Token::Whitespace) = %{version}
|
|
|
|
Provides: perl(MDOM::Unknown)
|
|
|
|
Provides: perl(MDOM::Util)
|
|
|
|
Provides: perl(Makefile::DOM) = %{version}
|
|
|
|
%undefine __perllib_provides
|
2017-04-21 05:09:11 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
|
|
|
This libary can serve as an advanced lexer for (GNU) makefiles. It parses
|
|
|
|
makefiles as "documents" and the parsing is lossless. The results are data
|
|
|
|
structures similar to DOM trees. The DOM trees hold every single bit of the
|
|
|
|
information in the original input files, including white spaces, blank
|
|
|
|
lines and makefile comments. That means it's possible to reproduce the
|
|
|
|
original makefiles from the DOM trees. In addition, each node of the DOM
|
2024-08-12 19:44:27 +00:00
|
|
|
trees is modifiable and so is the whole tree, just like the PPI module used
|
|
|
|
for Perl source parsing and the HTML::TreeBuilder module used for parsing
|
|
|
|
HTML source.
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
If you're looking for a true GNU make parser that generates an AST, please
|
2024-08-12 19:44:27 +00:00
|
|
|
see Makefile::Parser::GmakeDB instead.
|
2017-04-21 05:09:11 +00:00
|
|
|
|
2024-08-12 19:44:27 +00:00
|
|
|
The interface of 'Makefile::DOM' mimics the API design of PPI. In fact,
|
|
|
|
I've directly stolen the source code and POD documentation of PPI::Node,
|
|
|
|
PPI::Element, and PPI::Dumper, with the full permission from the author of
|
|
|
|
PPI, Adam Kennedy.
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
'Makefile::DOM' tries to be independent of specific makefile's syntax. The
|
|
|
|
same set of DOM node types is supposed to get shared by different makefile
|
2024-08-12 19:44:27 +00:00
|
|
|
DOM generators. For example, MDOM::Document::Gmake parses GNU makefiles and
|
|
|
|
returns an instance of MDOM::Document, i.e., the root of the DOM tree while
|
|
|
|
the NMAKE makefile lexer in the future, 'MDOM::Document::Nmake', also
|
|
|
|
returns instances of the MDOM::Document class. Later, I'll also consider
|
|
|
|
adding support for dmake and bsdmake.
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
%prep
|
2024-08-12 19:44:27 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
|
|
|
|
|
|
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
%build
|
2024-08-12 19:44:27 +00:00
|
|
|
PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
%check
|
2024-08-12 19:44:27 +00:00
|
|
|
make test
|
2017-04-21 05:09:11 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%doc Changes README TODO
|
|
|
|
|
|
|
|
%changelog
|