Project:Perl/Eclass cleanup

This page contains notes on analyzing perl-module.eclass and proposing simplifications / updates / improvements.

Phase functions
Since dropping EAPI=0,1,2,3 support, the following phase functions are exported for PERL_EXPORT_PHASE_FUNCTIONS=yes
 * src_unpack src_compile src_test src_install src_prepare src_configure
 * in perl-core, additionally pkg_postinst pkg_postrm

src_unpack

 * exported
 * only calls unpacker
 * should be dropped completely in EAPI=6

src_prepare

 * exported
 * applies PATCHES
 * applies user patches
 * removes files from PERL_RM_FILES
 * applies extra OS-X fixes
 * esvn_clean

src_configure

 * exported
 * calls set_version
 * does a lot more stuff, tbd
 * calls "perl Build.PL" or "perl Makefile.PL"

src_compile

 * exported
 * calls set_version
 * if src_configure isnt exported, calls src_prep (OBSOLETE)
 * builds

src_test

 * exported
 * runs tests depending on SRC_TEST

src_install

 * exported
 * calls set_version
 * runs install
 * calls delete_module_manpages
 * calls delete_localpod
 * calls delete_packlist
 * calls remove_temppath
 * installs docs
 * links duallife scripts

pkg_setup

 * NOT EXPORTED
 * calls perl_set_version
 * all occurences removed in the main tree

pkg_preinst

 * NOT EXPORTED
 * calls perl_set_version
 * all occurences removed in the main tree

pkg_postinst

 * exported in perl-core
 * calls link_duallife_scripts
 * all occurences outside perl-core removed in the main tree

pkg_prerm

 * NOT EXPORTED
 * does not do anything!
 * all occurences removed in the main tree

pkg_postrm

 * exported in perl-core
 * calls link_duallife_scripts
 * all occurences outside perl-core removed in the main tree

src_prep
./net-print/cups-filters/cups-filters-9999.ebuild:             perl-module_src_prep ./net-print/cups-filters/cups-filters-1.0.53.ebuild:           perl-module_src_prep ./net-print/cups-filters/cups-filters-1.0.54.ebuild:           perl-module_src_prep ./dev-tex/html2latex/html2latex-1.1-r1.ebuild: perl-module_src_prep ./app-pda/pilot-link/pilot-link-0.12.5-r1.ebuild:              perl-module_src_prep ./media-gfx/graphite2/graphite2-1.2.1.ebuild:          perl-module_src_prep ./media-gfx/graphite2/graphite2-1.2.4-r1.ebuild:               perl-module_src_prep ./media-gfx/graphite2/graphite2-1.2.4.ebuild:          perl-module_src_prep ./sci-libs/gdal/gdal-1.10.1.ebuild:            perl-module_src_prep ./sci-libs/gdal/gdal-1.10.0-r1.ebuild:         perl-module_src_prep ./sci-libs/gdal/gdal-1.9.2.ebuild:             perl-module_src_prep ./sci-libs/gdal/gdal-1.11.1.ebuild:            perl-module_src_prep
 * calls src_configure
 * deprecated, to be removed
 * manually called in the following packages:

perlinfo
Basically just an abbreviation for perl_set_version.
 * calls set_version
 * all occurences removed in the main tree

perl_set_version

 * exits if it has already been run
 * defines variables according to Perl installation: PERL_VERSION, SITE_ARCH, SITE_LIB, ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
 * published API; documentation:
 * 1) @FUNCTION: perl_set_version
 * 2) @USAGE: perl_set_version
 * 3) @DESCRIPTION:
 * 4) Extract version information and installation paths from the current Perl
 * 5) interpreter.
 * 6) This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB,
 * 7) ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
 * 8) This function used to be called perlinfo as well.
 * 1) This function used to be called perlinfo as well.
 * 1) This function used to be called perlinfo as well.

fixlocalpod

 * calls delete_localpod
 * abbreviation for perl_delete_localpod, deprecated, to be removed
 * all occurences removed in the main tree

perl_delete_localpod

 * removes all perllocal.pod and empty directories
 * published API; documentation:
 * 1) @FUNCTION: perl_delete_localpod
 * 2) @USAGE: perl_delete_localpod
 * 3) @DESCRIPTION:
 * 4) Remove stray perllocal.pod files in the temporary install directory D.
 * 5) This function used to be called fixlocalpod as well.
 * 1) This function used to be called fixlocalpod as well.

fix_osx_extra

 * removes all that AppleDouble garbage
 * nowhere manually called

delete_module_manpages

 * removes stray manpages
 * nowhere manually called

delete_packlist
./net-analyzer/rrdtool/rrdtool-1.4.8-r3.ebuild:        perl_delete_packlist ./net-analyzer/rrdtool/rrdtool-1.4.8-r1.ebuild:        perl_delete_packlist ./net-analyzer/rrdtool/rrdtool-1.4.9.ebuild:           perl_delete_packlist ./app-mobilephone/obexftp/obexftp-0.23-r2.ebuild:              perl_delete_packlist ./www-apache/mod_perl/mod_perl-2.0.7-r1.ebuild: perl_delete_packlist ./www-apache/mod_perl/mod_perl-2.0.8.ebuild:   perl_delete_packlist
 * removes .packlist files and empty dirs
 * manually called in the following packages:

remove_temppath
./www-apache/mod_perl/mod_perl-2.0.7-r1.ebuild: perl_remove_temppath ./www-apache/mod_perl/mod_perl-2.0.8.ebuild:   perl_remove_temppath
 * seds out D from (text) Perl files, and warns
 * manually called in the following packages:

rm_files

 * removes files from package and manifest
 * nowhere manually called

link_duallife_scripts

 * exits if not in perl-core and if not recent perl
 * complicated, makes the alternatives links
 * nowhere manually called

Variables
Undocumented:
 * ARCH_LIB
 * GENTOO_DEPEND_ON_PERL
 * GENTOO_DEPEND_ON_PERL_SUBSLOT
 * MY_PN
 * MY_PV
 * MODULE_VERSION
 * MODULE_A
 * MODULE_A_EXT
 * MODULE_AUTHOR
 * PERL_EXPORT_PHASE_FUNCTIONS
 * PERL_VERSION
 * PERLQAFATAL
 * PREFER_BUILDPL
 * SITE_ARCH
 * SITE_LIB
 * SRC_PREP
 * SRC_TEST
 * TEST_VERBOSE
 * VENDOR_LIB
 * VENDOR_ARCH