diff options
author | Piotr Rogoża | 2015-06-14 16:35:04 +0200 |
---|---|---|
committer | Piotr Rogoża | 2015-06-14 16:35:04 +0200 |
commit | bf1a3a0550a8a83eb85ccd51185b8408dd752cf3 (patch) | |
tree | 578582fff44204fe9523b5dbf70d1b495771f51f | |
download | aur-bf1a3a0550a8a83eb85ccd51185b8408dd752cf3.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 70 | ||||
-rw-r--r-- | arch.patch | 64 |
3 files changed, 152 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a1e3f14e7bbe --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = perl-linux-distribution-packages + pkgdesc = Linux::Distribution::Packages - list all packages on various Linux distributions + pkgver = 0.05 + pkgrel = 4 + url = http://search.cpan.org/dist/Linux-Distribution-Packages/ + arch = any + license = GPL + license = PerlArtistic + depends = perl-linux-distribution + depends = perl-xml-writer + options = !emptydirs + source = http://search.cpan.org/CPAN/authors/id/J/JU/JUDITH/Linux-Distribution-Packages-0.05.tar.gz + source = arch.patch + sha256sums = 0879aaa0e0c03c0dcd02f7692f7f7f5fcd6c801435ee61603a1de2e76d99e4bd + sha256sums = 2c667e554155e2acf415e5fcc5662b09fd0c7e7a547eef4785619c702fc51186 + +pkgname = perl-linux-distribution-packages + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..74896baf2578 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Piotr Rogoza <piotr dot r dot public at gmail dot com> +# Contributor: Piotr Rogoza <piotr dot r dot public at gmail dot com> + +_author=J/JU/JUDITH +_perlmod=Linux-Distribution-Packages +pkgname=perl-linux-distribution-packages +pkgver=0.05 +pkgrel=4 +pkgdesc='Linux::Distribution::Packages - list all packages on various Linux distributions' +arch=('any') +url="http://search.cpan.org/dist/Linux-Distribution-Packages/" +license=('GPL' 'PerlArtistic') +depends=( +perl-linux-distribution +perl-xml-writer +) +options=(!emptydirs) +source=("http://search.cpan.org/CPAN/authors/id/$_author/$_perlmod-$pkgver.tar.gz" +arch.patch +) +sha256sums=('0879aaa0e0c03c0dcd02f7692f7f7f5fcd6c801435ee61603a1de2e76d99e4bd' + '2c667e554155e2acf415e5fcc5662b09fd0c7e7a547eef4785619c702fc51186') +prepare(){ + cd "$srcdir"/$_perlmod-$pkgver + patch -p0 -i "$srcdir"/arch.patch +} +build(){ + cd "$srcdir"/$_perlmod-$pkgver + + # Setting these env variables overwrites any command-line-options we don't want... + export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \ + PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \ + PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \ + MODULEBUILDRC=/dev/null + + # If using Makefile.PL + if [ -r Makefile.PL ]; then + /usr/bin/perl Makefile.PL + make + # If using Build.PL + elif [ -r Build.PL ]; then + /usr/bin/perl Build.PL + perl Build + fi +} +check(){ + cd "$srcdir"/$_perlmod-$pkgver + + # If using Makefile.PL + if [ -r Makefile.PL ]; then + make test + # If using Build.PL + elif [ -r Build.PL ]; then + perl Build test + fi +} +package(){ + cd "$srcdir"/$_perlmod-$pkgver + + # If using Makefile.PL + if [ -r Makefile.PL ]; then + make install + # If using Build.PL + elif [ -r Build.PL ]; then + perl Build install + fi + + # remove perllocal.pod and .packlist + find "$pkgdir" -name .packlist -o -name perllocal.pod -delete +} diff --git a/arch.patch b/arch.patch new file mode 100644 index 000000000000..5f43a3b4a577 --- /dev/null +++ b/arch.patch @@ -0,0 +1,64 @@ +--- lib/Linux/Distribution/Packages.pm 2006-04-19 22:18:09.000000000 +0200 ++++ lib/Linux/Distribution/Packages.pm.new 2011-11-29 23:18:56.000000000 +0100 +@@ -17,6 +17,7 @@ + 'slackware' => 'pkgtool', + 'suse' => 'rpm', + 'ubuntu' => 'dpkg', ++ 'arch' => 'pacman', + ); + + our @EXPORT_OK = qw(distribution_packages distribution_write format); +@@ -99,7 +100,7 @@ + if (defined $self->{'output_file'}){ + require IO::File; + $output = new IO::File(">$self->{'output_file'}"); +- $writer_options->{'OUTPUT'} = $output; ++ $writer_options->{'OUTPUT'} = $output; + } + if ($self->{'format'} =~ m/xml/i){ + $writer = new XML::Writer(%{$writer_options}); +@@ -183,6 +184,44 @@ + } + } + ++return 1; ++ ++package Linux::Distribution::Packages::pacman; ++use base qw(Linux::Distribution::Packages); ++ ++sub _command { ++ my $self = shift; ++ $self->SUPER::_command('pacman -Qs'); ++} ++ ++sub _parse { ++ my $self = shift; ++ my @data = split '\n', $self->{_data}; ++ my $writer=shift; ++ my $count = 1; ++ my ($pkg, $ver, $desc); ++ PACKAGE: ++ foreach my $row (@data){ ++ if ( $count % 2 ){ ++ # odd rows with program name and version ++ ($pkg, $ver) = $row =~ m{^local/([\S]+)\s([\S]+)}xms; ++ } ++ else { ++ # even rows with description ++ chomp $row; ++ ($desc) = $row =~ m{^\s+(.*)$}xms; ++ if ($self->{'format'} =~ m/xml/i){ ++ $writer->emptyTag('package', 'name' => $pkg, 'version' => $ver , 'description' => $desc); ++ $count++; ++ next PACKAGE; ++ } ++ my $row_func='_row_' . $self->{'format'}; ++ $self->$row_func($pkg, $ver, $desc); ++ } ++ $count++; ++ } ++} ++ + return 1; + + package Linux::Distribution::Packages::dpkg; |