From 47d8350b45dab6698144a4085f772e978b7c0e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 5 Jan 2018 11:38:37 +0100 Subject: [PATCH] Add a build condition for disabling Excel file format support --- perl-SQL-Translator.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/perl-SQL-Translator.spec b/perl-SQL-Translator.spec index 8345861..57f0d0f 100644 --- a/perl-SQL-Translator.spec +++ b/perl-SQL-Translator.spec @@ -1,3 +1,6 @@ +# Enable Excel file format support +%bcond_without perl_SQL_Translator_enables_excel + Name: perl-SQL-Translator Summary: Manipulate structured data definitions (SQL and more) Version: 0.11023 @@ -62,7 +65,9 @@ BuildRequires: perl(overload) BuildRequires: perl(Package::Variant) >= 1.001001 BuildRequires: perl(Pod::Usage) BuildRequires: perl(Scalar::Util) +%if %{with perl_SQL_Translator_enables_excel} BuildRequires: perl(Spreadsheet::ParseExcel) >= 0.41 +%endif BuildRequires: perl(Storable) BuildRequires: perl(Sub::Quote) BuildRequires: perl(Template) >= 2.20 @@ -100,7 +105,9 @@ Requires: perl(JSON) >= 2.0 Requires: perl(overload) Requires: perl(Package::Variant) >= 1.001001 Requires: perl(Parse::RecDescent) >= 1.967009 +%if %{with perl_SQL_Translator_enables_excel} Requires: perl(Spreadsheet::ParseExcel) >= 0.41 +%endif Requires: perl(Template) >= 2.20 Requires: perl(Test::More) >= 0.88 Requires: perl(Text::RecordParser) >= 0.02 @@ -120,7 +127,7 @@ SQL::Translator is a group of Perl modules that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI classes. The main focus of SQL::Translator is SQL, but parsers exist -for other structured data formats, including Excel spreadsheets and +for other structured data formats%{?with_perl_SQL_Translator_enables_excel:, including Excel spreadsheets} and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it’s possible to combine any parser with any producer, to plug in custom parsers or @@ -143,6 +150,11 @@ sed -i -e '/^inc\//d' MANIFEST sed -i -e '1 s|^#!/usr/bin/env perl|#!%{__perl}|' script/* # Fix permission, CPAN RT#100532 chmod -x lib/SQL/Translator/Parser/JSON.pm +%if %{without perl_SQL_Translator_enables_excel} +# Remove Excel support +rm lib/SQL/Translator/Parser/Excel.pm +sed -i -e '/^lib\/SQL\/Translator\/Parser\/Excel\.pm/d' MANIFEST +%endif %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1