WWW::AUR - API for the Archlinux User Repository website.
use WWW::AUR; my $aur = WWW::AUR->new( basepath => '/tmp/aurtmp' ); my $pkg = $aur->find( 'perl-www-aur' ); # download_size() can check the file size without downloading... printf "Preparing to download source package file (%d bytes).\n", $pkg->download_size; $pkg->download; printf "Downloaded pkgfile to %s.\n", $pkg->src_pkg_path; $pkg->extract; # calls download() if you didn't printf "Extracted pkgfile to %s.\n", $pkg->src_dir_path; $pkg->build; # calls extract() if you didn't printf "Built binary pkgfile and saved to %s.\n", $pkg->bin_pkg_path; my $who = $pkg->maintainer(); printf "%s is maintained by %s.\n", $pkg->name, $who->name; print "Here is all of their maintained packages:\n"; for my $otherpkg ( $who->packages ) { printf " - %s\n", $otherpkg->name; } my $login = $aur->login( 'myname', 'mypassword' ) or die "Failed to login as myname, what a shock"; $login->vote( 'my-favorite-package' ); $login->disown( 'i-hate-this-package' ); $login->upload( '../a-new-package-file.src.pkg.tar.gz', 'lib' ); print "Iterating through ALL packages...\n"; my $iter = $aur->packages; while ( my $pkgobj = $iter->next ) { my %info = $pkgobj->info; print "$info{name} -- $info{version}\n"; }
The Archlinux User Repository is a relatively simple website that houses user-submitted packages for ArchLinux. These "source packages" merely contain what is required to build the package, unlike Archlinux's official repository which house binary packages.
This module provides an interface for the straight-forward AUR user as well as for AUR author, aka package maintainers. The goal is to be able to do anything with this module that you could with a web browser.
The WWW::AUR::Package module also allows the module user to download and build source packages using makepkg. Installation is left up to the module user and is not implemented in this module.
$OBJ = WWW::AUR->new( %PATH_PARAMS? );
%PATH_PARAMS
These parameters are optional. See "PATH PARAMETERS".
$OBJ
A WWW::AUR object.
WWW::AUR
@PACKAGES = $OBJ->search( $QUERY );
$QUERY
A string to match package names against. The string can have regexp anchors (^ or $).
If $QUERY contains anchors then only package names that match the anchored text are returned. Other special regexp chars will be sent to the query literally. Since the AUR does not directly support regexp searches this will most likely return unexpected results.
@PACKAGES
A list of WWW::AUR::Package objects that matched the search query.
$PKGOBJ | undef = $OBJ->find( $NAME )
$NAME
The exact name of a package to find.
$PKGOBJ
A WWW::AUR::Package object if one was found.
undef
If no package matching the given $NAME was found.
$MAINOBJ | undef = $OBJ->maintainer( $NAME );
The name of the maintainer to find. Case-insensitive.
$MAINOBJ
A WWW::AUR::Maintainer object if a matching maintainer was found.
If no matching maintainer was found.
$ITEROBJ = $OBJ->iter()
$ITEROBJ
A WWW::AUR::Iterator object.
$LOGINOBJ | undef = $OBJ->login( $USERNAME, $PASSWORD );
$USERNAME
The maintainer name to login to the AUR with.
$PASSWORD
The password to use for logging in.
$LOGINOBJ
A WWW::AUR::Login object, if the login succeeded.
If the login failed.
The constructor's only parameters are for paths to use in objects. Path parameters are propogated to every WWW::AUR::Package object that is created. Package objects are created when using methods such as "search" and "find".
Path parameters are also propogated to objects that create their own WWW::AUR::Package object, in turn. For example they are propogated to the WWW::AUR::Maintainer object created by "maintainer", the WWW::AUR::Login object created by "login", and the WWW::AUR::Iterator object created by "packages".
Path parameters are given as a hash with the keys as follows:
Specifies a base with which to set the dlpath, extpath, and destpath quickly. Setting the base path sets the other path parameters to paths relative to the basepath.
dlpath
extpath
destpath
After the 'basepath' is set, other path parameters can still be overriden with their own values.
Defaults to /tmp/WWW-AUR.
/tmp/WWW-AUR
A directory to store downloaded source package files.
Defaults to $basepath/src.
$basepath/src
A directory to store source package directories. These are extracted from the source package file.
Defaults to $basepath/build.
$basepath/build
A directory to store built binary package files. Binary package files are built from the source package files by using makepkg.
makepkg
Defaults to $basepath/cache.
$basepath/cache
http://github.com/jnbek/perl-www-aur
http://aur.archlinux.org
http://www.archlinux.org/pacman/makepkg.8.html
John D Jones III, <jnbek at cpan dot org>
<jnbek at cpan dot org>
Justin Davis, <juster at cpan dot org>
<juster at cpan dot org>
Mr Davis created and maintained this awesome module for many years. After the AUR4 migration, he became unable to devote the time needed to maintain this module any longer and blessed me with taking over this module's maintainership. Thanks Justin for doing all the real work on this module and making it so all I needed to do was update a few lines of code here and there and update a couple of tests.
Please email me any bugs you find. I will try to fix them as quick as I can.
Send me an email if you have any questions or need help.
Copyright 2014-2015 Justin Davis.
Copyright 2015-2016 John D Jones III
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install WWW::AUR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::AUR
CPAN shell
perl -MCPAN -e shell install WWW::AUR
For more information on module installation, please visit the detailed CPAN module installation guide.