diff --git a/.gitignore b/.gitignore index e69de29..3d71f8f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Alien-ZMQ-0.06.tar.gz diff --git a/Alien-ZMQ-0.06-Load-less-modules-if-libzmq-is-available.patch b/Alien-ZMQ-0.06-Load-less-modules-if-libzmq-is-available.patch new file mode 100644 index 0000000..52e6f62 --- /dev/null +++ b/Alien-ZMQ-0.06-Load-less-modules-if-libzmq-is-available.patch @@ -0,0 +1,63 @@ +From b6bffbfd0a3066428d097be10c3267b30df3fbd9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 6 Mar 2015 16:58:01 +0100 +Subject: [PATCH] Load less modules if libzmq is available +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař + +diff --git a/inc/My/Build.pm b/inc/My/Build.pm +index d9ca6c7..8d2e9cd 100644 +--- a/inc/My/Build.pm ++++ b/inc/My/Build.pm +@@ -3,13 +3,8 @@ package My::Build; + use warnings FATAL => 'all'; + use strict; + +-use Archive::Tar; + use Cwd qw/realpath/; +-use Digest::SHA qw/sha1_hex/; +-use File::Path qw/remove_tree/; + use File::Spec::Functions qw/catdir catfile/; +-use IPC::Run qw/run/; +-use LWP::Simple qw/getstore RC_OK/; + use Module::Build; + + use base 'Module::Build'; +@@ -151,6 +146,13 @@ END + + sub install_zeromq { + my $self = shift; ++ ++ require Archive::Tar; ++ require Digest::SHA; Digest::SHA->import(qw/sha1_hex/); ++ require File::Path; File::Path->import(qw/remove_tree/); ++ require IPC::Run; IPC::Run->import(qw/run/); ++ require LWP::Simple; LWP::Simple->import(qw/getstore RC_OK/); ++ + my $cb = $self->cbuilder; + + my $version = $self->notes('zmq-version'); +@@ -158,7 +160,7 @@ sub install_zeromq { + my $archive = "zeromq-$version.tar.gz"; + + print "Downloading libzmq $version source archive from download.zeromq.org...\n"; +- getstore("http://download.zeromq.org/$archive", $archive) == RC_OK ++ getstore("http://download.zeromq.org/$archive", $archive) == RC_OK() + or die "Failed to download libzmq source archive"; + + print "Verifying...\n"; +@@ -181,7 +183,7 @@ sub install_zeromq { + + print "Patching...\n"; + for my $patch (glob("$basedir/files/zeromq-$version-*.patch")) { +- run [qw/patch -p1/], '<', $patch or die "Failed to patch libzmq"; ++ run([qw/patch -p1/], '<', $patch) or die "Failed to patch libzmq"; + } + + print "Configuring...\n"; +-- +2.1.0 + diff --git a/Alien-ZMQ-0.06-Remove-useless-shellbang.patch b/Alien-ZMQ-0.06-Remove-useless-shellbang.patch new file mode 100644 index 0000000..a56376d --- /dev/null +++ b/Alien-ZMQ-0.06-Remove-useless-shellbang.patch @@ -0,0 +1,23 @@ +From 0bc798570efb5ac53f0bcd129be1c419838882c4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 6 Mar 2015 16:47:55 +0100 +Subject: [PATCH] Remove useless shellbang +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař + +diff --git a/examples/01-compile.t b/examples/01-compile.t +index 83940ef..1b49fc0 100644 +--- a/examples/01-compile.t ++++ b/examples/01-compile.t +@@ -1,5 +1,3 @@ +-#!perl +- + # This test may be performed after the installation of Alien::ZMQ, e.g.: + # prove examples/01-compile.t + +-- +2.1.0 + diff --git a/perl-Alien-ZMQ.spec b/perl-Alien-ZMQ.spec new file mode 100644 index 0000000..e70aedf --- /dev/null +++ b/perl-Alien-ZMQ.spec @@ -0,0 +1,71 @@ +Name: perl-Alien-ZMQ +Version: 0.06 +Release: 1%{?dist} +Summary: Find and install libzmq library +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Alien-ZMQ/ +Source0: http://www.cpan.org/authors/id/C/CC/CCM/Alien-ZMQ-%{version}.tar.gz +# Tests do not need shellbang +Patch0: Alien-ZMQ-0.06-Remove-useless-shellbang.patch +# Do not load modules unnecessary if libzmq is available +# +Patch1: Alien-ZMQ-0.06-Load-less-modules-if-libzmq-is-available.patch +BuildArch: noarch +BuildRequires: perl +# Archive::Tar 1.00 not used +BuildRequires: perl(base) +BuildRequires: perl(Cwd) +# Digest::SHA not used +# ExtUtils::CBuilder 0.280205 not used directly +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Spec::Functions) +# IPC::Run not used +BuildRequires: perl(lib) +# LWP::Simple not used +BuildRequires: perl(Module::Build) >= 0.40 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +BuildRequires: zeromq-devel +# Run-time: +BuildRequires: perl(String::ShellQuote) +# Tests: +# English not used +BuildRequires: perl(Test::More) +# Pod::Coverage::TrustPod not used +# Test::Perl::Critic not used +# Test::Pod 1.41 not used +# Test::Pod::Coverage 1.08 not used +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: zeromq-devel + +%description +Upon installation, the target system is guaranteed for the present of libzmq. +In short, Perl modules that need libzmq can depend on Alien::ZMQ module to +make sure that it is available. + +%prep +%setup -q -n Alien-ZMQ-%{version} +%patch0 -p1 +%patch1 -p1 + +%build +perl Build.PL installdirs=vendor +./Build + +%install +./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +./Build test + +%files +%license LICENSE +%doc Changes examples README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Fri Mar 06 2015 Petr Pisar 0.06-1 +- Specfile autogenerated by cpanspec 1.78. diff --git a/sources b/sources index e69de29..b36f6e9 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a57d2945465ac9f0fc44264e959570c9 Alien-ZMQ-0.06.tar.gz