Project:Perl/Eclass cleanup

From Gentoo Wiki
Jump to: navigation, search

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

Subfunctions

src_prep

  • calls src_configure
  • deprecated, to be removed
  • all occurences removed in the main tree

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:
# @FUNCTION: perl_set_version
# @USAGE: perl_set_version
# @DESCRIPTION:
# Extract version information and installation paths from the current Perl 
# interpreter. 
#
# This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB, 
# ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
#
# 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:
# @FUNCTION: perl_delete_localpod
# @USAGE: perl_delete_localpod
# @DESCRIPTION:
# Remove stray perllocal.pod files in the temporary install directory D.
#
# 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

  • removes .packlist files and empty dirs
  • manually called in the following packages:
./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

remove_temppath

  • seds out D from (text) Perl files, and warns
  • manually called in the following packages:
./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

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