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 src_prep

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
./app-misc/pip/pip-1.2-r2.ebuild:      perl-module_pkg_postinst ./net-analyzer/symon/symon-2.86-r1.ebuild:     use perl && perl-module_pkg_postinst ./net-analyzer/symon/symon-2.87.ebuild: use perl && perl-module_pkg_postinst ./sci-geosciences/mapserver/mapserver-6.0.1-r1.ebuild: use perl && perl-module_pkg_postinst ./media-libs/ming/ming-0.4.4.ebuild:   use perl && perl-module_pkg_postinst ./media-libs/ming/ming-0.4.5.ebuild:   use perl && perl-module_pkg_postinst ./app-text/enscript/files/ebuild.st:|perl-module_pkg_postinst|perl-module_pkg_prerm|perl-module_pkg_postrm\ ./net-print/cups-filters/cups-filters-9999.ebuild:     perl-module_pkg_postinst ./net-print/cups-filters/cups-filters-1.0.53.ebuild:   perl-module_pkg_postinst ./net-print/cups-filters/cups-filters-1.0.54.ebuild:   perl-module_pkg_postinst ./app-mobilephone/obexftp/obexftp-0.23-r2.ebuild:      use perl && perl-module_pkg_postinst ./eclass/perl-module.eclass:perl-module_pkg_postinst { ./games-util/xgamer/xgamer-0.6.2.ebuild:       perl-module_pkg_postinst ./media-video/get_flash_videos/get_flash_videos-1.24-r1.ebuild: perl-module_pkg_postinst ./www-apache/mod_perl/mod_perl-2.0.7-r1.ebuild: perl-module_pkg_postinst ./www-apache/mod_perl/mod_perl-2.0.8.ebuild:   perl-module_pkg_postinst ./dev-db/maatkit/maatkit-7540-r1.ebuild:       perl-module_pkg_postinst ./dev-vcs/subversion/subversion-1.8.9.ebuild:  use perl && perl-module_pkg_postinst ./dev-vcs/subversion/subversion-1.7.18.ebuild: use perl && perl-module_pkg_postinst ./dev-vcs/subversion/subversion-1.8.10-r1.ebuild:      use perl && perl-module_pkg_postinst ./dev-vcs/subversion/subversion-1.8.10.ebuild: use perl && perl-module_pkg_postinst ./dev-perl/RPC-XML/RPC-XML-0.780.0.ebuild:     perl-module_pkg_postinst ./dev-perl/RPC-XML/RPC-XML-0.770.0-r1.ebuild:  perl-module_pkg_postinst ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.500.0.ebuild: perl-module_pkg_postinst ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.510.0.ebuild: perl-module_pkg_postinst ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.400.0.ebuild: perl-module_pkg_postinst ./dev-perl/XML-SAX/XML-SAX-0.990.0-r1.ebuild:  perl-module_pkg_postinst ./dev-perl/Lingua-Stem-Snowball-Da/Lingua-Stem-Snowball-Da-1.10.0-r1.ebuild:   perl-module_pkg_postinst ./sci-libs/linux-gpib/linux-gpib-3.2.20-r1.ebuild:     use perl && perl-module_pkg_postinst ./mail-filter/spamassassin/spamassassin-3.4.0.ebuild:  perl-module_pkg_postinst ./mail-filter/spamassassin/spamassassin-3.3.2-r5.ebuild:       perl-module_pkg_postinst ./net-misc/youtube-viewer/youtube-viewer-3.0.9-r2.ebuild:      perl-module_pkg_postinst ./net-misc/youtube-viewer/youtube-viewer-9999.ebuild:  perl-module_pkg_postinst ./net-misc/youtube-viewer/youtube-viewer-3.1.0.ebuild: perl-module_pkg_postinst ./net-misc/youtube-viewer/youtube-viewer-3.0.8.ebuild: perl-module_pkg_postinst ./net-misc/youtube-viewer/youtube-viewer-3.1.1.ebuild: perl-module_pkg_postinst
 * exported in perl-core
 * calls link_duallife_scripts
 * manually called in the following packages:

pkg_prerm

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

pkg_postrm
./sci-geosciences/mapserver/mapserver-6.0.1-r1.ebuild: use perl && perl-module_pkg_postrm ./media-libs/ming/ming-0.4.4.ebuild:   use perl && perl-module_pkg_postrm ./media-libs/ming/ming-0.4.5.ebuild:   use perl && perl-module_pkg_postrm ./app-text/enscript/files/ebuild.st:|perl-module_pkg_postinst|perl-module_pkg_prerm|perl-module_pkg_postrm\ ./app-mobilephone/obexftp/obexftp-0.23-r2.ebuild:      use perl && perl-module_pkg_postrm ./dev-vcs/subversion/subversion-1.8.9.ebuild:  use perl && perl-module_pkg_postrm ./dev-vcs/subversion/subversion-1.7.18.ebuild: use perl && perl-module_pkg_postrm ./dev-vcs/subversion/ChangeLog: Correctly check for the perl USE flag before calling perl-module_pkg_postrm. ./dev-vcs/subversion/subversion-1.8.10-r1.ebuild:      use perl && perl-module_pkg_postrm ./dev-vcs/subversion/subversion-1.8.10.ebuild: use perl && perl-module_pkg_postrm ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.500.0.ebuild: perl-module_pkg_postrm ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.510.0.ebuild: perl-module_pkg_postrm ./dev-perl/XML-SAX-Expat/XML-SAX-Expat-0.400.0.ebuild: perl-module_pkg_postrm ./net-misc/youtube-viewer/youtube-viewer-3.0.9-r2.ebuild:      perl-module_pkg_postrm ./net-misc/youtube-viewer/youtube-viewer-3.1.0.ebuild: perl-module_pkg_postrm ./net-misc/youtube-viewer/youtube-viewer-3.1.1.ebuild: perl-module_pkg_postrm
 * exported in perl-core
 * calls link_duallife_scripts
 * manually called in the following packages:

src_prep
This is basically the unified configure phase function, which was originally called in src_compile (EAPI=0) or src_configure (later). We may want to merge this back directly into src_configure. ./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 ./eclass/perl-module.eclass:   perl-module_src_prep ./eclass/perl-module.eclass:   has src_configure ${PERL_EXPF} || 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 set_version
 * does a lot more stuff, tbd
 * calls "perl Build.PL" or "perl Makefile.PL"
 * 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