ExtUtils-Depends-0.8002/0000755000175000017500000000000014766437767014725 5ustar osboxesosboxesExtUtils-Depends-0.8002/perl-ExtUtils-Depends.spec.in0000644000175000017500000000303114035053135022250 0ustar osboxesosboxesSummary: ExtUtils-Depends Perl module Name: perl-ExtUtils-Depends Version: @VERSION@ Release: 1 Packager: gtk-perl-list@gnome.org License: Perl Group: Development/Tools URL: http://search.cpan.org/dist/ExtUtils-Depends/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: perl >= 2:5.8.0 Source0: @SOURCE@ %description This module tries to make it easy to build Perl extensions that use functions and typemaps provided by other perl extensions. This means that a perl extension is treated like a shared library that provides also a C and an XS interface besides the perl one. This works as long as the base extension is loaded with the RTLD_GLOBAL flag (usually done with a sub dl_load_flags {0x01} in the main .pm file) if you need to use functions defined in the module. %prep %setup -q -n ExtUtils-Depends-%{version} %build CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=$RPM_BUILD_ROOT%{_prefix} make OPTIMIZE="$RPM_OPT_FLAGS" make test %install %makeinstall [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \; find $RPM_BUILD_ROOT/usr -type f -print | \ sed "s@^$RPM_BUILD_ROOT@@g" | \ grep -v perllocal.pod | \ grep -v "\.packlist" > %{name}-%{version}-filelist if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then exit -1 fi %clean rm -rf $RPM_BUILD_ROOT %files -f %{name}-%{version}-filelist %defattr(-,root,root) %changelog * @DATE@ gtk-perl-list@gnome.org - @VERSION@ - Specfile autogenerated. ExtUtils-Depends-0.8002/META.json0000644000175000017500000000400114766437767016341 0ustar osboxesosboxes{ "abstract" : "unknown", "author" : [ "unknown", "Gtk2-Perl Team " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.7106, CPAN::Meta::Converter version 2.150010", "keywords" : [ "XS", "XS extensions", "dependency" ], "license" : [ "perl_5", "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "ExtUtils-Depends", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "Data::Dumper" : "0", "ExtUtils::MakeMaker" : "7.44", "File::Spec" : "0", "IO::File" : "0" } }, "runtime" : { "requires" : { "Data::Dumper" : "0", "ExtUtils::MakeMaker" : "7.44", "File::Spec" : "0", "IO::File" : "0", "perl" : "5.006" } }, "test" : { "recommends" : { "Test::Number::Delta" : "1" }, "requires" : { "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-ExtUtils-Depends [at] rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends" }, "homepage" : "http://gtk2-perl.sourceforge.net", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "git://git.gnome.org/perl-ExtUtils-Depends", "web" : "http://git.gnome.org/browse/perl-ExtUtils-Depends" }, "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list" }, "version" : "0.8002", "x_serialization_backend" : "JSON::PP version 4.04" } ExtUtils-Depends-0.8002/MANIFEST.SKIP0000644000175000017500000000013414766436636016613 0ustar osboxesosboxes^blib ^MAINTAINERS$ ^Makefile$ ^pm_to_blib$ ^\.git \.doap$ ^MANIFEST\.bak$ ^MYMETA.* \.sw.$ ExtUtils-Depends-0.8002/t/0000755000175000017500000000000014766437766015167 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/04_extra_libs.t0000644000175000017500000000161014766436636020004 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; use TestHelper; use ExtUtils::Depends; my $tmp_inc = temp_inc; plan skip_all => "test only for 'MSWin32', 'cygwin', and 'android'" unless $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'android'; my $dep_info = ExtUtils::Depends->new('DepTest'); $dep_info->save_config(catfile $tmp_inc, qw(DepTest Install Files.pm)); # --------------------------------------------------------------------------- # push @INC, catdir(qw(t inc)); my $use_info = ExtUtils::Depends->new('UseTest', 'DepTest'); my %vars = $use_info->get_makefile_vars; my $libname = 'DepTest'; require DynaLoader; $libname = DynaLoader::mod2fname([$libname]) if defined &DynaLoader::mod2fname; like $vars{LDFROM}, qr/$libname/ or diag explain \%vars; # --------------------------------------------------------------------------- # done_testing; ExtUtils-Depends-0.8002/t/inc/0000755000175000017500000000000014766437766015740 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/DepTest/0000755000175000017500000000000014766437766017310 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/DepTest/Install/0000755000175000017500000000000014766437766020716 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/DepTest/Install/.keep0000644000175000017500000000000014035053135021576 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/0000755000175000017500000000000014766437766016710 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/0000755000175000017500000000000014766437766020260 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.dll0000644000175000017500000000000014766436636022306 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.dll.a0000644000175000017500000000000014766436636022525 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.a0000644000175000017500000000000014766436636021753 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.xs.dll0000644000175000017500000000000014766436636022737 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.lib0000644000175000017500000000000014766436636022301 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/inc/auto/DepTest/DepTest.so0000644000175000017500000000000014766436636022154 0ustar osboxesosboxesExtUtils-Depends-0.8002/t/02_save_load.t0000644000175000017500000001210214766436636017601 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; use TestHelper; use File::Path 'mkpath'; use File::Spec::Functions 'catdir'; use ExtUtils::Depends; my $tmp_inc = temp_inc; my $dep_info = ExtUtils::Depends->new ('DepTest'); my $inc = '-Iinclude -I/usr/local/include -W -Wall -Werror -ansi'; $dep_info->set_inc ($inc); my $libs = '-L/usr/local/lib -lfoobar'; $dep_info->set_libs ($libs); my %pm_mapping = ('DepTest.pm' => 'build/DepTest.pm', 'DepTest/Helper.pm' => 'build/DepTest/Helper.pm'); $dep_info->add_pm (%pm_mapping); my @xs_files = qw(DepTestFoo.xs DepTestBar.xs); $dep_info->add_xs (@xs_files); my @c_files = qw(dep-test-foo.c dep-test-bar.c); $dep_info->add_c (@c_files); my @typemaps = qw(build/foo.typemap build/bar.typemap); $dep_info->add_typemaps (@typemaps); my @installed_files = qw(dep.h dep-private.h); $dep_info->install (@installed_files); use Data::Dumper; $Data::Dumper::Terse = 1; my $IFpm = catfile $tmp_inc, qw(DepTest Install Files.pm); $dep_info->save_config ($IFpm); # ensure '/' used for config filename in require, not File::Spec open my $iffh, '>>', $IFpm or die "write $IFpm: $!"; print $iffh qq{\nwarn "LOADING\\n";\n1;\n}; undef $iffh; # test utility function is_deeply [ExtUtils::Depends::uniquify(qw(a c b c a b))], [qw(a c b)]; # --------------------------------------------------------------------------- # my %vars = $dep_info->get_makefile_vars; is_deeply ($vars{TYPEMAPS}, \@typemaps, 'makefile vars typemaps'); is ($vars{INC}, $inc, 'makefile vars inc'); is ($vars{LIBS}, $libs, 'makefile vars libs'); foreach my $pm (keys %pm_mapping) { like ($vars{PM}{$pm}, qr/\Q$pm_mapping{$pm}\E/, 'makefile vars PM'); } ok (exists $vars{PM}{catfile $tmp_inc, qw(DepTest Install Files.pm)}, 'PM'); foreach my $file (@installed_files) { like ($vars{PM}{$file}, qr/\Q$file\E/, "PM $file"); } foreach my $xs_file (@xs_files) { ok (exists $vars{XS}{$xs_file}, "XS $xs_file"); } foreach my $file (@c_files, @xs_files) { (my $stem = $file) =~ s/\.(?:c|xs)\z//; like ($vars{OBJECT}, qr/\Q$stem\E/, "OBJECT $stem"); like ($vars{clean}{FILES}, qr/\Q$stem\E/, "FILES $stem"); } # --------------------------------------------------------------------------- # my $info; { my $warning = ''; local $SIG{__WARN__} = sub { $warning .= join '', @_; }; $info = ExtUtils::Depends::load ('DepTest'); like $warning, qr/LOADING/, 'loaded once'; $warning = ''; require DepTest::Install::Files; unlike $warning, qr/LOADING/, 'not loaded twice'; } my $install_part = qr|DepTest.Install|; like ($info->{inc}, $install_part, "loaded inc"); isnt (index($info->{inc}, $inc), -1, "loaded inc content"); my @typemaps_expected = map { my $t = $_; $t =~ s#build/##; $t } @typemaps; sub strip_typemap { my $t = $_; my $tmp = catfile('DepTest','Install',' '); $tmp =~ s# $##; $t =~ s#.*\Q$tmp\E##; $t } is_deeply ( [ map { strip_typemap($_) } @{$info->{typemaps}} ], \@typemaps_expected, 'check typemaps actually saved/loaded' ); like ($info->{instpath}, $install_part, 'instpath'); is_deeply ($info->{deps}, [], 'basic deps'); is ($info->{libs}, $libs, 'basic libs'); # now check package vars are set, per the ::load doc! { no warnings qw(once); is ($DepTest::Install::Files::inc, $inc, 'package inc'); is_deeply ( [ map { strip_typemap($_) } @DepTest::Install::Files::typemaps ], \@typemaps_expected, 'package typemaps' ); is_deeply (\@DepTest::Install::Files::deps, [], 'package deps'); is ($DepTest::Install::Files::libs, $libs, 'package libs'); } # test Inline class methods is_deeply ( DepTest::Install::Files->Inline('C'), { INC => $inc, LIBS => $libs, TYPEMAPS => \@typemaps_expected, }, 'api check Inline method' ); is_deeply ([ DepTest::Install::Files->deps ], [], 'api check deps method'); # --------------------------------------------------------------------------- # my $INC_FRAG = '-Ddistinctive'; make_test_pkg('PSnew', < '${INC_FRAG}new' } } sub deps { qw(PSold) } EOF make_test_pkg('PSold', "\$inc = '${INC_FRAG}old';"); sub make_test_pkg { my ($base, $text) = @_; my $dir = catdir($tmp_inc, $base, qw(Install)); mkpath($dir, 0, 0711); open my $fh, '>', catfile($dir, 'Files.pm'); print $fh sprintf "package %s;\n%s\n1;\n", $base . '::Install::Files', $text; } sub test_load { my ($info, $dep_re, $inc_re, $msg) = @_; my $install_part = qr|PS.*Install|; like $info->{inc}, $install_part, "$msg inc generic"; like $info->{inc}, qr/$inc_re/, "$msg inc specific"; ok scalar(grep /$dep_re/, @{$info->{deps}}), $msg if $dep_re; ok exists $info->{libs}, $msg; } test_load(ExtUtils::Depends::load('PSnew'), qr/PSold/, qr/${INC_FRAG}new/, 'load new scheme'); test_load(ExtUtils::Depends::load('PSold'), undef, qr/${INC_FRAG}old/, 'load old scheme'); $dep_info = ExtUtils::Depends->new('UseTest', 'PSnew'); my %mkv = $dep_info->get_makefile_vars; like $mkv{INC}, qr/${INC_FRAG}new/, 'get_makefile_vars has immediate-dep INC'; like $mkv{INC}, qr/${INC_FRAG}old/, 'get_makefile_vars has transitive-dep INC'; done_testing; ExtUtils-Depends-0.8002/t/03_deps.t0000644000175000017500000000143414766436636016606 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; use TestHelper; use ExtUtils::Depends; my $tmp_inc = temp_inc; my $dep_info = ExtUtils::Depends->new ('DepTest'); $dep_info->save_config (catfile $tmp_inc, qw(DepTest Install Files.pm)); # --------------------------------------------------------------------------- # my $info = ExtUtils::Depends->new ('UseTest', 'DepTest'); my %deps = $info->get_deps; ok (exists $deps{DepTest}); # --------------------------------------------------------------------------- # $info = ExtUtils::Depends->new ('UseTest'); $info->add_deps ('DepTest'); $info->load_deps; %deps = $info->get_deps; ok (exists $deps{DepTest}); # --------------------------------------------------------------------------- # done_testing; ExtUtils-Depends-0.8002/t/lib/0000755000175000017500000000000014766437766015735 5ustar osboxesosboxesExtUtils-Depends-0.8002/t/lib/TestHelper.pm0000644000175000017500000000057414766436636020353 0ustar osboxesosboxesuse strict; use warnings; package TestHelper; use File::Temp 'tempdir'; use File::Path 'mkpath'; use File::Spec::Functions 'catdir', 'catfile'; use base 'Exporter'; our @EXPORT = qw(temp_inc catfile catdir); sub temp_inc { my $tmpinc = tempdir(CLEANUP => 1); mkpath(catdir($tmpinc, qw(DepTest Install)), 0, 0711); unshift @INC, $tmpinc; return $tmpinc; } 1; ExtUtils-Depends-0.8002/t/05_unc.t0000644000175000017500000000166214766436636016445 0ustar osboxesosboxesuse strict; use warnings; use Test::More; use File::Spec; require File::Spec::Win32; @File::Spec::ISA = qw(File::Spec::Win32); # pretend to be Win32 use ExtUtils::Depends; sub make_fake { my ($name, $path) = @_; my @parts = split /::/, $name; push @parts, qw(Install Files); my $req_name = join('/', @parts).".pm"; $INC{$req_name} = "$path/$req_name"; } make_fake('FakeUNC', '//server/share/file'); my $hash = ExtUtils::Depends::load('FakeUNC'); my $s = '[\\/]'; like $hash->{instpath}, qr/^${s}${s}server${s}share${s}file${s}FakeUNC${s}Install${s}?$/, 'preserves UNC server'; my @fakes = qw(FakeSpace1 FakeSpace2); make_fake($_, 'C:/program files/perl/lib') for @fakes; my $eud = ExtUtils::Depends->new(qw(Mymod), @fakes); $hash = {$eud->get_makefile_vars}; is $hash->{INC}, '-I"C:/program files/perl/lib/FakeSpace1/Install/" -I"C:/program files/perl/lib/FakeSpace2/Install/" ', 'space-quoted stuff no lose parts'; done_testing; ExtUtils-Depends-0.8002/META.yml0000644000175000017500000000210114766437766016167 0ustar osboxesosboxes--- abstract: unknown author: - unknown - 'Gtk2-Perl Team ' build_requires: ExtUtils::MakeMaker: '0' Test::More: '0.88' configure_requires: Data::Dumper: '0' ExtUtils::MakeMaker: '7.44' File::Spec: '0' IO::File: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.7106, CPAN::Meta::Converter version 2.150010' keywords: - XS - 'XS extensions' - dependency license: open_source meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: ExtUtils-Depends no_index: directory: - t - inc requires: Data::Dumper: '0' ExtUtils::MakeMaker: '7.44' File::Spec: '0' IO::File: '0' perl: '5.006' resources: MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends homepage: http://gtk2-perl.sourceforge.net license: http://dev.perl.org/licenses/ repository: git://git.gnome.org/perl-ExtUtils-Depends version: '0.8002' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' ExtUtils-Depends-0.8002/Changes0000644000175000017500000001411714766437120016203 0ustar osboxesosboxesRevision history for Perl extension ExtUtils::Depends. 0.8002 - fix UNC path bug - https://rt.cpan.org/Ticket/Display.html?id=102436 - fix get_makefile_vars losing path components if space-quoted and >1 dep, which was breaking CPAN module "true" which depends on two modules 0.8001 - Remove hack (cf https://rt.cpan.org/Ticket/Display.html?id=45224) The hijacking of EUMM's `static_lib` method is now obsolete, as well as causing problems. - Also added a couple of code tidy-ups 0.8000 - Bump version so https://metacpan.org/pod/ExtUtils::Depends shows the correct _ExtUtils::Depends_ module - Quote directories with spaces 0.405 - Remove MYMETA.* from MANIFEST file; closes autogenerated RT ticket #108554 0.404 - Depends.pm: sort deps in save_config() and get_makefile_vars(); patch submitted by Debian's reproducible build team for RT#101602 - Use / to make ::load filename, not File::Spec - perldoc -f require 0.403 - Avoid using Test::More::done_testing() for to support building out-of-the-box on older perls. 0.402 Sat Oct 18 18:06:19 EEST 2014 - Set Data::Dumper::Sortkeys = 1 in ExtUtils::Depends->save_config(); patch submitted by Niko Tyni of the Debian Perl Group; fixes RT#99260 0.401 Sat Aug 23 14:20:11 IRKT 2014 - Add README changes created by 'make dist' from the POD - Rename test modules - Test old/new schemes with .pm files - Move old/new scheme tests from middle of other stuff to end - Rename test packages to 8.3 unique 0.400 Sun Aug 10 13:58:24 CEST 2014 - In addition to the package variables $inc, $libs and @typemaps, write an 'Inline' method to ::Install::Files for easier interoperability with the Inline module. - Accompany the 'Inline' method with a 'deps' method in ::Install::Files in addition to the @deps package variable. - Make ExtUtils::Depends->load use the 'Inline' and 'deps' methods by default, falling back to the package variables if the methods are not defined. - Make the docs recommend the 'Inline' and 'deps' approach for creating ::Install::Files manually, without ExtUtils::Depends::save_config. 0.309 Sat Aug 2 15:23:03 PDT 2014 - Depends.pm: use $DLEXT instead of $SO for library filename extensions - MANIFEST: remove MYMETA.* files - use DynaLoader::mod2fname if available - Added Android support 0.308 Sun May 18 16:22:11 PDT 2014 - Fix win32 test failure in t/02_save_load.t (closes RT#95301) 0.307 Mon Apr 28 22:04:38 PDT 2014 - $Data::Dumper::Terse set to 1 broke save_config - Document API expected by ::load function 0.306 Mon Sep 28 22:04:38 PDT 2013 - Fixed typo in RT queue URL; fixes RT#88960 0.305 Mon Sep 2 14:16:58 PDT 2013 - Makefile.PL: converted to CPAN::Meta::Spec v2 - Updated license in RPM spec file; closes RT#88196 - Updated contact info and added git repo info to POD - Add comments for find_extra_libs method (closes RT#43900) - Fixed typo (closes RT#86572) 0.304 Wed Jan 26 08:48:18 CET 2011 - More robust detection of gcc toolchains on Win32 (Closes: RT#62455) (sisyphus). - Don't assume dlltool is called 'dlltool' on Win32+gcc. Ask Config.pm instead (Closes: RT#62455) (sisyphus). 0.303 Mon Nov 29 19:42:59 CET 2010 - Fix a race condition when running the tests in parallel. 0.302 Sat Jul 4 15:28:35 CEST 2009 - Create import libraries if necessary to fix linking when gcc is used on MSWin32 (Strawberry Perl, for example). 0.301 Sat Sep 6 20:11:01 CEST 2008 - On Cygwin, link directly against the DLLs of dependencies. Patch by Yaakov. - Require perl 5.6.0. 0.300 Sun Mar 30 17:35:35 CEST 2008 - On MSWin32 and cygwin, find the link libraries of dependencies and put them into LIBS. - Add tests. - Correct typos in the documentation. - In get_makefile_vars, comment out the code that put the installed libraries into @OBJECT, which caused them to get deleted on realclean. - In Makefile.PL, don't use the bogus package "MAIN". - Remove debug spew. 0.205 Sun Jan 23 13:20:14 EST 2005 - Disable the RPM-related postamble on Win32. The 'date' command on windows is interactive, and caused Makefile.PL to hang. 0.204 Sun Sep 19 23:26:23 CEST 2004 - Use capitals at the start of everything that is printed out, to unify Makefile.PL output. 0.203 Fri Mar 12 16:09:35 EST 2004 - don't output a PM pair from get_makefile_vars unless we actually have data in the pm key. 0.202 Fri Mar 5 00:26:18 EST 2004 - add long-overdue version-checking import implementation. - fixed a bad initial value bug that caused crashes if your setup did not need a call to set_libs. [Ross] - distribute the spec file. [Ross] 0.201 Thu Feb 12 15:33:47 EST 2004 - add_headers() is now deprecated. it's functionality is provided by install(), and it is already a no-op in 0.200. - remove code referring to @headers, since we don't actually keep a separate list of headers anymore. (should we?) - load() no longer returns the "header" key -- it should've been "headers", but i've simply removed all that code. 0.200 Tue Feb 10 01:21:57 EST 2004 - completely rewritten. attempted to retain backward compatibility, but some esoteric functionality is probably missing. now stores dependency lists, so that module chaining is more useful. - document just about everything. - really, really, really needs a regression test suite. 0.104 Fri Nov 21 01:34:57 EST 2003 - remove debian packaging files - add licensing terms to pod. Depends was originally part of gtk-perl, which itself bore this copyright notice. 0.103 Fri Aug 15 09:59:42 EDT 2003 - add files for maintaining debian packages. 0.102 Tue Jul 8 14:10:29 EDT 2003 - use File::Spec->file_name_is_absolute instead of non-portable m{^/}. still uses direct string manipulation on paths, but this fix lets the module function correctly under native Win32 perl. 0.101 Fri Jun 20 23:37:19 CEST 2003 - added primitive load-only testsuite. 0.1 Thu Jun 19 01:29:25 CEST 2003 - original version; created by extracting it from glib. ExtUtils-Depends-0.8002/lib/0000755000175000017500000000000014766437766015472 5ustar osboxesosboxesExtUtils-Depends-0.8002/lib/ExtUtils/0000755000175000017500000000000014766437766017253 5ustar osboxesosboxesExtUtils-Depends-0.8002/lib/ExtUtils/Depends.pm0000644000175000017500000004113114766437076021165 0ustar osboxesosboxespackage ExtUtils::Depends; use strict; use warnings; use Carp; use Config; use File::Find; use File::Spec; use Data::Dumper; our $VERSION = '0.8002'; sub import { my $class = shift; return unless @_; die "$class version $_[0] is required--this is only version $VERSION" if $VERSION < $_[0]; } sub new { my ($class, $name, @deps) = @_; my $self = bless { name => $name, deps => {}, inc => [], libs => '', pm => {}, typemaps => [], xs => [], c => [], }, $class; $self->add_deps (@deps); # attempt to load these now, so we'll find out as soon as possible # whether the dependencies are valid. we'll load them again in # get_makefile_vars to catch any added between now and then. $self->load_deps; return $self; } sub add_deps { my $self = shift; foreach my $d (@_) { $self->{deps}{$d} ||= undef; } } sub get_deps { my $self = shift; $self->load_deps; # just in case return %{$self->{deps}}; } sub set_inc { my $self = shift; push @{ $self->{inc} }, @_; } sub set_libs { my ($self, $newlibs) = @_; $self->{libs} = $newlibs; } sub add_pm { my ($self, %pm) = @_; while (my ($key, $value) = each %pm) { $self->{pm}{$key} = $value; } } sub _listkey_add_list { my ($self, $key, @list) = @_; $self->{$key} = [] unless $self->{$key}; push @{ $self->{$key} }, @list; } sub add_xs { shift->_listkey_add_list ('xs', @_) } sub add_c { shift->_listkey_add_list ('c', @_) } sub add_typemaps { my $self = shift; $self->_listkey_add_list ('typemaps', @_); $self->install (@_); } # no-op, only used for source back-compat sub add_headers { carp "add_headers() is a no-op" } ####### PRIVATE sub basename { (File::Spec->splitdir ($_[0]))[-1] } # get the name in Makefile syntax. sub installed_filename { my $self = shift; return '$(INST_ARCHLIB)/$(FULLEXT)/Install/'.basename ($_[0]); } sub install { # install things by adding them to the hash of pm files that gets # passed through WriteMakefile's PM key. my $self = shift; foreach my $f (@_) { $self->add_pm ($f, $self->installed_filename ($f)); } } sub save_config { use Data::Dumper; local $Data::Dumper::Terse = 0; local $Data::Dumper::Sortkeys = 1; use IO::File; my ($self, $filename) = @_; my $file = IO::File->new (">".$filename) or croak "can't open '$filename' for writing: $!\n"; print $file "package $self->{name}\::Install::Files;\n\n"; print $file "".Data::Dumper->Dump([{ inc => join (" ", @{ $self->{inc} }), libs => $self->{libs}, typemaps => [ map { basename $_ } @{ $self->{typemaps} } ], deps => [sort keys %{ $self->{deps} }], }], ['self']); print $file <<'EOF'; @deps = @{ $self->{deps} }; @typemaps = @{ $self->{typemaps} }; $libs = $self->{libs}; $inc = $self->{inc}; EOF # this is ridiculous, but old versions of ExtUtils::Depends take # first $loadedmodule::CORE and then $INC{$file} --- the fallback # includes the Filename.pm, which is not useful. so we must add # this crappy code. we don't worry about portable pathnames, # as the old code didn't either. (my $mdir = $self->{name}) =~ s{::}{/}g; print $file <<"EOT"; \$CORE = undef; foreach (\@INC) { if ( -f \$_ . "/$mdir/Install/Files.pm") { \$CORE = \$_ . "/$mdir/Install/"; last; } } sub deps { \@{ \$self->{deps} }; } sub Inline { my (\$class, \$lang) = \@_; +{ map { (uc(\$_) => \$self->{\$_}) } qw(inc libs typemaps) }; } EOT print $file "\n1;\n"; close $file; # we need to ensure that the file we just created gets put into # the install dir with everything else. #$self->install ($filename); $self->add_pm ($filename, $self->installed_filename ('Files.pm')); } sub load { my $dep = shift; my @pieces = split /::/, $dep; my @suffix = qw/ Install Files /; # not File::Spec - see perldoc -f require my $relpath = join('/', @pieces, @suffix) . '.pm'; my $depinstallfiles = join "::", @pieces, @suffix; eval { require $relpath } or die " *** Can't load dependency information for $dep:\n $@\n"; #print Dumper(\%INC); # effectively $instpath = dirname($INC{$relpath}) my ($vol,$dirs,$file) = File::Spec->splitpath($INC{$relpath}); my $instpath = File::Spec->catpath($vol,$dirs,''); no strict; croak "No dependency information found for $dep" unless $instpath; if (not File::Spec->file_name_is_absolute ($instpath)) { $instpath = File::Spec->rel2abs ($instpath); } # this will not exist when loading files from old versions # of ExtUtils::Depends. my @deps = eval { $depinstallfiles->deps }; @deps = @{"$depinstallfiles\::deps"} if $@ and exists ${"$depinstallfiles\::"}{deps}; my (@typemaps, $inc, $libs); my $inline = eval { $depinstallfiles->Inline('C') }; if (!$@) { $inc = $inline->{INC} || ''; $libs = $inline->{LIBS} || ''; @typemaps = @{ $inline->{TYPEMAPS} || [] }; } else { $inc = ${"$depinstallfiles\::inc"} || ''; $libs = ${"$depinstallfiles\::libs"} || ''; @typemaps = @{"$depinstallfiles\::typemaps"}; } @typemaps = map { File::Spec->rel2abs ($_, $instpath) } @typemaps; { instpath => $instpath, typemaps => \@typemaps, inc => "-I". _quote_if_space($instpath) ." $inc", libs => $libs, deps => \@deps, } } sub _quote_if_space { $_[0] =~ / / ? qq{"$_[0]"} : $_[0] } sub load_deps { my $self = shift; my @load = grep !$self->{deps}{$_}, keys %{ $self->{deps} }; my %in_load; @in_load{@load} = (); while (@load) { my $d = shift @load; $self->{deps}{$d} = my $dep = load($d); my @new_deps = grep !($self->{deps}{$_} || exists $in_load{$_}), @{ $dep->{deps} || [] }; push @load, @new_deps; @in_load{@new_deps} = (); } } sub uniquify { my %seen; grep !$seen{$_}++, @_; } sub get_makefile_vars { my $self = shift; # collect and uniquify things from the dependencies. # first, ensure they are completely loaded. $self->load_deps; my @incbits = @{ $self->{inc} }; my @libsbits = $self->{libs}; my @typemaps = @{ $self->{typemaps} }; foreach my $d (sort keys %{ $self->{deps} }) { my $dep = $self->{deps}{$d}; push @incbits, @{ $dep->{defines} } if $dep->{defines}; push @incbits, $dep->{inc} if $dep->{inc}; push @libsbits, $dep->{libs} if $dep->{libs}; push @typemaps, @{ $dep->{typemaps} } if $dep->{typemaps}; } # we have a fair bit of work to do for the xs files... my @clean = (); my @OBJECT = (); my %XS = (); foreach my $xs (@{ $self->{xs} }) { (my $c = $xs) =~ s/\.xs$/\.c/i; (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i; $XS{$xs} = $c; push @OBJECT, $o; # according to the MakeMaker manpage, the C files listed in # XS will be added automatically to the list of cleanfiles. push @clean, $o; } # we may have C files, as well: foreach my $c (@{ $self->{c} }) { (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; push @OBJECT, $o; push @clean, $o; } my %vars = ( INC => join (' ', uniquify @incbits), LIBS => join (' ', uniquify @libsbits), LDFROM => join (' ', '$(OBJECT)', map _quote_if_space($_), find_extra_libs($self->{deps}, \@INC)), TYPEMAPS => \@typemaps, ); # we don't want to provide these if there is no data in them; # that way, the caller can still get default behavior out of # MakeMaker when INC, LIBS and TYPEMAPS are all that are required. $vars{PM} = $self->{pm} if %{ $self->{pm} }; $vars{clean} = { FILES => join (" ", @clean), } if @clean; $vars{OBJECT} = join (" ", @OBJECT) if @OBJECT; $vars{XS} = \%XS if %XS; %vars; } # Search for extra library files to link against on Windows (either native # Windows library # files, or Cygwin library files) # NOTE: not meant to be called publicly, so no POD documentation # see https://rt.cpan.org/Ticket/Display.html?id=45224 for discussion my %exts; BEGIN { %exts = ( MSWin32 => [ ".lib", ".$Config{dlext}", $Config{_a} ], cygwin => [ '.dll' ], android => [ ".$Config{dlext}" ], ); } sub find_extra_libs { my ($deps, $search) = @_; return () if !keys %$deps; return () unless my $exts = $exts{$^O}; require File::Spec::Functions; my @found_libs = (); DEP: foreach my $name (keys %$deps) { my @parts = ('auto', split /::/, $name); my $stem = defined &DynaLoader::mod2fname ? DynaLoader::mod2fname(\@parts) : $parts[-1]; my @bases = map $stem.$_, @$exts; for my $dir (grep -d, @$search) { # only extant dirs my ($found) = grep -f, map File::Spec::Functions::catfile($dir, @parts, $_), @bases; next if !defined $found; push @found_libs, $found; next DEP; } } @found_libs; } 1; __END__ =head1 NAME ExtUtils::Depends - Easily build XS extensions that depend on XS extensions =head1 SYNOPSIS use ExtUtils::Depends; $package = new ExtUtils::Depends ('pkg::name', 'base::package') # set the flags and libraries to compile and link the module $package->set_inc("-I/opt/blahblah"); $package->set_libs("-lmylib"); # add a .c and an .xs file to compile $package->add_c('code.c'); $package->add_xs('module-code.xs'); # add the typemaps to use $package->add_typemaps("typemap"); # install some extra data files and headers $package->install (qw/foo.h data.txt/); # save the info $package->save_config('Files.pm'); WriteMakefile( 'NAME' => 'Mymodule', $package->get_makefile_vars() ); =head1 DESCRIPTION This module tries to make it easy to build Perl extensions that use functions and typemaps provided by other perl extensions. This means that a perl extension is treated like a shared library that provides also a C and an XS interface besides the perl one. This works as long as the base (or "producing") extension is loaded with the C flag (usually done with a sub dl_load_flags {0x01} in the main F<.pm> file) if you need to use functions defined in the module. That "producing" extension will also need to tell L the specific functions to export, with arguments to C like: FUNCLIST => [qw(function_name)], DL_FUNCS => { 'Extension::Name' => [] }, The basic scheme of operation is to collect information about a module in the instance, and then store that data in the Perl library where it may be retrieved later. The object can also reformat this information into the data structures required by ExtUtils::MakeMaker's WriteMakefile function. For information on how to make your module fit into this scheme, see L. When creating a new Depends object, you give it a name, which is the name of the module you are building. You can also specify the names of modules on which this module depends. These dependencies will be loaded automatically, and their typemaps, header files, etc merged with your new object's stuff. When you store the data for your object, the list of dependencies are stored with it, so that another module depending on your needn't know on exactly which modules yours depends. For example: Gtk2 depends on Glib Gnome2::Canvas depends on Gtk2 ExtUtils::Depends->new ('Gnome2::Canvas', 'Gtk2'); this command automatically brings in all the stuff needed for Glib, since Gtk2 depends on it. When the configuration information is saved, it also includes a class method called C, inheritable by your module. This allows you in your module to simply say at the top: package Mymod; use parent 'Mymod::Install::Files'; # to inherit 'Inline' method And users of C who want to write inline code (using L) will simply be able to write: use Inline with => 'Mymod'; And all the necessary header files, defines, and libraries will be added for them. The C will also implement a C method, which will return a list of any modules that C depends on - you will not normally need to use this: require Mymod::Install::Files; @deps = Mymod::Install::Files->deps; =head1 METHODS =over =item $object = ExtUtils::Depends->new($name, @deps) Create a new depends object named I<$name>. Any modules listed in I<@deps> (which may be empty) are added as dependencies and their dependency information is loaded. An exception is raised if any dependency information cannot be loaded. =item $depends->add_deps (@deps) Add modules listed in I<@deps> as dependencies. =item (hashes) = $depends->get_deps Fetch information on the dependencies of I<$depends> as a hash of hashes, which are dependency information indexed by module name. See C. =item $depends->set_inc (@newinc) Add strings to the includes or cflags variables. =item $depends->set_libs (@newlibs) Add strings to the libs (linker flags) variable. =item $depends->add_pm (%pm_files) Add files to the hash to be passed through ExtUtils::WriteMakefile's PM key. =item $depends->add_xs (@xs_files) Add xs files to be compiled. =item $depends->add_c (@c_files) Add C files to be compiled. =item $depends->add_typemaps (@typemaps) Add typemap files to be used and installed. =item $depends->add_headers (list) No-op, for backward compatibility. =item $depends->install (@files) Install I<@files> to the data directory for I<$depends>. This actually works by adding them to the hash of pm files that gets passed through WriteMakefile's PM key. =item $depends->save_config ($filename) Save the important information from I<$depends> to I<$filename>, and set it up to be installed as I::Install::Files. Note: the actual value of I<$filename> is unimportant so long as it doesn't clash with any other local files. It will be installed as I::Install::Files. =item hash = $depends->get_makefile_vars Return the information in I<$depends> in a format digestible by WriteMakefile. This sets at least the following keys: INC LIBS TYPEMAPS PM And these if there is data to fill them: clean OBJECT XS =item hashref = ExtUtils::Depends::load (name) Load and return dependency information for I. Croaks if no such information can be found. The information is returned as an anonymous hash containing these keys: =over =item instpath The absolute path to the data install directory for this module. =item typemaps List of absolute pathnames for this module's typemap files. =item inc CFLAGS string for this module. =item libs LIBS string for this module. =item deps List of modules on which this one depends. This key will not exist when loading files created by old versions of ExtUtils::Depends. =back If you want to make module I support this, you must provide a module I::Install::Files, which on loading will implement the following class methods: $hashref = name::Install::Files->Inline('C'); # hash to contain any necessary TYPEMAPS (array-ref), LIBS, INC @deps = name::Install::Files->deps; # any modules on which "name" depends An easy way to achieve this is to use the method Lsave_config ($filename)">, but your package may have different facilities already. =item $depends->load_deps Load I<$depends> dependencies, by calling C on each dependency module. This is usually done for you, and should only be needed if you want to call C after calling C manually. =back =head1 SUPPORT =head2 Bugs/Feature Requests Version 0.2 discards some of the more esoteric features provided by the older versions. As they were completely undocumented, and this module has yet to reach 1.0, this may not exactly be a bug. This module is tightly coupled to the ExtUtils::MakeMaker architecture. You can submit new bugs/feature requests by using one of two bug trackers (below). =over =item CPAN Request Tracker You can submit bugs/feature requests via the web by going to L (requires PAUSE ID or Bitcard), or by sending an e-mail to L. =item Gnome.org Bugtracker Report bugs/feature requests to 'perl-extutils-depends' (requires login) L =back Patches that implement new features with test cases, and/or test cases that exercise existing bugs are always welcome. The Gtk-Perl support forum is at L =head2 Source Code The source code to L is available at the Gnome.org Git repo (L). Create your own copy of the Git repo with: git clone git://git.gnome.org/perl-ExtUtils-Depends (Git protocol) git clone https://git.gnome.org/browse/perl-ExtUtils-Depends/ (HTTPS) =head1 SEE ALSO ExtUtils::MakeMaker. =head1 AUTHOR Paolo Molaro wrote the original version for Gtk-Perl. muppet rewrote the innards for version 0.2, borrowing liberally from Paolo's code. =head1 MAINTAINER The Gtk2 project, L/L. =head1 LICENSE This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself. =cut ExtUtils-Depends-0.8002/README0000644000175000017500000002217214766437767015611 0ustar osboxesosboxesNAME ExtUtils::Depends - Easily build XS extensions that depend on XS extensions SYNOPSIS use ExtUtils::Depends; $package = new ExtUtils::Depends ('pkg::name', 'base::package') # set the flags and libraries to compile and link the module $package->set_inc("-I/opt/blahblah"); $package->set_libs("-lmylib"); # add a .c and an .xs file to compile $package->add_c('code.c'); $package->add_xs('module-code.xs'); # add the typemaps to use $package->add_typemaps("typemap"); # install some extra data files and headers $package->install (qw/foo.h data.txt/); # save the info $package->save_config('Files.pm'); WriteMakefile( 'NAME' => 'Mymodule', $package->get_makefile_vars() ); DESCRIPTION This module tries to make it easy to build Perl extensions that use functions and typemaps provided by other perl extensions. This means that a perl extension is treated like a shared library that provides also a C and an XS interface besides the perl one. This works as long as the base (or "producing") extension is loaded with the "RTLD_GLOBAL" flag (usually done with a sub dl_load_flags {0x01} in the main .pm file) if you need to use functions defined in the module. That "producing" extension will also need to tell ExtUtils::MakeMaker the specific functions to export, with arguments to "WriteMakefile" like: FUNCLIST => [qw(function_name)], DL_FUNCS => { 'Extension::Name' => [] }, The basic scheme of operation is to collect information about a module in the instance, and then store that data in the Perl library where it may be retrieved later. The object can also reformat this information into the data structures required by ExtUtils::MakeMaker's WriteMakefile function. For information on how to make your module fit into this scheme, see "hashref = ExtUtils::Depends::load (name)". When creating a new Depends object, you give it a name, which is the name of the module you are building. You can also specify the names of modules on which this module depends. These dependencies will be loaded automatically, and their typemaps, header files, etc merged with your new object's stuff. When you store the data for your object, the list of dependencies are stored with it, so that another module depending on your needn't know on exactly which modules yours depends. For example: Gtk2 depends on Glib Gnome2::Canvas depends on Gtk2 ExtUtils::Depends->new ('Gnome2::Canvas', 'Gtk2'); this command automatically brings in all the stuff needed for Glib, since Gtk2 depends on it. When the configuration information is saved, it also includes a class method called "Inline", inheritable by your module. This allows you in your module to simply say at the top: package Mymod; use parent 'Mymod::Install::Files'; # to inherit 'Inline' method And users of "Mymod" who want to write inline code (using Inline) will simply be able to write: use Inline with => 'Mymod'; And all the necessary header files, defines, and libraries will be added for them. The "Mymod::Install::Files" will also implement a "deps" method, which will return a list of any modules that "Mymod" depends on - you will not normally need to use this: require Mymod::Install::Files; @deps = Mymod::Install::Files->deps; METHODS $object = ExtUtils::Depends->new($name, @deps) Create a new depends object named *$name*. Any modules listed in *@deps* (which may be empty) are added as dependencies and their dependency information is loaded. An exception is raised if any dependency information cannot be loaded. $depends->add_deps (@deps) Add modules listed in *@deps* as dependencies. (hashes) = $depends->get_deps Fetch information on the dependencies of *$depends* as a hash of hashes, which are dependency information indexed by module name. See "load". $depends->set_inc (@newinc) Add strings to the includes or cflags variables. $depends->set_libs (@newlibs) Add strings to the libs (linker flags) variable. $depends->add_pm (%pm_files) Add files to the hash to be passed through ExtUtils::WriteMakefile's PM key. $depends->add_xs (@xs_files) Add xs files to be compiled. $depends->add_c (@c_files) Add C files to be compiled. $depends->add_typemaps (@typemaps) Add typemap files to be used and installed. $depends->add_headers (list) No-op, for backward compatibility. $depends->install (@files) Install *@files* to the data directory for *$depends*. This actually works by adding them to the hash of pm files that gets passed through WriteMakefile's PM key. $depends->save_config ($filename) Save the important information from *$depends* to *$filename*, and set it up to be installed as *name*::Install::Files. Note: the actual value of *$filename* is unimportant so long as it doesn't clash with any other local files. It will be installed as *name*::Install::Files. hash = $depends->get_makefile_vars Return the information in *$depends* in a format digestible by WriteMakefile. This sets at least the following keys: INC LIBS TYPEMAPS PM And these if there is data to fill them: clean OBJECT XS hashref = ExtUtils::Depends::load (name) Load and return dependency information for *name*. Croaks if no such information can be found. The information is returned as an anonymous hash containing these keys: instpath The absolute path to the data install directory for this module. typemaps List of absolute pathnames for this module's typemap files. inc CFLAGS string for this module. libs LIBS string for this module. deps List of modules on which this one depends. This key will not exist when loading files created by old versions of ExtUtils::Depends. If you want to make module *name* support this, you must provide a module *name*::Install::Files, which on loading will implement the following class methods: $hashref = name::Install::Files->Inline('C'); # hash to contain any necessary TYPEMAPS (array-ref), LIBS, INC @deps = name::Install::Files->deps; # any modules on which "name" depends An easy way to achieve this is to use the method "$depends->save_config ($filename)", but your package may have different facilities already. $depends->load_deps Load *$depends* dependencies, by calling "load" on each dependency module. This is usually done for you, and should only be needed if you want to call "get_deps" after calling "add_deps" manually. SUPPORT Bugs/Feature Requests Version 0.2 discards some of the more esoteric features provided by the older versions. As they were completely undocumented, and this module has yet to reach 1.0, this may not exactly be a bug. This module is tightly coupled to the ExtUtils::MakeMaker architecture. You can submit new bugs/feature requests by using one of two bug trackers (below). CPAN Request Tracker You can submit bugs/feature requests via the web by going to (requires PAUSE ID or Bitcard), or by sending an e-mail to "bug-ExtUtils-Depends at rt.cpan.org". Gnome.org Bugtracker Report bugs/feature requests to 'perl-extutils-depends' (requires login) Patches that implement new features with test cases, and/or test cases that exercise existing bugs are always welcome. The Gtk-Perl support forum is at Source Code The source code to ExtUtils::Depends is available at the Gnome.org Git repo (). Create your own copy of the Git repo with: git clone git://git.gnome.org/perl-ExtUtils-Depends (Git protocol) git clone https://git.gnome.org/browse/perl-ExtUtils-Depends/ (HTTPS) SEE ALSO ExtUtils::MakeMaker. AUTHOR Paolo Molaro wrote the original version for Gtk-Perl. muppet rewrote the innards for version 0.2, borrowing liberally from Paolo's code. MAINTAINER The Gtk2 project, /"gtk-perl-list at gnome dot org". LICENSE This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself. ExtUtils-Depends-0.8002/MANIFEST0000644000175000017500000000111314766437767016052 0ustar osboxesosboxesChanges lib/ExtUtils/Depends.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP perl-ExtUtils-Depends.spec.in README t/02_save_load.t t/03_deps.t t/04_extra_libs.t t/05_unc.t t/inc/auto/DepTest/DepTest.a t/inc/auto/DepTest/DepTest.dll t/inc/auto/DepTest/DepTest.dll.a t/inc/auto/DepTest/DepTest.lib t/inc/auto/DepTest/DepTest.so t/inc/auto/DepTest/DepTest.xs.dll t/inc/DepTest/Install/.keep t/lib/TestHelper.pm META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) ExtUtils-Depends-0.8002/Makefile.PL0000644000175000017500000000637314766436636016702 0ustar osboxesosboxes#!/usr/bin/perl # We require 5.6 for sanity in general, and for 'our' in particular. use 5.006; use ExtUtils::MakeMaker; my %prereqs = ( 'File::Spec' => 0, 'Data::Dumper' => 0, 'IO::File' => 0, 'ExtUtils::MakeMaker' => '7.44', # no need for Win32 static_lib hack ); my %meta_merge = ( q(meta-spec) => { version => '2', url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', }, author => ['Gtk2-Perl Team '], release_status => 'stable', # valid values: https://metacpan.org/module/CPAN::Meta::Spec#license license => 'perl_5', resources => { license => 'http://dev.perl.org/licenses/', homepage => 'http://gtk2-perl.sourceforge.net', x_MailingList => 'https://mail.gnome.org/mailman/listinfo/gtk-perl-list', bugtracker => { web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends', mailto => 'bug-ExtUtils-Depends [at] rt.cpan.org', }, repository => { url => 'git://git.gnome.org/perl-ExtUtils-Depends', type => 'git', web => 'http://git.gnome.org/browse/perl-ExtUtils-Depends', }, }, prereqs => { configure => { requires => {%prereqs}, # no direct ref for 5.14 compatibility }, test => { requires => { 'Test::More' => '0.88', # done_testing }, recommends => { 'Test::Number::Delta' => 1.0, }, }, }, keywords => ['XS', 'XS extensions', 'dependency'], ); WriteMakefile( dist => { $^O eq 'MSWin32' ? () : (PREOP => 'pod2text lib/ExtUtils/Depends.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;'), COMPRESS => 'gzip -9v', SUFFIX => '.gz', }, NAME => 'ExtUtils::Depends', VERSION_FROM => 'lib/ExtUtils/Depends.pm', PREREQ_PM => \%prereqs, MIN_PERL_VERSION => 5.006, #for META.yml META_MERGE => \%meta_merge, LICENSE => 'perl', ); use Cwd; sub MY::postamble { # none of this rpm stuff is useful on win32, and actually it can cause # nmake to barf. return @_ if $^O eq 'MSWin32'; my @dirs = qw{$(RPMS_DIR) $(RPMS_DIR)/BUILD $(RPMS_DIR)/RPMS $(RPMS_DIR)/SOURCES $(RPMS_DIR)/SPECS $(RPMS_DIR)/SRPMS}; my $cwd = getcwd(); chomp (my $date = `date +"%a %b %d %Y"`); my %subs = ( 'VERSION' => '$(VERSION)', 'SOURCE' => '$(DISTNAME)-$(VERSION).tar.gz', 'DATE' => $date, ); my $substitute = '$(PERL) -npe \''.join('; ', map { "s/\\\@$_\\\@/$subs{$_}/g"; } keys %subs).'\''; " realclean :: -\$(RM_F) perl-\$(DISTNAME).spec RPMS_DIR=\$(HOME)/rpms \$(RPMS_DIR)/: -mkdir @dirs SUBSTITUTE=$substitute perl-\$(DISTNAME).spec :: perl-\$(DISTNAME).spec.in \$(VERSION_FROM) Makefile \$(SUBSTITUTE) \$< > \$@ dist-rpms :: Makefile dist perl-\$(DISTNAME).spec \$(RPMS_DIR)/ cp \$(DISTNAME)-\$(VERSION).tar.gz \$(RPMS_DIR)/SOURCES/ rpmbuild -ba --define \"_topdir \$(RPMS_DIR)\" perl-\$(DISTNAME).spec dist-srpms :: Makefile dist perl-\$(DISTNAME).spec \$(RPMS_DIR)/ cp \$(DISTNAME)-\$(VERSION).tar.gz \$(RPMS_DIR)/SOURCES/ rpmbuild -bs --define \"_topdir \$(RPMS_DIR)\" perl-\$(DISTNAME).spec " }