You are not logged in.

#1 2009-03-25 01:16:12

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Another perl module packager

CPANPLUS::Dist::Arch is a CPANPLUS backend to automatically package modules as you install them.  I started it several months ago and mess around with it every once and awhile.  I had made it because CPANPLUS::Dist::Pacman (or maybe I should say cpan4pacman?) did not work well for me.  I did not have ABS installed and it didn't seem to work without it.

I feel a bit awkward releasing this since Xyne recently released pacpan.  Yet, I think the two programs are distinct enough to stand on their own.

I have uploaded the module to CPAN and AUR.  If you'd like to try it, the perl-cpanplus-dist-arch package is on the AUR, which also requires the perl-readonly to run.

BTW, I introduced a bug into the latest version 0.5, which gives the wrong url entry for the PKGBUILD.  This doesn't seem to break anything but it is a nuisance when making an AUR package... as I found out.

If you'd like to try it, it helps to be familiar with CPANPLUS, which can be frustrating but its worth it.  If you never used CPANPLUS before, make sure that the 'cpanp' command is in your path.  It is in the /usr/bin/perlbin/core directory, so you can add it to your path by putting a line like this in your ~/.profile file:

export PATH=/bin:/usr/bin:/usr/bin/perlbin/core:/usr/bin/perlbin/vendor

I forgot to include the above step in the documentation.  After installing the package from AUR, you can read the included doc by typing 'man CPANPLUS::Dist::Arch' or 'perldoc CPANPLUS::Dist::Arch'.  Please read the doc to see how to setup.  (It's at the very beginning)

edit: I meant cpan4pacman uses ABS, not AUR

Last edited by juster (2009-03-25 15:44:29)

Offline

#2 2009-03-25 15:50:47

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: Another perl module packager

Here is the beginning of the docs, copy & pasted, that give the setup instructions I was too much in a hurry to show earlier.  The full doc is also available online at CPAN.

SYNOPSIS

This module is not meant to be used directly. Instead you should use it through the cpanp shell or the cpan2dist utility that is included with CPANPLUS.

  $ cpan2dist --format CPANPLUS::Dist::Arch Acme::Bleach

This lengthly command line can be shortened by specifying CPANPLUS::Dist::Arch as the default 'Dist' type to use in CPANPLUS's configuration, like so:

  $ cpanp

  ... CPANPLUS's startup output here ...

  CPAN Terminal> s conf dist_type CPANPLUS::Dist::Arch

  Key 'dist_type' was set to 'CPANPLUS::Dist::Arch'
  CPAN Terminal> s save

  Configuration successfully saved to CPANPLUS::Config::User
      (/home/<yournamehere>/.cpanplus/lib/CPANPLUS/Config/User.pm)
  CPAN Terminal> q

  Exiting CPANPLUS shell

Now you do not have to use the explicit --format flag:

  $ cpan2dist Acme::Bleach

After dist_type is set, CPANPLUS will automatically package anything you install using cpanp. Score! You could then package and install the Acme::Bleach module like so:

  $ cpanp i Acme::Bleach

WHERE IS THE PACKAGE?

Packages are stored under the user's home directory, (the HOME environment variable) under the .cpanplus directory. Two seperate directories are created for building packages and for storing the resulting package file.

Build Directory: ~/.cpanplus/5.10.0/pacman/build
Package Directory:  ~/.cpanplus/5.10.0/pacman/pkg

Where 5.10.0 represents the version of perl you used to build the package and ~/.cpanplus represents the base directory chosen in your CPANPLUS config.

You can change the destination by setting PKGDEST in your /etc/makepkg.conf file. The PACKAGER in /etc/makepkg.conf is inserted into the PKGBUILD comment header. If there is no PACKAGER set, then 'Anonymous' is used, instead.

Offline

Board footer

Powered by FluxBB