From de4000428c8115104054d03f0b91b358bdfda3d8 Mon Sep 17 00:00:00 2001 From: Chris Weyl Date: Tue, 5 Jan 2010 02:29:12 +0000 Subject: [PATCH] - add perl-homedir subpackage --- perl-homedir.csh | 17 +++++++++++++++++ perl-homedir.sh | 16 ++++++++++++++++ perl-local-lib.spec | 32 +++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 perl-homedir.csh create mode 100644 perl-homedir.sh diff --git a/perl-homedir.csh b/perl-homedir.csh new file mode 100644 index 0000000..0e6e35a --- /dev/null +++ b/perl-homedir.csh @@ -0,0 +1,17 @@ +# invoke local::lib + +# default -- invoke local::lib for all users +setenv PERL_HOMEDIR 1 + +# load our configs, aka opportunities to set PERL_HOMEDIR=0 +[ -f /etc/sysconfig/perl-homedir ] && . /etc/sysconfig/perl-homedir +[ -f $HOME/.perl-homedir ] && . $HOME/.perl-homedir + +alias perlll="eval `perl -Mlocal::lib`" + +# if system default +if [ "x$PERL_HOMEDIR" = "x1" ] ; then + + eval `perl -Mlocal::lib` +fi + diff --git a/perl-homedir.sh b/perl-homedir.sh new file mode 100644 index 0000000..3da3def --- /dev/null +++ b/perl-homedir.sh @@ -0,0 +1,16 @@ +# invoke local::lib + +# default -- invoke local::lib for all users +PERL_HOMEDIR=1 + +# load our configs, aka opportunities to set PERL_HOMEDIR=0 +[ -f /etc/sysconfig/perl-homedir ] && . /etc/sysconfig/perl-homedir +[ -f $HOME/.perl-homedir ] && . $HOME/.perl-homedir + +alias perlll="eval `perl -Mlocal::lib`" + +# if system default +if [ "x$PERL_HOMEDIR" = "x1" ] ; then + + eval `perl -Mlocal::lib` +fi diff --git a/perl-local-lib.spec b/perl-local-lib.spec index 5188e7f..8b42cbc 100644 --- a/perl-local-lib.spec +++ b/perl-local-lib.spec @@ -1,6 +1,6 @@ Name: perl-local-lib Version: 1.004009 -Release: 1%{?dist} +Release: 2%{?dist} # lib/local/lib.pm -> GPL+ or Artistic License: GPL+ or Artistic Group: Development/Libraries @@ -11,6 +11,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildArch: noarch +Source10: perl-homedir.sh +Source11: perl-homedir.csh + BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42 BuildRequires: perl(CPAN) >= 1.80 BuildRequires: perl(ExtUtils::CBuilder) @@ -47,6 +50,22 @@ or collection of modules. Useful in cases like when an upstream maintainer hasn't applied a patch to a module of theirs that you need for your application. +%package -n perl-homedir +License: GPL+ or Artistic +Group: Development/Libraries +Summary: Per-user Perl local::lib setup +Requires: %{name} = %{version}-%{release} +Requires: /usr/bin/cpan + +%description -n perl-homedir +perl-homedir configures the system to automatically create a ~/perl5 +directory in each user's $HOME on user login. This allows each user to +install and CPAN packages via the CPAN to their $HOME, with no additional +configuration or privliges, and without installing them system-wide. + +If you want your users to be able to install and use their own Perl modules, +install this package. + %prep %setup -q -n local-lib-%{version} @@ -63,6 +82,10 @@ find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';' %{_fixperms} %{buildroot}/* +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +cp %{SOURCE10} %{buildroot}%{_sysconfdir}/profile.d/ +cp %{SOURCE11} %{buildroot}%{_sysconfdir}/profile.d/ + %check make test @@ -75,7 +98,14 @@ rm -rf %{buildroot} %{perl_vendorlib}/* %{_mandir}/man3/*.3* +%files -n perl-homedir +%defattr(-,root,root,-) +%{_sysconfdir}/profile.d/* + %changelog +* Tue Jan 05 2010 Chris Weyl 1.004009-2 +- add perl-homedir subpackage + * Tue Jan 05 2010 Chris Weyl 1.004009-1 - add perl_default_filter - auto-update to 1.004009 (by cpan-spec-update 0.01)