From ed42db25b930bc4aa29ab637d3a7d27d88d7c0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 4 Nov 2014 15:51:27 +0100 Subject: [PATCH] 3.003 bump --- .gitignore | 1 + ...al-csnappy-library-in-Sereal-Encoder.patch | 93 ------------------- ...rnal-miniz-library-in-Sereal-Encoder.patch | 81 ---------------- perl-Sereal-Encoder.spec | 11 +-- sources | 2 +- 5 files changed, 6 insertions(+), 182 deletions(-) delete mode 100644 Sereal-3.002_001-Prefer-external-csnappy-library-in-Sereal-Encoder.patch delete mode 100644 Sereal-3.002_001-Prefer-external-miniz-library-in-Sereal-Encoder.patch diff --git a/.gitignore b/.gitignore index b678aa8..3a9c025 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Sereal-Encoder-3.002.tar.gz +/Sereal-Encoder-3.003.tar.gz diff --git a/Sereal-3.002_001-Prefer-external-csnappy-library-in-Sereal-Encoder.patch b/Sereal-3.002_001-Prefer-external-csnappy-library-in-Sereal-Encoder.patch deleted file mode 100644 index eb250f1..0000000 --- a/Sereal-3.002_001-Prefer-external-csnappy-library-in-Sereal-Encoder.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 9b0bc16ced731228eb7e2e07b4287020c39d8025 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Mon, 13 Oct 2014 16:35:04 +0200 -Subject: [PATCH 1/2] Prefer external csnappy library in Sereal::Encoder -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This patch checks for presence of csnappy library and header file and -if they are available, they will be used to link to the -Sereal::Encoder XS module. Otherwise the bundled csnappy code will be -used. - - - -Signed-off-by: Petr Písař ---- - Perl/Encoder/Makefile.PL | 26 +++++++++++++++++++------- - Perl/Encoder/srl_encoder.c | 5 +++++ - 2 files changed, 24 insertions(+), 7 deletions(-) - -diff --git a/Perl/Encoder/Makefile.PL b/Perl/Encoder/Makefile.PL -index 65d9292..ce0e8d7 100644 ---- a/Perl/Encoder/Makefile.PL -+++ b/Perl/Encoder/Makefile.PL -@@ -25,6 +25,7 @@ inc::Sereal::BuildTools::generate_constant_includes($module) if $in_source_repo; - - our $OPTIMIZE; - -+my $libs = ''; - my $defines = join " ", map "-D$_", grep exists $ENV{$_}, - qw(NOINLINE DEBUG MEMDEBUG NDEBUG ENABLE_DANGEROUS_HACKS); - -@@ -56,13 +57,24 @@ if ($Config{osname} eq 'hpux' && not $Config{gccversion}) { - $defines .= " -Dinline= "; - } - --# from Compress::Snappy -+# Prefer external csnappy library over the bundled one. - require Devel::CheckLib; --my $ctz = Devel::CheckLib::check_lib( -- lib => 'c', -- function => 'return (__builtin_ctzll(0x100000000LL) != 32);' --) ? '-DHAVE_BUILTIN_CTZ' : ''; --$defines .= " $ctz" if $ctz; -+my $have_csnappy = Devel::CheckLib::check_lib( -+ lib => 'csnappy', -+ header => 'csnappy.h' -+); -+ -+if ($have_csnappy) { -+ $libs .= ' -lcsnappy'; -+ $defines .= ' -DHAVE_CSNAPPY'; -+} else { -+ # from Compress::Snappy -+ my $ctz = Devel::CheckLib::check_lib( -+ lib => 'c', -+ function => 'return (__builtin_ctzll(0x100000000LL) != 32);' -+ ) ? '-DHAVE_BUILTIN_CTZ' : ''; -+ $defines .= " $ctz" if $ctz; -+} - - # See lib/ExtUtils/MakeMaker.pm for details of how to influence - # the contents of the Makefile that is written. -@@ -101,7 +113,7 @@ WriteMakefile1( - LICENSE => 'perl', - ABSTRACT_FROM => 'lib/Sereal/Encoder.pm', - AUTHOR => 'Steffen Mueller , Yves Orton ', -- LIBS => [''], # e.g., '-lm' -+ LIBS => [$libs], # e.g., '-lm' - DEFINE => $defines, - INC => '-I.', # e.g., '-I. -I/usr/include/other' - OPTIMIZE => $OPTIMIZE, -diff --git a/Perl/Encoder/srl_encoder.c b/Perl/Encoder/srl_encoder.c -index 780748f..cc87623 100644 ---- a/Perl/Encoder/srl_encoder.c -+++ b/Perl/Encoder/srl_encoder.c -@@ -52,7 +52,12 @@ extern "C" { - #include "ptable.h" - #include "srl_buffer.h" - -+#if defined(HAVE_CSNAPPY) -+#include -+#else - #include "snappy/csnappy_compress.c" -+#endif -+ - #include "miniz.h" - - /* The ENABLE_DANGEROUS_HACKS (passed through from ENV via Makefile.PL) enables --- -1.9.3 - diff --git a/Sereal-3.002_001-Prefer-external-miniz-library-in-Sereal-Encoder.patch b/Sereal-3.002_001-Prefer-external-miniz-library-in-Sereal-Encoder.patch deleted file mode 100644 index 3a62bf4..0000000 --- a/Sereal-3.002_001-Prefer-external-miniz-library-in-Sereal-Encoder.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 1dbf60cb0a2c2dffda36c88b984cb92a5b303432 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Wed, 15 Oct 2014 15:52:18 +0200 -Subject: [PATCH 2/2] Prefer external miniz library in Sereal::Encoder -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This patch checks for presence of miniz library and header file and -if they are available, they will be used to link to the -Sereal::Encoder XS module. Otherwise the bundled miniz code will be -used. - - - -Signed-off-by: Petr Písař ---- - Perl/Encoder/Makefile.PL | 16 +++++++++++++++- - Perl/Encoder/srl_encoder.c | 4 ++++ - 2 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/Perl/Encoder/Makefile.PL b/Perl/Encoder/Makefile.PL -index ce0e8d7..6ec37ff 100644 ---- a/Perl/Encoder/Makefile.PL -+++ b/Perl/Encoder/Makefile.PL -@@ -26,6 +26,7 @@ inc::Sereal::BuildTools::generate_constant_includes($module) if $in_source_repo; - our $OPTIMIZE; - - my $libs = ''; -+my $objects = '$(BASEEXT)$(OBJ_EXT) srl_encoder$(OBJ_EXT)'; - my $defines = join " ", map "-D$_", grep exists $ENV{$_}, - qw(NOINLINE DEBUG MEMDEBUG NDEBUG ENABLE_DANGEROUS_HACKS); - -@@ -76,6 +77,19 @@ if ($have_csnappy) { - $defines .= " $ctz" if $ctz; - } - -+# Prefer external miniz library over the bundled one. -+my $have_miniz = Devel::CheckLib::check_lib( -+ lib => 'miniz', -+ header => 'miniz.h' -+); -+ -+if ($have_miniz) { -+ $libs .= ' -lminiz'; -+ $defines .= ' -DHAVE_MINIZ'; -+} else { -+ $objects .= ' miniz$(OBJ_EXT)'; -+} -+ - # See lib/ExtUtils/MakeMaker.pm for details of how to influence - # the contents of the Makefile that is written. - WriteMakefile1( -@@ -117,7 +131,7 @@ WriteMakefile1( - DEFINE => $defines, - INC => '-I.', # e.g., '-I. -I/usr/include/other' - OPTIMIZE => $OPTIMIZE, -- OBJECT => '$(O_FILES)', -+ OBJECT => $objects, - test => { - TESTS => "t/*.t t/*/*/*.t", - }, -diff --git a/Perl/Encoder/srl_encoder.c b/Perl/Encoder/srl_encoder.c -index cc87623..7756b03 100644 ---- a/Perl/Encoder/srl_encoder.c -+++ b/Perl/Encoder/srl_encoder.c -@@ -58,7 +58,11 @@ extern "C" { - #include "snappy/csnappy_compress.c" - #endif - -+#if defined(HAVE_MINIZ) -+#include -+#else - #include "miniz.h" -+#endif - - /* The ENABLE_DANGEROUS_HACKS (passed through from ENV via Makefile.PL) enables - * optimizations that may make the code so cozy with a particular version of the --- -1.9.3 - diff --git a/perl-Sereal-Encoder.spec b/perl-Sereal-Encoder.spec index fd6a014..aa92d81 100644 --- a/perl-Sereal-Encoder.spec +++ b/perl-Sereal-Encoder.spec @@ -2,7 +2,7 @@ %global perl_bootstrap 1 Name: perl-Sereal-Encoder -Version: 3.002 +Version: 3.003 Release: 1%{?dist} Summary: Perl serialization into Serial format # lib/Sereal/Encoder.pm: GPL+ or Artistic @@ -13,10 +13,6 @@ License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/Sereal-Encoder/ Source0: http://www.cpan.org/authors/id/Y/YV/YVES/Sereal-Encoder-%{version}.tar.gz -# Use external csnappy library, -Patch0: Sereal-3.002_001-Prefer-external-csnappy-library-in-Sereal-Encoder.patch -# Use external miniz library, -Patch1: Sereal-3.002_001-Prefer-external-miniz-library-in-Sereal-Encoder.patch BuildRequires: csnappy-devel BuildRequires: miniz-devel BuildRequires: perl @@ -66,8 +62,6 @@ serializer using a binary protocol called Sereal. %prep %setup -q -n Sereal-Encoder-%{version} -%patch0 -p3 -%patch1 -p3 # Remove bundled Perl modules rm -r ./inc/Devel sed -i -s '/^inc\/Devel/d' MANIFEST @@ -98,5 +92,8 @@ make test %{_mandir}/man3/* %changelog +* Tue Nov 04 2014 Petr Pisar - 3.003-1 +- 3.003 bump + * Fri Oct 10 2014 Petr Pisar 3.002-1 - Specfile autogenerated by cpanspec 1.78. diff --git a/sources b/sources index bcfdad0..1bbb120 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -18e88a20ae5842f98e2874557d8d525c Sereal-Encoder-3.002.tar.gz +544c4f7222a22aa1c42fcf366eacb382 Sereal-Encoder-3.003.tar.gz