Dist::Zilla::Plugin::Alien - Use Alien::Base with Dist::Zilla
In your dist.ini:
name = Alien-myapp [Alien] repo = http://myapp.org/releases bins = myapp myapp_helper # the following parameters are based on the dist name automatically name = myapp pattern_prefix = myapp- pattern_version = ([\d\.]+) pattern_suffix = \.tar\.gz pattern = myapp-([\d\.]+)\.tar\.gz # commands used to build (optional) build_command = %pconfigure --prefix=%s # ... # commands uses to install (optional) install_command = make install
This is a simple wrapper around Alien::Base, to make it very simple to generate a distribution that uses it. You only need to make a module like in this case Alien::myapp which extends Alien::Base and additionally a url that points to the path where the downloadable .tar.gz of the application or library can be found. For more informations about the parameter, please checkout also the Alien::Base documentation. The repo paramter is automatically taken apart to supply the procotol, host and other parameters for Alien::Base.
Warning: Please be aware that Alien::Base uses Module::Build, which means you shouldn't have Dist::Zilla::Plugin::MakeMaker loaded. For our case, this means, you can't just easily use it together with the common Dist::Zilla::PluginBundle::Basic, because this includes it. As alternative you can use Dist::Zilla::PluginBundle::Alien which is also included in this distribution.
The only required parameter, defines the path for the packages of the product you want to alienfy. This must not include the filename.
To indicate a local repository use the
# located in the base directory repo = file:. # located in the inc/ directory relative to the base repo = file:inc
The pattern is used to define the filename to be expected from the repo of the alienfied product. It is set together out of pattern_prefix, pattern_version and pattern_suffix. pattern_prefix is by default "name" together with a dash.
A space or tab seperated list of all binaries that should be wrapped to be executable from the perl environment (if you use perlbrew or local::lib this also guarantees that its available via the PATH).
The name of the Alien package, this is used for the pattern matching filename. If none is given, then the name of the distribution is used, but the Alien- is cut off.
The ordered sequence of commands used to build the distribution (passed to the
alien_build_commands option). This is optional.
# configure then make build_command = %pconfigure --prefix=%s build_command = make
The ordered sequence of commands used to install the distribution (passed to the
alien_install_commands option). This is optional.
install_command = make install
The method Alien::Base is using would compile the complete Alien 2 times, if you use it in combination with Dist::Zilla::Plugin::InstallRelease. One time at the test, and then again after release. With a small trick, you can avoid this. You can use Dist::Zilla::Plugin::Run to add an additional test which installs out of the unpacked distribution for the testing:
[Run::Test] run_if_release = ./Build install
This will do the trick :). Be aware, that you need to add this plugin after [ModuleBuild]. You can use Dist::Zilla::PluginBundle::Author::GETTY, which directly use this trick in the right combination.
Torsten Raudssus <firstname.lastname@example.org>
This software is copyright (c) 2013 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.