From db1060fe05fd5806cf6535d8b75e81c510c46232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> Date: Mon, 21 Sep 2015 08:24:05 +0200 Subject: Import
diff --git a/.gitignore b/.gitignore index e69de29..e8dd9fb 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Clownfish-CFC-0.4.2.tar.gz diff --git a/Clownfish-CFC-0.4.2-Use-system-lemon-if-possible.patch b/Clownfish-CFC-0.4.2-Use-system-lemon-if-possible.patch new file mode 100644 index 0000000..7c8f92d --- /dev/null +++ b/Clownfish-CFC-0.4.2-Use-system-lemon-if-possible.patch @@ -0,0 +1,51 @@ +From 4065b384bd46fcd9617f5dfb8ef4f1dcb7ef615e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> +Date: Thu, 17 Sep 2015 17:14:52 +0200 +Subject: [PATCH] Use system lemon if possible +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If lemon tool is already available on the system, use that instead of +building it from bundled code. + +Signed-off-by: Petr Písař <ppi...@redhat.com> +--- + buildlib/Clownfish/CFC/Build.pm | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/buildlib/Clownfish/CFC/Build.pm b/buildlib/Clownfish/CFC/Build.pm +index b7617f0..696f1de 100644 +--- a/buildlib/Clownfish/CFC/Build.pm ++++ b/buildlib/Clownfish/CFC/Build.pm +@@ -55,7 +55,15 @@ else { + $LEMON_DIR = catdir( updir(), updir(), 'lemon' ); + $CFC_SOURCE_DIR = catdir( updir(), 'src' ); + } +-my $LEMON_EXE_PATH = catfile( $LEMON_DIR, "lemon$Config{_exe}" ); ++ ++# Prefer lemon from system ++my $LEMON_EXE_PATH = "lemon$Config{_exe}"; ++if (system( $LEMON_EXE_PATH, '-x')) { ++ $LEMON_EXE_PATH = catfile( $LEMON_DIR, "lemon$Config{_exe}" ); ++} else { ++ $LEMON_DIR = undef; ++} ++ + my $PPPORT_H_PATH = catfile( $INCLUDE, 'ppport.h' ); + + sub new { +@@ -114,6 +122,10 @@ sub ACTION_ppport { + # Build the Lemon parser generator. + sub ACTION_lemon { + my $self = shift; ++ if (!defined $LEMON_DIR) { ++ print "Using system Lemon parser generator...\n\n"; ++ return; ++ } + print "Building the Lemon parser generator...\n\n"; + $self->_run_make( + dir => $LEMON_DIR, +-- +2.4.3 + diff --git a/perl-Clownfish-CFC.spec b/perl-Clownfish-CFC.spec new file mode 100644 index 0000000..b248748 --- /dev/null +++ b/perl-Clownfish-CFC.spec @@ -0,0 +1,100 @@ +Name: perl-Clownfish-CFC +Version: 0.4.2 +Release: 1%{?dist} +Summary: Compiler for Apache Clownfish +License: ASL 2.0 +Group: Development/Libraries +URL: http://search.cpan.org/dist/Clownfish-CFC/ +Source0: http://www.cpan.org/authors/id/C/CR/CREAMYG/Clownfish-CFC-%{version}.tar.gz +# Use system lemon, <https://issues.apache.org/jira/browse/CLOWNFISH-60> +Patch0: Clownfish-CFC-0.4.2-Use-system-lemon-if-possible.patch +# There is charmonizer.c which is becoming a separate project +# <git://git.apache.org/lucy-charmonizer.git>. However, lucy-charmonizer has +# not yet been released <http://lucy.apache.org/download.html>. Also +# Clownfish-CFC'c lib/Clownfish/CFC/Perl/Build/Charmonic.pm still relies on +# the local location. charmonizer.c is used only at build time. +# Therefore I'm not going to unbudle the charmonizer.c now. +BuildRequires: coreutils +BuildRequires: findutils +# gcc for standard library headers +BuildRequires: gcc +BuildRequires: lemon +BuildRequires: perl +# Modules from buildlib and Clownfish::CFC::Perl::Build::Charmonic from lib +# are used for building +BuildRequires: perl(base) +BuildRequires: perl(Carp) +BuildRequires: perl(Config) +BuildRequires: perl(Cwd) +BuildRequires: perl(Devel::PPPort) >= 3.14 +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Spec::Functions) +BuildRequires: perl(lib) +BuildRequires: perl(Module::Build) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +BuildRequires: sed +# Run-time: +# Clownfish not used at tests +BuildRequires: perl(Exporter) +BuildRequires: perl(ExtUtils::CBuilder) >= 0.18 +# Yes, ExtUtils::CBuilder::Platform::Windows::GCC is required +BuildRequires: perl(ExtUtils::CBuilder::Platform::Windows::GCC) +BuildRequires: perl(ExtUtils::Mkbootstrap) +BuildRequires: perl(ExtUtils::ParseXS) >= 2.16 +BuildRequires: perl(Fcntl) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(XSLoader) +# Tests: +BuildRequires: perl(File::stat) +BuildRequires: perl(Test::More) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +# Clownfish not used. I believe it's used only when Clownfish-CFC is called +# from the Clownfish. Adding symetric dependenc between Clownfish-CFC and +# Clownfish would create a cycle which is not desired for bulding and +# idempotent at run-time. +Requires: perl(Devel::PPPort) >= 3.14 +Requires: perl(ExtUtils::CBuilder) >= 0.18 +# Yes, ExtUtils::CBuilder::Platform::Windows::GCC is required +Requires: perl(ExtUtils::CBuilder::Platform::Windows::GCC) +Requires: perl(ExtUtils::Mkbootstrap) +Requires: perl(ExtUtils::ParseXS) >= 2.16 + +# Filter non-versioned provides. Clownfish/CFC.pm extends name spaces of all +# the other modules that are defined with version in their respective files. +%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\([^)]*\\)$ + +%description +This is a compiler for Apache Clownfish. + +%prep +%setup -q -n Clownfish-CFC-%{version} +%patch0 -p1 +# Unbundle lemon +rm -rf lemon +sed -i -e '/^lemon\//d' MANIFEST + +%build +perl Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS" +./Build + +%install +./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 +find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \; +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +./Build test + +%files +%license LICENSE +%doc CONTRIBUTING NOTICE README +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/Clownfish* +%{_mandir}/man3/* + +%changelog +* Thu Sep 17 2015 Petr Pisar <ppi...@redhat.com> 0.4.2-1 +- Specfile autogenerated by cpanspec 1.78. diff --git a/sources b/sources index e69de29..73d1d6e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +c1ece23ba907ee29e6ece0a0e6fdd86a Clownfish-CFC-0.4.2.tar.gz -- cgit v0.10.2 http://pkgs.fedoraproject.org/cgit/perl-Clownfish-CFC.git/commit/?h=master&id=db1060fe05fd5806cf6535d8b75e81c510c46232 -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/perl-devel