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
./app-misc/hivex/hivex-1.3.7-r1.ebuild:        perl-module_pkg_setup ./sci-geosciences/mapserver/mapserver-6.0.1-r1.ebuild: use perl && perl-module_pkg_setup ./app-text/enscript/files/ebuild.st:|perl-module_src_install|perl-module_pkg_setup|perl-module_pkg_preinst\ ./media-video/dvdrip/dvdrip-0.98.11-r2.ebuild: perl-module_pkg_setup ./www-apache/libapreq2/libapreq2-2.13-r1.ebuild:       perl-module_pkg_setup ./media-gfx/graphite2/graphite2-1.2.1.ebuild:  use perl && perl-module_pkg_setup ./media-gfx/graphite2/graphite2-1.2.4-r1.ebuild:       use perl && perl-module_pkg_setup ./media-gfx/graphite2/graphite2-1.2.4.ebuild:  use perl && perl-module_pkg_setup ./dev-perl/Apache-Test/Apache-Test-1.380.0-r1.ebuild:  perl-module_pkg_setup ./dev-perl/HTML-Mason/HTML-Mason-1.510.0.ebuild:       perl-module_pkg_setup ./dev-perl/HTML-Mason/HTML-Mason-1.540.0.ebuild:       perl-module_pkg_setup ./dev-perl/PDL/PDL-2.4.11.ebuild:      perl-module_pkg_setup ./sci-libs/linux-gpib/linux-gpib-3.2.20-r1.ebuild:     use perl && perl-module_pkg_setup ./dev-libs/lockdev/lockdev-1.0.3.1.2-r2.ebuild: use perl && perl-module_pkg_setup ./dev-libs/lockdev/lockdev-1.0.3.1.2-r3.ebuild: use perl && perl-module_pkg_setup ./dev-libs/libsolv/libsolv-0.3.0.ebuild:       use perl && perl-module_pkg_setup ./dev-libs/libsolv/libsolv-0.6.6.ebuild:       use perl && perl-module_pkg_setup ./dev-libs/OpenSRF/OpenSRF-2.1.1.ebuild:       perl-module_pkg_setup ./dev-libs/OpenSRF/OpenSRF-1.2.0.ebuild:       perl-module_pkg_setup
 * NOT EXPORTED
 * calls set_version
 * manually called in the following packages:

pkg_preinst
./sci-geosciences/mapserver/mapserver-6.0.1-r1.ebuild: use perl && perl-module_pkg_preinst ./app-text/enscript/files/ebuild.st:|perl-module_src_install|perl-module_pkg_setup|perl-module_pkg_preinst\ ./app-pda/pilot-link/pilot-link-0.12.5-r1.ebuild:      perl-module_pkg_preinst ./sci-libs/linux-gpib/linux-gpib-3.2.20-r1.ebuild:     use perl && perl-module_pkg_preinst ./dev-libs/dbxml/dbxml-2.5.16-r2.ebuild:       perl-module_pkg_preinst ./dev-libs/lockdev/lockdev-1.0.3.1.2-r2.ebuild: use perl && perl-module_pkg_preinst ./dev-libs/lockdev/lockdev-1.0.3.1.2-r3.ebuild: use perl && perl-module_pkg_preinst ./net-misc/youtube-viewer/youtube-viewer-3.0.9-r2.ebuild:      perl-module_pkg_preinst ./net-misc/youtube-viewer/youtube-viewer-3.1.0.ebuild: perl-module_pkg_preinst ./net-misc/youtube-viewer/youtube-viewer-3.1.1.ebuild: perl-module_pkg_preinst
 * NOT EXPORTED
 * calls set_version
 * manually called in the following packages:

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
./sci-geosciences/mapserver/mapserver-6.0.1-r1.ebuild: use perl && perl-module_pkg_prerm ./media-libs/ming/ming-0.4.4.ebuild:   use perl && perl-module_pkg_prerm ./media-libs/ming/ming-0.4.5.ebuild:   use perl && perl-module_pkg_prerm ./app-text/enscript/files/ebuild.st:|perl-module_pkg_postinst|perl-module_pkg_prerm|perl-module_pkg_postrm\ ./eclass/perl-module.eclass:perl-module_pkg_prerm {
 * NOT EXPORTED
 * does not do anything!
 * manually called in the following packages:

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
./net-mail/cyrus-imap-admin/cyrus-imap-admin-2.4.17-r1.ebuild: fixlocalpod             # bug #98122 ./media-libs/ming/ming-0.4.4.ebuild:   fixlocalpod ./media-libs/ming/ming-0.4.5.ebuild:   fixlocalpod ./net-im/pidgin/pidgin-2.10.10.ebuild: use perl && fixlocalpod ./net-im/pidgin/pidgin-2.10.9-r1.ebuild:       use perl && fixlocalpod ./net-im/pidgin/pidgin-2.10.9.ebuild:  use perl && fixlocalpod ./app-text/enscript/files/ebuild.st:|perlinfo|fixlocalpod|updatepod\ ./net-print/cups-filters/cups-filters-9999.ebuild:             fixlocalpod ./net-print/cups-filters/cups-filters-1.0.53.ebuild:           fixlocalpod ./net-print/cups-filters/cups-filters-1.0.54.ebuild:           fixlocalpod ./media-sound/lltag/lltag-0.14.4-r1.ebuild:    fixlocalpod ./www-apache/libapreq2/libapreq2-2.13-r1.ebuild:       fixlocalpod ./www-apache/mod_perl/mod_perl-2.0.7-r1.ebuild: fixlocalpod ./www-apache/mod_perl/mod_perl-2.0.8.ebuild:   fixlocalpod ./dev-vcs/subversion/subversion-1.8.9.ebuild:          fixlocalpod ./dev-vcs/subversion/subversion-1.7.18.ebuild:         fixlocalpod ./dev-vcs/subversion/subversion-1.8.10-r1.ebuild:              fixlocalpod ./dev-vcs/subversion/subversion-1.8.10.ebuild:         fixlocalpod ./dev-vcs/git/git-9999-r1.ebuild:      fixlocalpod ./dev-vcs/git/git-9999.ebuild: fixlocalpod ./dev-vcs/git/git-9999-r2.ebuild:      fixlocalpod ./dev-vcs/git/git-1.8.5.5.ebuild:      fixlocalpod ./dev-vcs/git/git-1.9.3.ebuild: fixlocalpod ./dev-vcs/git/git-1.8.3.2-r1.ebuild:   fixlocalpod ./dev-vcs/git/git-2.1.2.ebuild: fixlocalpod ./dev-vcs/git/git-9999-r3.ebuild:      fixlocalpod ./dev-vcs/git/git-2.1.3.ebuild: fixlocalpod ./dev-vcs/git/git-2.0.4.ebuild: fixlocalpod ./media-gfx/graphite2/graphite2-1.2.1.ebuild:          fixlocalpod ./media-gfx/graphite2/graphite2-1.2.4-r1.ebuild:               fixlocalpod ./media-gfx/graphite2/graphite2-1.2.4.ebuild:          fixlocalpod ./media-gfx/llgal/llgal-0.13.17-r1.ebuild:     fixlocalpod ./www-servers/nginx/nginx-1.7.7.ebuild:        fixlocalpod ./www-servers/nginx/nginx-1.7.6.ebuild:        fixlocalpod ./sci-libs/gdal/gdal-1.10.1.ebuild:    use perl && fixlocalpod ./sci-libs/gdal/gdal-1.10.0-r1.ebuild: use perl && fixlocalpod ./sci-libs/gdal/gdal-1.9.2.ebuild:     use perl && fixlocalpod ./sci-libs/gdal/gdal-1.11.1.ebuild:    use perl && fixlocalpod ./sys-fs/owfs/owfs-2.7_p21-r2.ebuild:  use perl && fixlocalpod ./dev-libs/dbxml/dbxml-2.5.16-r2.ebuild:               fixlocalpod ./dev-libs/stfl/stfl-0.22-r1.ebuild:   fixlocalpod ./dev-libs/stfl/stfl-0.23.ebuild:      fixlocalpod ./dev-libs/libsolv/libsolv-0.3.0.ebuild:       use perl && fixlocalpod ./dev-libs/libsolv/libsolv-0.6.6.ebuild:       use perl && fixlocalpod ./dev-libs/clearsilver/clearsilver-0.10.5-r2.ebuild:           fixlocalpod || die "fixlocalpod failed" ./app-arch/rpm/rpm-4.11.0.1.ebuild:    fixlocalpod ./app-arch/rpm/rpm-4.11.2.ebuild:      fixlocalpod ./app-arch/rpm/rpm-4.11.1.ebuild:      fixlocalpod ./app-arch/rpm/rpm-4.11.2-r1.ebuild:   fixlocalpod ./app-arch/rpm/rpm-4.12.0.1.ebuild:    fixlocalpod ./app-admin/collectd/collectd-5.4.1.ebuild:    fixlocalpod ./app-admin/collectd/collectd-5.4.0.ebuild:    fixlocalpod ./app-emulation/libguestfs/libguestfs-1.26.1.ebuild:   use perl && fixlocalpod ./app-emulation/libguestfs/libguestfs-1.24.0.ebuild:   use perl && fixlocalpod ./net-irc/irssi/irssi-0.8.16.ebuild:   use perl && fixlocalpod ./net-irc/irssi/irssi-0.8.17.ebuild:   use perl && fixlocalpod ./net-irc/irssi/irssi-9999.ebuild:     use perl && fixlocalpod
 * calls delete_localpod
 * this is just an abbreviation for perl_delete_localpod, deprecated, to be removed
 * manually called in the following packages:

delete_localpod
/net-analyzer/rrdtool/rrdtool-1.4.8-r3.ebuild:        perl_delete_localpod ./net-analyzer/rrdtool/rrdtool-1.4.8-r1.ebuild:        perl_delete_localpod ./net-analyzer/rrdtool/rrdtool-1.4.9.ebuild:           perl_delete_localpod ./app-mobilephone/obexftp/obexftp-0.23-r2.ebuild:              perl_delete_localpod ./eclass/perl-module.eclass:   perl_delete_localpod ./eclass/perl-module.eclass:   perl_delete_localpod ./eclass/perl-module.eclass:perl_delete_localpod {
 * removes all perllocal.pod and empty directories
 * manually called in the following packages:

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